2 Replies Latest reply on Jan 26, 2010 3:56 AM by upstream

    Recursive include

    upstream

      I am writing a web application that contains surveys with all questions on the same page. If answering a specific answer alternative the current view should be able to render another survey on the same page just beneath the question that triggered the new survey. This pattern continues, creating a need for a recursive solution. I have looked into using a4j:include, but a4j:include cannot include the current xhtml document as the a4j:include-tag is written in.

      Does anyone have any advice on how to achieve my desired outcome?

        • 1. Re: Recursive include
          nimo22

          hello,

           

          you can use "rich:simpleTogglePanel" or "rich:togglePanel".

          • 2. Re: Recursive include
            upstream

            Thank you for your help Nimo Stephan.

            However, I do not think the TogglePanel will be of help as I cannot see a way to use that recursively.

             

            The database that the survey will be using contains a table for survey information, a table for questions, and a table of answer alternatives. The survey contains an introduction text. Each survey has a set of questions, and each question can have a set of answer alternatives.   The answer alternatives may include the id to another survey (a sub survey so to say, with a new introductory text with set of questions and answer alternatives) The sub-survey is supposed to appear inline after the question that linked to the new survey (with the other original questions appearing beneath). The new survey answer alternatives may link to yet another sub-sub-survey, and this continues - hence my desire to find a recursive solution. Any solution that is defined can eventually cause problems as there is not limit to how many sub-surveys that can be triggered inline on a given page.

             

            a4j:include works perfect for this - however, it will not accept to include the same document as the tag is written in, and so I am looking for another solution.