7 Replies Latest reply on Oct 15, 2007 11:32 AM by stuartm1971

    SimpleTogglePanel missing first click.

    stuartm1971

      I have a SimpleTogglePanel that regularly fails to respond to the first click and doesn't expand the panel beneath. The second click does work.

      This behaviour repeats when trying to close it.

      Any ideas?


      Thanks

        • 1. Re: SimpleTogglePanel missing first click.
          ilya_shaikovsky

          More details will be usefull because on my samples as you may know it's works. In other case it has been fixed already ;)

          • 2. Re: SimpleTogglePanel missing first click.
            stuartm1971

            SimpleTogglePanels seem to work standalone. However, I'm using one within a rich:dataTable and the panel contains a rich:subTable. It essentially provides further, less important, table information that the user can decide whether or not to show by toggling the panel. It only works on every other click. So what I have is:

            <rich:dataTable>
            <rich:column>
            ...
            </rich:column>
            <rich:column>
             <rich:simpleTogglepanel>
             <rich:subTable>
             //table columns...
             </rich:subTable>
             </rich:simpleTogglepanel>
            </rich:column>


            • 3. Re: SimpleTogglePanel missing first click.
              stuartm1971

              Before anyone asks, yes the dataTable is closed.

              • 4. Re: SimpleTogglePanel missing first click.
                stuartm1971

                I've discovered from an a4j:log that this piece of code:

                SimpleTogglePanelManager.add(new SimpleTogglePanel("_id0:isfMessageSummaryTable:92:messageDetailsTogglePanel", "true"));


                is getting the wrong boolean at open/close time. If the panel correctly toggles the boolean switches between true & false with each attempt. On alternate attempts the boolean value doesn't change so the panel state stays the same. I'm looking into what affects this code but obviously some of you chaps will achieve this faster than me.

                Incidentally I'm using richfaces-3.1.0-rc6 from 10/09/07.

                • 5. Re: SimpleTogglePanel missing first click.
                  stuartm1971

                  The following simpleTogglePanel.jspx code is resolved to produce the previous call:

                  SimpleTogglePanelManager.add(new SimpleTogglePanel("#{clientId}", "#{component.attributes['opened']}"));
                  


                  I don't know why the opened attribute resolves to the correct value only on every other click.

                  Incidentally, I have the 'opened' attribute set to "false" in my rich:simpleTogglePanel because I want it closed by default. If I remove this attribute the problem disappears, is this a known issue with this release?


                  Thanks

                  • 6. Re: SimpleTogglePanel missing first click.
                    stuartm1971

                    It seems that the toggling functionality is based on a 'opened' status which normally applies to each toggle panel. If a toggle panel is repeated as in my case, this status seems to apply to all repeated panels regardless of current state of the one you have clicked, this is why the click appears not to work.

                    Is this a limitation of simpleTogglePanel or am I expecting too much? Any suggestions would be most welcome, thanks.

                    • 7. Re: SimpleTogglePanel missing first click.
                      stuartm1971

                      Well, I'm not sure if this is indeed a bug concerning repeat togglePanels within a table but I've written a fairly simple workaround to alleviate the issue.