2
votes

I have embedded prettyfaces recently into my webapp and now I have really strange behavior.

I have an update user form with a commandbutton: The commmandbutton look likes following.

Neither command link nor command button invokes action method which is in thee bean. My bean is a View-Scoped bean.

When I click the button, the page simply reloaded and the action which is defined to be called is not invoked! Simply, just page reload performs.

<p:commandButton style=" float: right; margin-left: 10px; " id="saveEditUser" update=":form" value="Save" action="#{editUser.updateUser()}"  ajax="false" />

But, when I remove the related lines in prettyfaces, then my page works find. ( following is what I have defined in prettyfaces related to edit user)

<url-mapping id="EditUser" onPostback="false">
    <pattern value="/User/Edit/#{initalUserName}" />
    <view-id value="/user/EditUser.xhtml" />
</url-mapping>
2

2 Answers

0
votes

Is the method editUser.updateUser() really called after a click on the button? (use a breakpoint to make sure)

My guess is your mapping should be :

<url-mapping id="EditUser" onPostback="false">
    <pattern value="/User/Edit/#{initalUserName}" />
    <view-id value="/user/EditUser.jsf" />
</url-mapping>

Note the .xhtml being replaced by .jsf

0
votes

By bring changes on the pretty faces it works now.

<url-mapping id="EditUser" onPostback="false">
    <pattern value="/EditUser/" />
    <view-id value="/user/EditUser.xhtml" />
            <query-param name="initalUserName"> #{editUser.initalUserName} </query-param>
</url-mapping>

Note: even when I change without backslash again same issue happen.