2 Replies Latest reply on Feb 23, 2012 6:11 AM by giant2

    jQuery and richfaces:modalPanel

    giant2 Newbie

      Are there any problem using jQuery in a rich:modalPanel?

      I see this strange thing:

      my modalPanel has a <rich:jQuery selector="document" query="ready(function(){  })></rich:jQuery>

      The piece of istruction between {} is executed when the document is all ready (even if the modalPanel is not visible).

      My modalPanel has 2 panel/div in it, the first name "simple" and the second named "complex" (the ids).

      Following a parameter, the modalPanel is showed and "simple" or "complex" is visible:

      if (#{myBean.isSimple()}){jQuery('#complex').animate({'height': 'hide'}, { duration: 0 });jQuery('#simple').animate({'height': 'show'}, { duration: 0 });}

      else{jQuery('#complex').animate({'height': 'show'}, { duration: 0 });jQuery('#simple').animate({'height': 'hide'}, { duration: 0 });}

      Well, the thing I see is that the animation are ignored.

      I tried to put an alert in the if and in the else statement and see they are called correctly, but the animation doesn't start and see a wrong situation.

      The particular thing continue because if I do an "F5"-refresh, magically the animation is executed (only the first time).


      Why appens this?