Hi,
I have a simple XHTML page with a command button calling mananged bean action , the action gets called only on second click. Can someone help ?
Primefaces :6.2.11
WebSphere Portal v9
Websphere Application server 9.0.0.9
<p:commandButton value="Register" ajax="false"
action="#{pc_LoginBean.doSelfRegister()}"
styleClass="ui-button-primary" />
@ManagedBean(name = "pc_LoginBean")
@RequestScoped
public class LoginBean
{
public String doSelfRegister()
{
System.out.println("bean action called");
return "success";
}
}
ManagedBean method gets called only second click
Tried replacing the p:commandButton with an h: one? (since you don't have ajax). Does that work?
And if you don't have an h:form, behaviour is sort of not very well defined.
Please try https://www.google.com/search?client=fi ... +click+jsf
And if you don't have an h:form, behaviour is sort of not very well defined.
Please try https://www.google.com/search?client=fi ... +click+jsf
Thanks for your reply.
I have same problem with h;commandbutton , not sure how to debug this, could you please advise ?
<div xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:form>
<p:messages id="messages" showDetail="true" closable="true">
<p:autoUpdate />
</p:messages>
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-g-12">
<p:panelGrid columns="1" cellpadding="2" cellspacing="2"
styleClass="borderlessGrid fullwidth gridzeroleftpadding"
layout="grid" columnClasses="gridzeroleftpadding">
<p:commandButton value="Register" ajax="false"
action="#{pc_LoginBean.doSelfRegister()}"
styleClass="ui-button-primary" />
<h:commandButton value="Register1" ajax="false"
action="#{pc_LoginBean.doSelfRegister()}" />
</p:panelGrid>
</div>
</div>
</div>
</h:form>
</div>
I have same problem with h;commandbutton , not sure how to debug this, could you please advise ?
<div xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:form>
<p:messages id="messages" showDetail="true" closable="true">
<p:autoUpdate />
</p:messages>
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-g-12">
<p:panelGrid columns="1" cellpadding="2" cellspacing="2"
styleClass="borderlessGrid fullwidth gridzeroleftpadding"
layout="grid" columnClasses="gridzeroleftpadding">
<p:commandButton value="Register" ajax="false"
action="#{pc_LoginBean.doSelfRegister()}"
styleClass="ui-button-primary" />
<h:commandButton value="Register1" ajax="false"
action="#{pc_LoginBean.doSelfRegister()}" />
</p:panelGrid>
</div>
</div>
</div>
</h:form>
</div>
If the same happens with an h:commandButton and (mostlikely) the same happens when you don't use a PrimeFaces panelgrid or any PrimeFaces other component, this most likely is a question for StackOverflow and not for this forum. Please make sure then you have a real 'mcve' https://stackoverflow.com/help/mcve then.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 29 guests