Hi,
There has been many occassion when i see that p:commandButton is not working, but h:commandButton is working..
p:commandButton works, but at times it just does not.
It does not throw any error, but it does not call the backing bean method.. just replace it by h:commandButton and it works.
Any clue why it behaves this way ?
p:commandButton and h:commandButton
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Sometimes, Many occasions? You need to be more clear.
for instance. When you use h:commandButton selection in dataTable not works. Selected row is always empty.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
No code, no help.
I am sorry for the delay.. I did not get any automated reply, so could not see your replies until now.
My code is as follows. updateUser() never gets called... I tried changing the scope of the backing bean to ViewScope from RequestScope. But that didn't help.
Even if I type a wrong name instead of updateUser(), it does not throw any error.
<h:panelGroup rendered="#{flash.showMoreUserInfo}"
id="showMoreUserInfoID">
<c:set property="showMoreUserInfo" target="#{flash}" value="null"/>
<h:outputText
style="font:Arial; font-size:x-large; font-style:italic; color:grey; "
value="Under Construction !!" />
<br />
<h:panelGrid columns="2" cellpadding="20" cellspacing="100">
<h:panelGrid columns="1" id="grid">
<p:panel header="Account Information"
rendered="#{headerBacking.currentUser.id eq userPageBacking.user.id}">
<h:panelGrid columns="3" cellspacing="10" >
<h:outputText value="Bank Name : " />
<p:inputText id="bankName"
value="#{userPageBacking.user.wudAccountDetail.wadBankname}" />
<h:message for="bankName" showDetail="true" />
<h:outputText value="Account Number : " />
<p:inputText id="accNumber"
value="#{userPageBacking.user.wudAccountDetail.wadAccountNumber}" />
<h:message for="accNumber" showDetail="true" />
<h:outputText value="Account Holder Name : " />
<p:inputText id="holderName"
value="#{userPageBacking.user.wudAccountDetail.wadAccountHolderName}" />
<h:message for="holderName" showDetail="true" />
</h:panelGrid>
</p:panel>
<h:panelGrid columns="2" cellspacing="10">
<p:growl sticky="true" showDetail="false" />
<p:commandButton value="Update"
action="#{userPageBacking.updateUser}"
oncomplete="dlg.show()" />
</h:panelGrid>
</h:panelGrid>
<p:dialog widgetVar="dlg">
<p:panel style="width:300px; height: 200px;">
<h:outputText
value="Details of #{headerBacking.currentUser.wuFirstName} updated." />
</p:panel>
</p:dialog>
</h:panelGrid>
</h:panelGroup>
The first line is a print in updateUser(), but it never gets called.
public String updateUser() {
System.out.println("updateUser outside :" + getUser());
..............
My code is as follows. updateUser() never gets called... I tried changing the scope of the backing bean to ViewScope from RequestScope. But that didn't help.
Even if I type a wrong name instead of updateUser(), it does not throw any error.
<h:panelGroup rendered="#{flash.showMoreUserInfo}"
id="showMoreUserInfoID">
<c:set property="showMoreUserInfo" target="#{flash}" value="null"/>
<h:outputText
style="font:Arial; font-size:x-large; font-style:italic; color:grey; "
value="Under Construction !!" />
<br />
<h:panelGrid columns="2" cellpadding="20" cellspacing="100">
<h:panelGrid columns="1" id="grid">
<p:panel header="Account Information"
rendered="#{headerBacking.currentUser.id eq userPageBacking.user.id}">
<h:panelGrid columns="3" cellspacing="10" >
<h:outputText value="Bank Name : " />
<p:inputText id="bankName"
value="#{userPageBacking.user.wudAccountDetail.wadBankname}" />
<h:message for="bankName" showDetail="true" />
<h:outputText value="Account Number : " />
<p:inputText id="accNumber"
value="#{userPageBacking.user.wudAccountDetail.wadAccountNumber}" />
<h:message for="accNumber" showDetail="true" />
<h:outputText value="Account Holder Name : " />
<p:inputText id="holderName"
value="#{userPageBacking.user.wudAccountDetail.wadAccountHolderName}" />
<h:message for="holderName" showDetail="true" />
</h:panelGrid>
</p:panel>
<h:panelGrid columns="2" cellspacing="10">
<p:growl sticky="true" showDetail="false" />
<p:commandButton value="Update"
action="#{userPageBacking.updateUser}"
oncomplete="dlg.show()" />
</h:panelGrid>
</h:panelGrid>
<p:dialog widgetVar="dlg">
<p:panel style="width:300px; height: 200px;">
<h:outputText
value="Details of #{headerBacking.currentUser.wuFirstName} updated." />
</p:panel>
</p:dialog>
</h:panelGrid>
</h:panelGroup>
The first line is a print in updateUser(), but it never gets called.
public String updateUser() {
System.out.println("updateUser outside :" + getUser());
..............
Hi,
I kind of got the problem, but do not know how it can be solved.
basically I have some links in the page, which when clicked populate the account info to be updated. it is like,
<p:commandLink value="More about myself..."
update="contentform:userRightID" style="font-size:small;">
<f:setPropertyActionListener
target="#{flash.showMoreUserInfo}" value="true" />
</p:commandLink>
So when the link is clicked the viewRoot is reset to null and the action does not know whom to associate... can this be the case ?
I kind of got the problem, but do not know how it can be solved.
basically I have some links in the page, which when clicked populate the account info to be updated. it is like,
<p:commandLink value="More about myself..."
update="contentform:userRightID" style="font-size:small;">
<f:setPropertyActionListener
target="#{flash.showMoreUserInfo}" value="true" />
</p:commandLink>
So when the link is clicked the viewRoot is reset to null and the action does not know whom to associate... can this be the case ?
-
- Information
-
Who is online
Users browsing this forum: No registered users and 38 guests