1

When I click to menuitem with id "menuItemId" first time, blockUI is working good but when I click to menuitem again It is not working. Is there any idea?

By the way there are tabs in my content and if user clicks "menuItemId" then tab1 renders, if user clicks "menuItemId2" then tab2 renders and tab1 disappers.

Here is my full page layout;

</p:layout>
....
<p:layoutUnit id="centerLayoutUnit" position="center" style="border: none">                
            <ui:insert name="content">Put default content here, if any.</ui:insert>
        </p:layoutUnit>
    </p:layout>

My index page;

<ui:define name="west">
            <h:form id="westForm">
               <p:panelMenu style="width:200px">
                    <p:submenu label="createUser">
                        <p:menuitem id="menuItemId" ..../>
                        <p:menuitem id="menuItemId2"..../>
                <p:blockUI block=":centerLayoutUnit" trigger="menuItemId">  
                    Loading<br />
                    <p:graphicImage library="images" name="loading.gif"/>  
                </p:blockUI>
            </h:form> 
        </ui:define>
      <ui:define name="content">                 
            <p:panel id="contentPanel">                  
                <p:tabView id="tabView" activeIndex="#{myController.activeIndex}" widgetVar="tabViewWidget">

                  <p:tab title="tab1" rendered="#{myController.tabRenders.get('renderPanel1')}">
                        <ui:include src="createUser.xhtml"/>                            
                    </p:tab>

                  <p:tab title="tab2" rendered="#{myController.tabRenders.get('renderPanel2')}">
                        <ui:include src="createManager.xhtml"/>                            
                    </p:tab>
               </p:tabView>  
            </p:panel> 
        </ui:define>
4

1 回答 1

1

可能是触发器无法正常工作。

可以尝试手动触发吗?未测试此代码!请试一试!

<p:panelMenu style="width:200px">
                    <p:submenu label="createUser">
                        <p:menuitem id="menuItemId" onclick="bui.show()" oncomplete="bui.hide()"..../>
                        <p:menuitem id="menuItemId2" onclick="bui.show()" oncomplete="bui.hide()"..../>
                <p:blockUI block=":centerLayoutUnit" widgetVar="bui">  
                    Loading<br />
                    <p:graphicImage library="images" name="loading.gif"/>  
                </p:blockUI>
于 2013-10-07T12:35:21.240 回答