3 Replies Latest reply on Oct 23, 2008 9:21 AM by fezen

    Beginner: trying to run Richfaces code in a div

    fezen

      I just started playing around with RichFaces today and I really like it. I have no problems doing the basic the stuff, but what I really was looking for now was to put a form inside a ("expandable") div-element.

      Right now I am loading a jsf-page inside this div using prototype (new Ajax.Updater... etc.) but the RichFaces-javascript-inside this div doesn't execute. I tried using "evalScripts: true" in the Ajax.Updater, but that didn't work either.

      I have a feeling that I should load the page inside the div with RichFaces, but I haven't found any way of doing that. Either way (using prototype or Richfaces, that is) is fine with me as long as the javascript-code in the div executes.

      I don't want to put the form in a hidden div in the main-page since there will be a long list of entries that I want to be able to load the form(s) for.

      I guess there is no reason to post any code in here since this seems like a very basic problem.

      Any ideas, hints, pointers, code (?) to make this work?

        • 1. Re: Beginner: trying to run Richfaces code in a div
          fezen

          Seems like I can't edit my post, so...

          I finally managed to get the form to submit (not sure what I did wrong in the first place) like I wanted it to inside the div-element. However, I'm getting these errors now:

          useless setTimeout call (missing quotes around argument?)
          undefined

          _clearJSFFormParameters is not defined
          _clearJSFFormParameters('form','',...Form:_link_hidden_',form:_idcl']);

          A4J is not defined
          [Break on this error] A4J.AJAX.Submit("j_id_jsp_129948...?javax.portlet.faces.DirectLink=true"});

          • 2. Re: Beginner: trying to run Richfaces code in a div
            ilya_shaikovsky

            it will be better to use RichFaces from the beggining in order to load content. you could use simpleTogglePanel with ajax mode or just use conditional rendering with rendered attribute for the div which should be hidden/loaded.

            • 3. Re: Beginner: trying to run Richfaces code in a div
              fezen

              Thanks for the help. I'm still trying to figure this out. Anyway, simpleTogglePanel won't let me load a new page in a (div) element, right? I guess I would have to put (hidden) forms between the simpleTogglePanel-tags!?

              I'd prefer to, dynamically, load the form in a prototype-new Ajax.Request-manner.