7 Replies Latest reply on Feb 15, 2011 5:48 PM by jayanthp

    SIMPLE TOGGLE PANEL inside modal panel not toggling when expected

    jayanthp

      Hi,

           Again I am posting this after running out of ideas to see where the problem is.

      i am using

       

      RichFaces 3.3.1

      Tomahawk 1.1.5

       

      Here is the description:

       

      I have a modal panel as follows: <rich:modalPanel id="orderPanel" width="785" minHeight="490" autosized="true" >

      within it i have this hiarchy :

       

      <h:form>

      <div style="width:100%;height:480px;overflow:auto;">

      <h:panelGrid id="gridorderviewpanel" columns="1" width="100%">

          <a4j:outputPanel id="orderviewPanel">

                <rich:panel id="buttonpanel">

      ........

                 </rich:panel>        

      ....

      ... // 8 simple toggle panels come here

      ...

       

      </a4j:outputPanel>

      </h:panelGrid>

      </div>

      </h:form>

       

      within the a4j:outputPanel  i have 8 simple toggle panels each of them having the following:

       

      1) a unique id

      2) immeditae="true"

      3) opened = "{modalpanelbean.booleanvalueassociatedwiththesimpletogglepanel}"

      4) an action listener which toggles the particular booleanvalue

      5) reRender =" the id of the simpel toggle panel mentioned in 1) above "

       

      afetr deployment i see simple toggling wrorks as expected for all the toggle panels - OK

       

      Now i add two a4j:commandButtons in the rich:panel id="buttonpanel" .

      one button is for expandAll simple toggle panels the other is for collapseAll simple toggle panels. They are mutually exclusive ( both are not displayed at a same time )

       

      <a4j:commandButton value="ExpandAll"   rendered="#{modalpanelbean.expandAll}" actionListener="#{modalpanelbean.toggleAllPanelListener}" reRender="gridorderviewpanel" />

      <a4j:commandButton value="CollapseAll" rendered="#{!modalpanelbean.expandAll}" actionListener="#{modalpanelbean.toggleAllPanelListener}" reRender="gridorderviewpanel" />

       

      So when expandall is pressed the action listener sets all 8 simple toggle boolean values = true hence they are opened. similarly when closeAll is pressed they are all set false and they are closed. Note both the buttons rerender the entire modal panel grid gridorderviewpanel.

       

      Now both these buttons are working fine and all the 8 simpel toggle panels expand and close accordingly - OK

       

      However Problem occurs when i toggle any one of the panels separately, and then i click on the  the expandAll and closeAll buttons. After indivudually clicking on any of the simple toggle panels, then the expandAll and closeAll buttons do not have any effect on that particular simple toggle panel.

       

      For ex if the view comes uo and all panels are closed. I toggle the 1st one and open/expand it. Now when i click on expand all, all the remaining 7 toggles are also opened. But now if i clock on close all, only the last 7 close and the 1st one remains open as it is. susbesquent expandall and closeAll button action has no effect on this simple toggle panel. It only closes when i individually click on it.

       

      I tried reRendering each of the 8 ids instead of the entire panel id, i tried making keepVisualState="false" for modal panel but stil li am stuck with this problem.

       

      Can anyone please help me and see what may be worng or if you had the same problem

       

      Thanks

      Jayanth

        • 1. SIMPLE TOGGLE PANEL inside modal panel not toggling when expected
          ilya40umov

          What is the switchType of your rich:simpleTogglePanel?

          • 2. SIMPLE TOGGLE PANEL inside modal panel not toggling when expected
            jayanthp

            switchType="ajax" for all the simple toggle panels

            • 3. SIMPLE TOGGLE PANEL inside modal panel not toggling when expected
              ilya40umov

              It's only my guess but could you do the following:

              Bind value attribute of each rich:simpleTogglePanel to a random string in bean. When you invoke expandAll/collapseAll make sure that these random srtings have changed. The simplest way is always return a new random string in getter. Then reRender your panels.

              valuefalsefalsejavax.el.ValueExpression
              (must evaluate to java.lang.Object)
              The current value for this component

              P.S. As I understood all the opened flags are set to true/false when you invoke expandAll/collapseAll and you are pretty sure about it. Aren't you?

              • 4. SIMPLE TOGGLE PANEL inside modal panel not toggling when expected
                jayanthp

                Hi Illya,

                     I tried what you said on one of the simple toggle panels.. I added the attribute as follows: value="#{orderModel.shipwindowString}". It has its getter and setter methods in the backing bean. the shipwindowString gets a random value whenver the exapndAll, closeAll button is called.

                 

                However the behaviour is stil lthe same

                 

                here is some of the log on jboss:

                10:30:24,354 INFO  [[/gen2om]] opened attribute has been already set for component with id: shipwindowid[#{orderModel.shipwindowString}]. value attribute is deprecated and thus has been dropped!

                10:30:40,064 INFO  [OrderModel] modified showShipWindow to true

                10:30:40,115 INFO  [[/gen2om]] opened attribute has been already set for component with id: shipwindowid[#{orderModel.shipwindowString}]. value attribute is deprecated and thus has been dropped!

                10:31:02,251 INFO  [OrderModel] modified showShipWindow to false

                10:31:02,290 INFO  [[/gen2om]] opened attribute has been already set for component with id: shipwindowid[#{orderModel.shipwindowString}]. value attribute is deprecated and thus has been dropped!

                10:31:10,933 INFO  [OrderModel] modified expandAll to false

                10:31:10,933 INFO  [OrderModel] modified showShipWindow to true

                10:31:10,933 INFO  [OrderModel] modified showAddressWindow to true

                10:31:10,942 INFO  [OrderModel] modified showPaymentTermsWindow to true

                10:31:10,942 INFO  [OrderModel] modified showCarrierInfoWindow to true

                10:31:10,942 INFO  [OrderModel] modified showLineDetailWindow to true

                10:31:10,942 INFO  [OrderModel] modified showSummaryWindow to true

                10:31:10,942 INFO  [OrderModel] modified showNotesWindow to true

                10:31:10,942 INFO  [OrderModel] modified showAllowanceWindow to true

                10:31:10,986 INFO  [[/gen2om]] opened attribute has been already set for component with id: shipwindowid[#{orderModel.shipwindowString}]. value attribute is deprecated and thus has been dropped!

                10:31:38,202 INFO  [OrderModel] modified expandAll to true

                10:31:38,204 INFO  [OrderModel] modified showShipWindow to false

                10:31:38,205 INFO  [OrderModel] modified showAddressWindow to false

                10:31:38,207 INFO  [OrderModel] modified showPaymentTermsWindow to false

                10:31:38,209 INFO  [OrderModel] modified showCarrierInfoWindow to false

                10:31:38,210 INFO  [OrderModel] modified showLineDetailWindow to false

                10:31:38,212 INFO  [OrderModel] modified showSummaryWindow to false

                10:31:38,213 INFO  [OrderModel] modified showNotesWindow to false

                10:31:38,216 INFO  [OrderModel] modified showAllowanceWindow to false

                10:31:38,249 INFO  [[/gen2om]] opened attribute has been already set for component with id: shipwindowid[#{orderModel.shipwindowString}]. value attribute is deprecated and thus has been dropped!

                 

                we get a message saying since opened attribute is set already, the value attribute is deprecated.

                 

                Also i noticed this:

                when the first time modal view comes up, it follows the default setting of booelan value i gave. so when it comes up first time, the shipwindow panel is closed.  Now I toggle the ship window panel and open it. And then i close the modal panel ( invoke the hide on the modal panel) .

                 

                Now when the modal panel view comes up again next time. it comes up with al lthe remaining panels following the default setting, but the ship window toggle panel is show open ( since its stats was open before hiding the modal panel). whereas actuall yit shoudl be closed and even its boolean value shows it is set to false.

                 

                Also as the log says i am setting the all the boolean values to true, when expand all button is pressed and false for closeAll.

                 

                I feel

                1) is it possible when rerendering the modal panel it is not rendering that toggle panel.. ( this seems very unlikely )

                2) the sequence can be : a) it is reRenderin the modal panel with the previous state, and then b) the bean methods are invoked with set the boolean values to their default value.

                • 5. SIMPLE TOGGLE PANEL inside modal panel not toggling when expected
                  nbelaevski

                  Hi,

                   

                  Can you please try with RichFaces 3.3.3.Final?

                  • 6. SIMPLE TOGGLE PANEL inside modal panel not toggling when expected
                    jayanthp

                    I downloaded the binariss for richFaces 3.3.3 Final and used the three libs in my project:

                     

                    richfaces-api-3.3.3.Final

                    richfaces-ui-3.3.3.Final

                    richfaces-impl-3.3.3.Final

                     

                     

                    But i still get the same behaviour.

                     

                    I also Included the other one richfaces-impl-jsf2-3.3.3.Final , but that did not show any difference either.

                     

                    Would you be having any idea why this may be happening? would it have anything to do becuase of using SimpleTogglePanels in a ModalPanel

                     

                    - Jayanth

                    • 7. SIMPLE TOGGLE PANEL inside modal panel not toggling when expected
                      jayanthp

                      updates on this issue:

                       

                      My colleague tried with switchType="client" and looks like the above behaviour is solved. Though we both are stumped as to why the issue is existing when the switchType="ajax". If some one can explain if this is a bug or if i was doing something wrong, it would be of great help.

                       

                      Anyway as of now this issue seems to be solved by making switchType="client".

                       

                      Thanks,

                      Jayanth