Search code examples
jsf-2primefacesprettyfaces

Command button doesn't calls it's action method after including prettyfaces


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>

Solution

  • 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.