Passing values from one model panel to another at oncomplete
asc Nov 26, 2010 2:01 AMHi All,
I am facing a problem at the time of rendering a list which is in a model panel.I have one model panel and at oncomplete of that model panel i am opening another model panel with a datagrid.But at the time of rendering the second model panel ,i am not getting that datagrid List.
Code I have written for model panel is
<a:outputPanel id="addCustomJobPanel"> <rich:modalPanel id="addCustomJobMp" styleClass="modalPanel" top="10" keepVisualState="#{manageJobDone.showOverlay}" autosized="true" minWidth="600" minHeight="150" style="background-image: url('../img/overlayBg.png');background-repeat: repeat;background-color: transparent;" shadowDepth="#{messages.valShadowDepth}" headerClass="modalPanel-header" controlsClass="modalPanel-controls"> <f:facet name="header"> <h:outputText value="#{messages.lblAddEditCustomJob}" /> </f:facet> <f:facet name="controls"> <h:form> <a:commandLink action="#{manageJobDone.closeLayer}"oncomplete="Richfaces.hideModalPanel('addCustomJobMp')"> <h:graphicImage value="/img/closeButton.png" alt="X" border="0" /> </a:commandLink> </h:form> </f:facet> <s:div styleClass="modalPanel-panelGrid-container-div"> <h:panelGrid styleClass="modalPanel-panelGrid"> <a:outputPanel ajaxRendered="true"> <h:message styleClass="message" for="addCustomJobPanel" /> </a:outputPanel> <a:form id="addCustomJobForm"> <h:panelGrid border="0" columnClasses="formLabel,formValue" rowClasses="formLabel"> <s:decorate id="customJobTitleDecoration" template="../layout/edit.xhtml"> <ui:define name="label">#{messages.lblJobDoneTitle}</ui:define><h:inputText id="jobtitle" value="#{customJob.strTitle}"required="true" requiredMessage="#{messages['message.required.customjob.title']}" /> </s:decorate><s:decorate id="machineryTypeDecoration" template="../layout/edit.xhtml"><ui:define name="label">#{messages.lblMachinery}</ui:define> <h:selectOneMenu value="#{customJob.machinery}"> <s:selectItems value="#{manageJobDone.machineryRList}" var="m" label="#{m.strName}" noSelectionLabel="#{messages.defaultListItem}" /> <s:convertEntity /> </h:selectOneMenu> </s:decorate> <s:decorate id="customJobDescDecoration" template="../layout/edit.xhtml"> <ui:define name="label">#{messages.lblCustumJobDesc}</ui:define> <h:inputTextarea id="customJobDesc" value="#{customJob.txtDescription}" required="true" rows="5" cols="36" requiredMessage="#{messages['message.required.customjob.desc']}" /> </s:decorate></h:panelGrid> <h:panelGrid columns="1" border="0" width="100%" columnClasses="formLabel,formValue" rowClasses="formLabel"><a:commandButton id="persistCustomJob" value="#{messages.lblPersistAttach}" reRender="addCustomJobPanel" action="#{manageJobDone.persistCustomJob}" onclick="this.disabled=true" style="margin:3px" oncomplete="Richfaces.showModalPanel('uploadImageMp'" rendered="#{customJob.icustomJobId == null}" /> <a:commandButton id="updateCustomJob" value="#{messages.lblUpdateAttach}" reRender="addCustomJobPanel" action="#{manageJobDone.updateCustomJob}" onclick="this.disabled=true" style="margin:3px" oncomplete="Richfaces.showModalPanel('uploadImageMp',{list : #{manageJobDone.customJobImageList}})" rendered="#{customJob.icustomJobId != null}" > <a:actionparam name="jobDoneButton" value="attach" assignTo="#{manageJobDone.jobDoneButton}" /> </a:commandButton> </h:panelGrid> </a:form> </h:panelGrid> </s:div> </rich:modalPanel> </a:outputPanel>
And Code for second model panel is
<rich:modalPanel id="uploadImageMp" styleClass="modalPanel" top="10" keepVisualState="#{manageJobDone.showImageUpload}" autosized="true" minWidth="600" minHeight="150" style="background-image: url('../img/overlayBg.png');background-repeat: repeat;background-color: transparent;" shadowDepth="#{messages.valShadowDepth}" headerClass="modalPanel-header" controlsClass="modalPanel-controls"> <f:facet name="header"> <h:outputText value="#{messages.lblUploadFilesJobDone}" /> </f:facet> <h:form> <a:commandLink action="#{manageJobDone.closeLayer}" oncomplete="Richfaces.hideModalPanel('uploadImageMp')"> <h:graphicImage value="/img/closeButton.png" alt="X" border="0" /> </a:commandLink> </h:form> <s:div styleClass="modalPanel-panelGrid-container-div"> <h:panelGrid styleClass="modalPanel-panelGrid"> <rich:dataTable id="jobDoneFilesUploadedList" value="#{jobDoneImageList}" var="jdi" styleClass="rich-dataTable" columnClasses="dataTableColumn" headerClass="dataTableHeader" rendered="#{jobDoneImageList.rowCount > 0}" style="border: none; background: none;"> <rich:column style="width:70%;"> <f:facet name="header">#{messages.lblFileNameJobDone}</f:facet> #{jdi.strImageName} </rich:column> <rich:column style="width:30%;"> <f:facet name="header">#{messages.lblJobDoneFileUploadedOn}</f:facet> #{jdi.dtCreated} </rich:column> <rich:column style="width: 100px;"> <f:facet name="header"> <h:outputText value="#{messages.lblAction}" styleClass="dataTablePanelGrid" /> </f:facet> <h:form> <a:commandLink action="#{manageJobDone.removeJobDoneFile(jdi)}" reRender="removeJobDoneFilePanel" oncomplete="this.disabled=false" onmouseover="reloadHelp('#{messages.lblRemoveFile}');" onmouseout="reloadHelp('#{messages.lblRemoveFile}');" onclick="this.disabled=true" style="margin-right: 5px;" ajaxSingle="true" ignoreDupResponses="true" requestDelay="1000" eventsQueue="removeJobDoneFileQueue"> <h:graphicImage value="/img/edit.gif" border="0" /> <rich:toolTip followMouse="false" direction="top-right" showDelay="0" styleClass="tooltip"> #{messages.lblRemoveFile} </rich:toolTip> </a:commandLink> </h:form> </rich:column> </rich:dataTable> <rich:dataTable id="customJobFileUploadList" value="list" var="cjil" styleClass="rich-dataTable" columnClasses="dataTableColumn" headerClass="dataTableHeader" rendered="true" style="border:1px solid red; background: none;"> <rich:column style="width:70%;"> <f:facet name="header">#{messages.lblFileNameJobDone}</f:facet> #{cjil.strImageName} </rich:column> <rich:column style="width:30%;"> <f:facet name="header">#{messages.lblJobDoneFileUploadedOn}</f:facet> #{cjil.dtCreated} </rich:column> <rich:column style="width: 100px;"> <f:facet name="header"> <h:outputText value="#{messages.lblAction}" styleClass="dataTablePanelGrid" /> </f:facet> <h:form> <a:commandLink action="#{manageJobDone.removeCustomJobFile(cjil)}" reRender="removeJobDoneFilePanel" oncomplete="this.disabled=false" onmouseover="reloadHelp('#{messages.lblRemoveFile}');" onmouseout="reloadHelp('#{messages.lblRemoveFile}');" onclick="this.disabled=true" style="margin-right: 5px;" ajaxSingle="true" ignoreDupResponses="true" requestDelay="1000" eventsQueue="removeJobDoneFileQueue"> <h:graphicImage value="/img/edit.gif" border="0" /> <rich:toolTip followMouse="false" direction="top-right" showDelay="0" styleClass="tooltip"> #{messages.lblRemoveFile} </rich:toolTip> </a:commandLink> <a:commandLink action="#{manageJobDone.viewCustomJobImage(cjil)}" reRender="removeJobDoneFilePanel" oncomplete="this.disabled=false" onmouseover="reloadHelp('#{messages.lblRemoveFile}');" onmouseout="reloadHelp('#{messages.lblRemoveFile}');" onclick="this.disabled=true" style="margin-right: 5px;" ajaxSingle="true" ignoreDupResponses="true" requestDelay="1000" eventsQueue="removeJobDoneFileQueue"> <h:graphicImage value="/img/edit.gif" border="0" /> <rich:toolTip followMouse="false" direction="top-right" showDelay="0" styleClass="tooltip"> #{messages.lblRemoveFile} </rich:toolTip> </a:commandLink> </h:form> </rich:column> </rich:dataTable> <h:form id="uploadImagePanelForm" enctype="multipart/form-data"> <h:panelGrid columns="2" columnClasses="name" styleClass="panelGrid" align="center" width="50%"> <h:outputLabel for="name"> <h:outputText value="#{messages.lblBrowseFileToUpload}" /> </h:outputLabel> <s:fileUpload data="#{manageJobDone.fileData}" fileName="#{manageJobDone.fileName}" /> <h:outputLabel for="name"> <h:outputText value="#{messages.lblBrowseFileToUpload}" /> </h:outputLabel> <s:fileUpload data="#{manageJobDone.fileData2}" fileName="#{manageJobDone.fileName2}" /> <h:outputLabel for="name"> <h:outputText value="#{messages.lblBrowseFileToUpload}" /> </h:outputLabel> <s:fileUpload data="#{manageJobDone.fileData3}" fileName="#{manageJobDone.fileName3}" /> <h:commandButton id="saveJobDoneImage" value="#{messages.btnSave}" action="#{manageJobDone.persistJobDoneImage}" /> </h:panelGrid> </h:form> </h:panelGrid> </s:div> </rich:modalPanel>
But on display of second model panel i am not getting value from bean class.Please help if any one has any idea about this.
Thanks in advance.