1 Reply Latest reply on Mar 23, 2009 11:38 AM by Ilya Shaikovsky

    Send parameter (f:setPropertyActionListener) to modalPanel

    Valentyn Polischuk Newbie

      Hello. I have problem about send parameter to bean. I use f:setPropertyActionListener for set #{userLdap.selectServerLDAP} and when open modalpanel field <h:outputText value="Server Name: #{groupLdap.selectServerLDAP.name}" styleClass="label"/> is null. I try use a4j:outputPanel but this not help.


      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.ajax4jsf.org/rich"
      xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">

      <f:view>
      <rich:panel id="listServersLDAPPanel" style="width: 99.6%; height: 596px;">
      <f:facet name="header"><h:outputText value="List LDAP Servers" styleClass="cursorDefault"/></f:facet>

      <h:form>
      <a4j:region>
      <rich:dataTable
      width="100%" rows="25"
      onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
      value="#{ldapManager.serversDataModel}"
      var="serverLDAPItem" rowKeyVar="serverRow" id="serversLDAPTable">

      <rich:column sortBy="#{serverLDAPItem.name}">
      <f:facet name="header">
      <h:outputText value="Name" styleClass="cursorDefault"/>
      </f:facet>
      <h:outputText value="#{serverLDAPItem.name}" styleClass="cursorDefault"/>
      </rich:column>
      <rich:column sortBy="#{serverLDAPItem.nameInNamespace}">
      <f:facet name="header">
      <h:outputText value="Name In Namespace" styleClass="cursorDefault"/>
      </f:facet>
      <h:outputText value="#{serverLDAPItem.nameInNamespace}" styleClass="cursorDefault"/>
      </rich:column>

      <rich:column>
      <f:facet name="header">
      <h:outputText value="Actions" styleClass="cursorDefault"/>
      </f:facet>
      <a4j:commandButton ajaxSingle="true" id="createUserButton" value="Create User"
      action="#{userLdap.createUser}"
      oncomplete="#{rich:component('userModalPanel')}.show()"
      styleClass="rsButton">
      <f:setPropertyActionListener value="#{serverLDAPItem}"
      target="#{userLdap.selectServerLDAP}"/>
      </a4j:commandButton>
      <a4j:commandButton ajaxSingle="true" id="viewUserGroupButton" value="View Users and Groups"
      oncomplete="#{rich:component('viewUserGroupPanel')}.show()"
      styleClass="rsButton">
      <f:setPropertyActionListener value="#{serverLDAPItem}"
      target="#{viewUserGroupLdap.selectServerLDAP}"/>
      </a4j:commandButton>
      </rich:column>

      <f:facet name="footer">
      <rich:datascroller renderIfSinglePage="false"/>
      </f:facet>
      </rich:dataTable>
      </a4j:region>
      </h:form>

      <rich:modalPanel id="userModalPanel" autosized="true" width="450">
      <f:facet name="header">
      <h:outputText value="Create User" styleClass="cursorDefault"/>
      </f:facet>
      <f:facet name="controls">
      <h:panelGroup>
      <h:graphicImage value="/images/close.png" id="hidelinkCreateUser" styleClass="hidelink"/>
      <rich:componentControl for="userModalPanel" attachTo="hidelinkCreateUser"
      operation="hide" event="onclick"/>
      </h:panelGroup>
      </f:facet>
      <h:form id="createUserForm">
      <a4j:outputPanel id="createUserFormAPanel" ajaxRendered="true">
      <h:outputText value="Server Name: #{groupLdap.selectServerLDAP.name}" styleClass="label"/>
      <rich:separator lineType="beveled" height="3" width="100%"
      style="text-align: center; margin-top: 10px; margin-bottom: 10px;"/>
      </a4j:outputPanel>
      </h:form>
      </rich:modalPanel>

      <rich:modalPanel id="viewUserGroupPanel" autosized="true" width="550">
      <f:facet name="header">
      <h:outputText value="View Users and Groups" styleClass="cursorDefault"/>
      </f:facet>
      <f:facet name="controls">
      <h:panelGroup>
      <h:graphicImage value="/images/close.png" id="hidelinkViewUserGroup" styleClass="hidelink"
      style="vertical-align:middle;"/>
      <rich:componentControl id="viewUserGroupControl" for="viewUserGroupPanel"
      attachTo="hidelinkViewUserGroup"
      operation="hide" event="onclick"/>
      </h:panelGroup>
      </f:facet>
      <h:form id="viewUserGroupForm">
      <a4j:outputPanel id="viewUserGroupFormAPanel" ajaxRendered="true">
      <h:outputText value="Server Name: #{groupLdap.selectServerLDAP.name}" styleClass="label"/>
      <rich:separator lineType="beveled" height="3" width="100%"
      style="text-align: center; margin-top: 10px; margin-bottom: 10px;"/>

      <rich:tabPanel id="viewUserGroupTab" switchType="ajax">
      <rich:tab label="List Groups">
      <rich:dataTable
      width="100%" rows="15"
      onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
      id="groupListTable" var="groupItem"
      value="#{viewUserGroupLdap.groupsDataModel}">
      <rich:column sortBy="#{groupItem.groupName}">
      <f:facet name="header">
      <h:outputText value="Group Name" styleClass="cursorDefault"/>
      </f:facet>
      <h:outputText value="#{groupItem.groupName}" styleClass="cursorDefault"/>
      </rich:column>
      <rich:column sortBy="#{groupItem.gidNumber}">
      <f:facet name="header">
      <h:outputText value="GID Number" styleClass="cursorDefault"/>
      </f:facet>
      <h:outputText value="#{groupItem.gidNumber}" styleClass="cursorDefault"/>
      </rich:column>
      <rich:column>
      <f:facet name="header">
      <h:outputText value="Actions" styleClass="cursorDefault"/>
      </f:facet>

      </rich:column>
      </rich:dataTable>
      </rich:tab>

      <rich:tab label="List Users">
      <rich:dataTable
      width="100%" rows="15"
      onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
      id="userListTable" var="userItem" value="#{viewUserGroupLdap.usersDataModel}">
      <rich:column sortBy="#{userItem.login}">
      <f:facet name="header">
      <h:outputText value="Login" styleClass="cursorDefault"/>
      </f:facet>
      <h:outputText value="#{userItem.login}" styleClass="cursorDefault"/>
      </rich:column>
      <rich:column sortBy="#{userItem.fullName}">
      <f:facet name="header">
      <h:outputText value="Full Name" styleClass="cursorDefault"/>
      </f:facet>
      <h:outputText value="#{userItem.fullName}" styleClass="cursorDefault"/>
      </rich:column>
      <rich:column sortBy="#{userItem.groups}">
      <f:facet name="header">
      <h:outputText value="Groups" styleClass="cursorDefault"/>
      </f:facet>
      <h:outputText value="#{userItem.groups}" styleClass="cursorDefault"/>
      </rich:column>
      <rich:column>
      <f:facet name="header">
      <h:outputText value="Actions" styleClass="cursorDefault"/>
      </f:facet>
      <a4j:commandButton ajaxSingle="true" id="editUserButton" value="Edit User"
      action="#{userLdap.editUser}"
      oncomplete="#{rich:component('userModalPanel')}.show()"
      styleClass="rsButton">

      <f:setPropertyActionListener value="#{userItem}"
      target="#{userLdap.userItem}"/>
      <f:setPropertyActionListener value="#{viewUserGroupLdap.selectServerLDAP}"
      target="#{userLdap.selectServerLDAP}"/>
      </a4j:commandButton>
      </rich:column>
      </rich:dataTable>
      </rich:tab>
      </rich:tabPanel>
      </a4j:outputPanel>
      </h:form>
      </rich:modalPanel>

      <a4j:status onstart="#{rich:component('wait')}.show()" onstop="#{rich:component('wait')}.hide()"/>

      <rich:modalPanel id="wait" autosized="true" width="200" height="120" moveable="false" resizeable="false">
      <f:facet name="header">
      <h:outputText value="Processing"/>
      </f:facet>
      <h:outputText value="Wait Please..."/>
      </rich:modalPanel>

      </rich:panel>
      </f:view>
      </ui:composition>