3 Replies Latest reply on Feb 24, 2009 11:33 AM by nbelaevski

    rich:modalPanel+Rich:effect

      hello, as usual, i have a problem :).
      I am trying to resize the modalPanel using rich:effects on different events like some components are rendered or not on the panel or if i want to "minimize/maximize" it.
      I have succeded to trigger an effect whith something like this:

      <rich:modalPanel id="modalPanel">
      <rich:effect event="onclick" for="modalPanelCDiv" type="BlindUp" params="duration:0.8" />
      ....
      </rich:modalPanel>

      this blinds up the popup when i click over it. The only problem is that it not what i actually want. I wanna do something like this:

      <rich:modalPanel id="modalPanel">
      <f:facet name="header">
      <a4j:commandLink value="minimize">
      <rich:effect event="onclick" targetId="modalPanel" type="BlindUp" params="duration:0.8" />
      </a4j:commandLink>
      </f:facet>
      </rich:modalPanel>


      This piece of code does not trigger the blindUp effect when i click on the commandLink...

      I know that modalPanel has the autosized="true" property but it's not to my likeing....i wanna use rich:effects :)

      so, any ideas?

      thank you!




        • 1. Re: rich:modalPanel+Rich:effect
          nbelaevski

          Hello,

          Compare the code you are using:

          <rich:effect event="onclick" for="modalPanelCDiv" type="BlindUp" params="duration:0.8" />

          <rich:effect event="onclick" targetId="modalPanel" type="BlindUp" params="duration:0.8" />
          . I think that's the reason it's not working for the second case.


          • 2. Re: rich:modalPanel+Rich:effect

            thanks for answering...but i beg to differ:
            for="modalPanelCDiv"
            targets the modalPanel's inner div who's id ends with "CDiv". The CDiv suffix is added by richfaces renderer as this div is a framework's modalPanel inner element, not my own. This inner div should never be accessed directly by a developer as it is a subject to change to your likeing. The developer should not even know it exists...

            where as:
            targetId="modalPanel"
            is the id of the modalPanel given by the developer and this should be the right way to do it. The renderer can then redirect the effect to be applied on the "modalPanelCDiv" or on whatever component's div to make it work...

            i should never hack into your code to see what elements/id's you generate or what javascript is running to make components on my page work... one good reason is because beeing your components you can change them anytime you like and break my pages...

            thanks


            • 3. Re: rich:modalPanel+Rich:effect
              nbelaevski

              Yes, that's true. But the renderer is not able to decide what HTML element you are going to target: compare make the whole panel content fade in or just apply blind down to the content element.

              Please feel free to comment the issue: https://jira.jboss.org/jira/browse/RF-6421