开发者

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

开发者 https://www.devze.com 2022-12-25 09:03 出处:网络
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.

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>
   开发者_StackOverflow <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.


The problem was due to custom code in our NavigationItem.java class, which returned null when onclick property was provided.

0

精彩评论

暂无评论...
验证码 换一张
取 消