You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by sL07 <lu...@asteriski.com> on 2006/11/01 06:54:32 UTC

Re: How to troubleshoot a 'commandButton' problem in myfaces

if u traced the lifecycle using phasetracker u will notice that there is an
error in one of the phases. It is the phase that tries to set the
userForm.user.id. 

If the problem is similar to what i have experience it is due to the the
object 'user' being null at this point. I dont have the complete jsf
explanation but the choices to correct this are 

1) make the object a simple type ie userform.user_id
2) construct the user object in the constructor of the userform.

if i have confused the issue then my apologies.

good luck

-lp


ying lcs wrote:
> 
> Hi,
> I have a button like this:
> 
> When I click 'save' it is supposed to call the save() of the UserForm.
>  But it does not get called.
> Interesting thing is if I remove this line from the file, the save()
> function of UserForm get called.
> 
> <!-- if I remove this line, it works -->
> "<h:inputHidden value="#{userForm.user.id}" id="id"/>"
> 
> 
> Here is the line for the save button.
> 
>  <h:panelGroup styleClass="buttonBar bottom">
>         <h:commandButton value="#{text['button.save']}"
> action="#{userForm.save}" styleClass="button"/>
> 
>         <h:commandButton value="#{text['button.cancel']}"
> action="#{userForm.cancel}" immediate="true"
>             styleClass="button" onclick="bCancel=true"/>
>     </h:panelGroup>
> 
> Any idea how can I trouble-shoot this problem?
> 
> Thank you.
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-troubleshoot-a-%27commandButton%27-problem-in-myfaces-tf2547646.html#a7108543
Sent from the MyFaces - Users mailing list archive at Nabble.com.