开发者

rich:modalPanel appearing for some seconds only

开发者 https://www.devze.com 2023-03-19 05:21 出处:网络
I have used rich:menuItem to display rich:modalpanel. Code of rich:menuItem is as follow: <rich:menuItem>

I have used rich:menuItem to display rich:modalpanel. Code of rich:menuItem is as follow:

<rich:menuItem>
    <a4j:commandLink
        value="Add Machine"
        oncomplete="#{rich:component('addMachinePanel')}.show()"
        reRender="addMachinePanel">
   </a4j:commandLink>
</rich:menuItem>

And rich:modalpanel code is

<rich:modalPanel id="addMachinePanel">
    <a4j:form>
        <a4j:commandButton value="Cancel"
            act开发者_如何学Pythonion="#{adminBean.cleanupMachineToEdit}"
            onclick="#{rich:component('addMachinePanel')}.hide(); return false;" />
    </a4j:form>
</rich:modalPanel>

With above piece of code, rich:modalpanel is appearing for one or two seconds and again disappear. Please help me to find out the issue.

Thanks


By default , the submitMode attribute for the rich:menuItem is server , which will submit the form and completely refreshes the page.

You can change the submitMode to the ajax to performs an ajax form submission. Only the elements specified with the reRender attribute will be refreshed instead of whole page.

Or , you can change it to none (for richfaces 3.X) or client (for richface 4.0) such that there are no form submission.

<rich:menuItem submitMode="ajax">
    <a4j:commandLink
        value="Add Machine"
        oncomplete="#{rich:component('addMachinePanel')}.show()"
        reRender="addMachinePanel">
   </a4j:commandLink>
</rich:menuItem>
0

精彩评论

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