9 Replies Latest reply on Apr 30, 2009 4:09 AM by nbelaevski

    how to transfer data from one modelpanel to another

    ipraveenjain

      hi
      i want to transfer the data from one modelpanle to another
      thr is button in one modelpanel which invoke other modelpanel
      bean behind the modelpanel is not invoking?
      so how can i transfer the data from one panel to another

        • 1. Re: how to transfer data from one modelpanel to another
          nbelaevski

          Hello,

          Can you please clarify use case in more details?

          • 2. Re: how to transfer data from one modelpanel to another
            ipraveenjain

            i have main.jsp

            <f:view>
            
             <rich:modalPanel id="panelWizard" width="550" height="450"
             styleClass="wizardModalPanel" resizeable="false">
             <f:facet name="header">
             <h:panelGroup>
             <h:outputText value="#{mainBind.customWizard.title}"></h:outputText>
             </h:panelGroup>
             </f:facet>
             <f:facet name="controls">
             <h:panelGroup>
             <h:graphicImage value="/images/modal/close.png"
             style="cursor:pointer" id="hideWizard" />
             <rich:componentControl for="panelWizard" attachTo="hideWizard"
             operation="hide" event="onclick" />
             </h:panelGroup>
             </f:facet>
             <h:form id="formDialog">
             <a4j:include viewId="Wizard.jsp" />
             </h:form>
            
             </rich:modalPanel>
            <h:outputLabel value="open" >
            <a4j:support event="onclick" action="#{mainBind.actionHome}"
             oncomplete="Richfaces.showModalPanel('panelWizard');"
            reRender="panelWizard" />
            </h:outputLabel>
            </f:view>
            
            

            from here i am able to display the my modelpanel.
            code runs fine no problem.
            in model panel i have included a jsp wizard.jsp the code for that
            <a4j:outputPanel>
             <a4j:include viewId="#{mainBind.wizardJspName}" />
             </a4j:outputPanel>
             <rich:messages passedLabel="Data is allowed to be stored."
             layout="list">
             <f:facet name="header">
             <h:outputText value="Entered Data Status:"></h:outputText>
             </f:facet>
             <f:facet name="passedMarker">
             <h:graphicImage value="/images/ajax/passed.gif" />
             </f:facet>
            
             <f:facet name="errorMarker">
             <h:graphicImage value="/images/ajax/error.gif" />
             </f:facet>
             </rich:messages>
            
             <a4j:region>
             <t:panelGrid id="wizardNavigationGrid" columns="4"
             style="width: 100%;"
             columnClasses="navigationLeft, navigation, navigation">
             <t:column>
             <a4j:commandButton id="btnWizardBack" style="width: 60;"
             disabled="#{mainBind.customWizard.hasPrevious}"
             action="#{mainBind.customWizard.back}" value="Back"
             reRender="panelWizard2, btnWizardNext, btnWizardBack" />
             </t:column>
            
             <t:column>
             <a4j:commandButton id="btnWizardNext" style="width: 60;" type="submit"
             disabled="#{mainBind.customWizard.hasNext}"
             action="#{mainBind.customWizard.next}" value="Next"
             reRender="panelWizard2, btnWizardNext, btnWizardBack" />
             </t:column>
             <t:column>
             <a4j:commandButton id="btnWizardCancel" type="button"
             style="width: 60;"
             onclick="Richfaces.hideModalPanel('panelWizard');" value="Cancel" />
             </t:column>
             </t:panelGrid>
             </a4j:region>
            

            here ="#{mainBind.wizardJspName}" select a jsp and it is include in the modelpanel
            the code for that random jsp is
            <t:panelGroup id="panelClusterWizard"
             style="width: 550; height: 335px;">
            <rich:panel rendered="#{mainBind.customWizard.slideIndex == 2}">
             <rich:panel
             style="height: 200; width:100%; padding: 8; background: #757575;">
             <t:panelGrid columns="2" style="background: #757575;">
             <t:column>
             <rich:spacer width="8px"></rich:spacer>
             </t:column>
             <t:column>
             <t:outputLabel value="Cluster Name:" />
             <br />
             <h:inputText style="width: 400px;" value="#{mainBind.customWizard.clusterName}" id="clstrname" >
             <f:param name="cname" value="#{mainBind.customWizard.clusterName}"></f:param>
             <f:param name="cname2" value="1236"></f:param>
             </h:inputText>
             <br />
             <t:outputLabel value="Description:" />
             <br />
             <t:inputTextarea style="width: 400px;" value="#{mainBind.customWizard.clusterName}" id="clstrdesc"></t:inputTextarea>
             <br />
             <h:selectBooleanCheckbox id="selboolean" value="true" />
             <h:outputLabel for="selboolean" value="Default cluser" />
             <br />
             <h:selectBooleanCheckbox id="crt" value="false" />
             <h:outputLabel for="crt" value="Create cluser only" />
            
             </t:column>
             </t:panelGrid>
             </rich:panel>
             </rich:panel>
            
             <rich:panel style="height: 200; padding: 8; background: #757575;"
             rendered="#{mainBind.customWizard.slideIndex == 3}">
            
             <t:panelGrid columns="2" style="background: #757575;">
             <t:column>
             <rich:spacer width="8px"></rich:spacer>
             </t:column>
             <t:column>
             <t:outputLabel value="Select registered nodes:"></t:outputLabel>
             <br />
             <rich:scrollableDataTable height="150px" width="500px" value="34">
             <rich:column id="dfscontroller">
             <f:facet name="header">
             <h:outputLabel styleClass="headerText" value="DFS controller" />
             </f:facet>
             <h:outputText value="{dfsController}" />
             </rich:column>
             <rich:column id="dfsname">
             <f:facet name="header">
             <h:outputLabel styleClass="headerText" value="Name" />
             </f:facet>
             <h:outputText value="{dfsName}" />
             </rich:column>
             <rich:column id="dname">
             <f:facet name="header">
             <h:outputLabel styleClass="headerText" value="Domain Name" />
             </f:facet>
             <h:outputText value="{dName}" />
             </rich:column>
             <rich:column id="desc">
             <f:facet name="header">
             <h:outputLabel styleClass="headerText" value="Description" />
             </f:facet>
             <h:outputText value="{desc}" />
             </rich:column>
             </rich:scrollableDataTable>
             <t:commandButton value="Add"></t:commandButton>
             <rich:spacer width="8"></rich:spacer>
             <t:commandButton value="Remove"></t:commandButton>
             <rich:spacer width="100px"></rich:spacer>
             <t:selectBooleanCheckbox value="true" disabled="true"></t:selectBooleanCheckbox>
             <t:outputLabel value="use DFS in default pool"></t:outputLabel>
             </t:column>
             </t:panelGrid>
             </rich:panel>
            </t:panelgroup>
            
            
            

            this code is rendered according to the values from bean.and appears one bu one like a wizard. page is eaisly navigating but the problem is that i cannt transfer the data. in the case when when value is 2 first panel is rendered and when i click on next button next panel is rendered but how would i share the data that i have entered in first screen on next one.

            • 3. Re: how to transfer data from one modelpanel to another
              nbelaevski

              Data is saved into the model when you click a4j:commandButton (e.g. expression #{mainBind.customWizard.clusterName} is updated). You can take it from the model then.

              • 4. Re: how to transfer data from one modelpanel to another
                ipraveenjain

                hi
                pls explain how can i get data from model?
                as you wrote "You can take it from the model then."
                if u are talking about beans then i am not able to get data from bean.

                • 5. Re: how to transfer data from one modelpanel to another
                  nbelaevski

                  Right, from the bean. Why aren't you able to get data: bean is not updated with new data or something else?

                  • 6. Re: how to transfer data from one modelpanel to another
                    ipraveenjain

                    this is what the probelem is bean is not invoking or updating?
                    normally setter metthod should be called to update the bean
                    but setter method is not getting focus.
                    and i dont know ?

                    • 7. Re: how to transfer data from one modelpanel to another
                      nbelaevski

                      Please remove <a4j:region> and check.

                      • 8. Re: how to transfer data from one modelpanel to another
                        ipraveenjain

                        i tried it ,but of no use.

                        • 9. Re: how to transfer data from one modelpanel to another
                          nbelaevski

                          How about preparing small demo application demonstrating the issue? You can put it to sendspace or somewhere else...