3 Replies Latest reply on Nov 13, 2010 5:57 AM by solomon0566

    Components within TabPanel in modalPanel can be edited only after reopening the modalpanel

    solomon0566

      Hi Experts,

       

      I have jsp page displaying an extended data table to which a context menu is bound. Upon clicking a menu option, through javascript, a modalPanel is displayed.The modalPanel contains a tab panel.

       

      Whenever the menu option is clicked, the modal panel gets displayed correctly, but the components within the tabpanel cannot be edited.

       

      When the modal panel is closed and reopened through the context menu, the components can be edited.

       

      Request help to resolve this issue. I am learning richfaces through try & learn method. What am I doing wrong here??? I have attached the relevant code fragments.

       

      Thanks & Regards

       

       

       

      /* page containg extended data table to which a context menu is bound */

      <html>

      <head>

       

      <script language="javascript">

      function showViewDeclPopup()

      {

           Richfaces.showModalPanel('pnlViewDecl',{top:0});

      }

      function hideViewDeclPopup()

      {

           Richfaces.hideModalPanel('pnlViewDecl');

      }

      </script>

       

      </head>

      <body>

      <f:view>

      <h:form rendered="#{loggedOnUser.makeDecl==true}">

       

      <rich:contextMenu attached="false" id="menu" submitMode="ajax">

      <rich:menuItem ajaxSingle="true">

      Edit Declaration

      <a4j:support reRender="pnlViewDecl" actionListener="#{scrapDeclarationController.popupEditDeclaration}" event="onclick" oncomplete="showViewDeclPopup()"></a4j:support>

      </rich:menuItem>

      </rich:contextMenu>

       

       

      <rich:panel header="Search Results">

      <rich:extendedDataTable id="tblSearchResults" var="r" sortMode="single" selectionMode="single" height="200px"

      enableContextMenu="true"

      tableState="#{scrapDeclarationController.edtSearchResultsTableState}"

      selection="#{scrapDeclarationController.edtSearchResultsSelection}"

      binding="#{scrapDeclarationController.edtSearchResults}"

      value="#{scrapDeclarationController.searchResults}" >

      <rich:column id="col1" width="50" sortBy="#{r.declSlNo}" sortable="true" label="Sl.No">

      <f:facet name="header">

      <h:outputText value="Sl.No"></h:outputText>

      </f:facet>

      <h:outputText id="dwgSlNo" value="#{r.declSlNo}"></h:outputText>

      </rich:column>

      <rich:column id="col2" width="50" sortBy="#{r.declUnit.unitShortDesc}" label="Unit">

      <f:facet name="header">

      <h:outputText value="Unit"></h:outputText>

      </f:facet>

      <h:outputText id="unitShortDesc" value="#{r.declUnit.unitShortDesc}"></h:outputText>

      </rich:column>

           <rich:componentControl event="onRowClick" for="menu" operation="show">

           <f:param value="#{r.declSlNo}" name="declSlNo"/>

           </rich:componentControl>

      </rich:extendedDataTable>

      </rich:panel>

      </h:form>

       

      <rich:modalPanel domElementAttachment="parent" autosized="false" id="pnlViewDecl">

      <f:facet name="header">

      <h:outputText value="Manage Declaration"></h:outputText>

      </f:facet>

      <f:facet name="controls">

      <h:panelGroup>

      <h:graphicImage width="20" height="20" onclick="hideViewDeclPopup()" id="cmdEventClose1" value="window-close.gif" style="cursor:hand">

      <rich:componentControl for="pnlViewDecl" attachTo="cmdEventClose1" event="onclick" operation="hide">

      </rich:componentControl>

      </h:graphicImage>

      </h:panelGroup>

      </f:facet>

      <h:form style="margin-top:0;margin-left:0">

           <jsp:include page="scrap_decl_divn.jsp"></jsp:include>

      </h:form>

      </rich:modalPanel>

      </f:view>

      </body>

      </html>

       

      /**** scrap_decl_divn.jsp  -- Subview containing a tabPanel ***********/

      <f:subview id="svwScrapDecl">

      <rich:tabPanel height="50%" width="95%" switchType="client">

      <rich:tab label="General" >

      <h:panelGrid border="1" columns="4">

      <h:outputText value="Unit"></h:outputText>

      <h:outputText value="#{scrapDeclarationController.loggedOnUser.userDetails.tcoUnit.unitName}"></h:outputText>

      <h:outputText value="Scheme"></h:outputText>

      <h:outputText value="#{scrapDeclarationController.loggedOnUser.userDetails.tcoScheme.schemeDesc}"></h:outputText>

      <h:outputText value="Division"></h:outputText>

      <h:outputText value="#{scrapDeclarationController.loggedOnUser.userDetails.tcoDivision.divDesc}"></h:outputText>

      </h:panelGrid>

      </rich:tab>

       

      <rich:tab label="Remarks">

      <h:panelGrid border="1" style="width:100%" columns="2">

      <h:outputText value="Head of Account to Credit"></h:outputText>

      <h:inputText size="40" readonly="#{scrapDeclarationController.declApplyAction=='F'}"

      value="#{scrapDeclarationController.scrapDeclaration.creditHead}"></h:inputText>

      <h:outputText value="Any Other Particulars"></h:outputText>

      <rich:editor readonly="#{scrapDeclarationController.declApplyAction=='F'}"

      value="#{scrapDeclarationController.scrapDeclaration.otherDetails}"></rich:editor>

      </h:panelGrid>

      </rich:tab>

      </rich:tabPanel>

       

      <a4j:commandButton reRender="viewDeclUserMsg" actionListener="#{scrapDeclarationController.applyPopupDeclaration}" value="#{scrapDeclarationController.declApplyCaption}"></a4j:commandButton>

      </f:subview>