JSF Page does not submit when onclick javascript is added to menu item?

Posted by Padmarag on Stack Overflow See other posts from Stack Overflow or by Padmarag
Published on 2010-03-31T06:46:00Z Indexed on 2010/03/31 6:53 UTC
Read the original article Hit count: 708

Filed under:
|
|
|

I show some detail using popup windows. I want to close those when the user clicks on sign-out link. I have a JavaScript function that'll close the windows.
The sign-out link is rendered using Navigation MenuModel. The definition in faces-config is as below -

<managed-bean>
    <managed-bean-name>signoutNavigation</managed-bean-name>
    <managed-bean-class>com.xxx.xxx.framework.NavigationItem</managed-bean-class>
    <managed-bean-scope>none</managed-bean-scope>
    <managed-property>
        <property-name>label</property-name>
        <value>Sign Out</value>
    </managed-property>
    <managed-property>
        <property-name>viewId</property-name>
        <value>/signout.jsp</value>
    </managed-property> 
    <managed-property>
        <property-name>outcome</property-name>
        <value>signout</value>
    </managed-property> 
    <managed-property>
        <property-name>onclick</property-name>
        <value>closeOrderWindows()</value>
    </managed-property>     
</managed-bean>

The problem is when I use the "onclick" property on managed-bean, the page doesn't submit to "signout.jsp" and remains on same page.
When I remove/comment the "onclick" part, the page gets submitted properly.

I use MyFaces Trinidad.

© Stack Overflow or respective owner

Related posts about jsf

Related posts about java