开发者

commandLink action in ui:composition is not invoked

开发者 https://www.devze.com 2023-03-19 05:31 出处:网络
i have page with menu in left side and content in the right every commandLink in left menu change the snippet of the content and activate function that update the current user details (every ):

i have page with menu in left side and content in the right every commandLink in left menu change the snippet of the content and activate function that update the current user details (every ):

in profile.xhtml : in ui:composition tag.

<ui:define name="menuLeft">
        <div id="Div2" style="width:172px; padding: 0; font-size: 10px; float:left">
                <ui:include src="/users/sections/profile/profileleft.xhtml"/>
        </div>
</ui:define>

<ui:define name="content">
        <div id="Div3" style="background-color:white; width: 708px; height:1208px; padding: 0; font-size: 12px; float:left">
                <ui:include src="/users/sections/profile/content.xhtml"/>
        </div>
</ui:define>

<ui:define name="menuRight"/>

in content.xhtml: in ui:composition tag.

<h:panelGroup id="profileContentSnippet" >
    <ui:include  src="#{snippetsProfileLinkerBean.snippetFileName}"/>
</h:panelGroup>

in profileleft.xhtml in ui:composition tag.

<ui:include src="/users/source/profile/leftMenu/menu.xhtml"/>

in menu.xhtml: in ui:composition tag.

          <h:commandLink value="ViewProfilePersonalDetails" action="#{usersController.prepareConnected}">
         <f:param  name="pageViewId" value="ViewProfilePersonalDetails"/>
         <f:ajax render="main:profileContentSnippet"  />  
      </h:commandLink> 

in editPersonalDetails-snippet.xhtml: in ui:composition tag.

      <h:outputText value="#{bundle.ViewUsersLabel_userID}"/>
           <h:outputText value="#{usersController.selected.userID}" title="# {bundle.ViewUsersTitle_userID}"/>

      <h:commandLink action="#{usersController.prepareProfileConnected}" value="view" actionListener="#{snippetsProfileLinkerBean.action}">
                   <f:attribute name="pageToViewId" value="ViewProfilePersonalDetails" />
                   <f:ajax r开发者_高级运维ender="main:profileContentSnippet"  />

in viewPersonalDetails-snippet.xhtml: in ui:composition tag.

   <h:commandLink action="#{usersController.prepareProfileConnected}" value="edit" actionListener="#{snippetsProfileLinkerBean.action}">
                   <f:attribute name="pageToViewId" value="EditProfilePersonalDetails" />
                   <f:ajax render="main:profileContentSnippet"  />

   <h:outputText value="#{bundle.ViewUsersLabel_userID}"/>
   <h:outputText value="#{usersController.selected.userID}" title="#{bundle.ViewUsersTitle_userID}"/>


  </h:commandLink>

the usersController is request bean that have prepareProfileConnected function that update her selected fild with user details from DB. the snippetsProfileLinkerBean is request bean that have two options for getting the snippet file name : by f:param or by using action(ActionEvent event) function.

when i click in the left menu everything is working i get the snippet and i see the user ID. THE BIG PROBLEM IS when i click the edit or the view in the snippet files that also need to activate function to get user details and change snippet, in some cases the

h:commandLink in the snippets dont work at all.

HOW can I activate h:commandLink in snippet - that will change the snippet file and also call the function in usersController to update user details?

0

精彩评论

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