4 Replies Latest reply on Oct 27, 2008 3:52 PM by Bart DP

    Rendering jsf on the fly

    Arvind N Newbie
      Hi
      i want to render a jsf link after generating the value of it as a string in the session bean....
      Something like
      <s:link view="/Browser.xhtml" value="test" rendered="#{List.breadcrumb ne null}" id="crumb"><f:param name="parentID" value=null/></s:link>

      i have been trying to get this to work, but so far no luck.

      can anyone please suggest something?

      Thanks
        • 1. Re: Rendering jsf on the fly
          Adrien Orsier Newbie

          I don't think you can do it like that.
          If you bind this to a string value of a session bean and display it in a jsf file, it won't be rendered, but simply displayed as a normal string as far as I know.

          • 2. Re: Rendering jsf on the fly
            Arvind N Newbie

            Adrien Orsier wrote on Jul 22, 2008 11:33:


            I don't think you can do it like that.
            If you bind this to a string value of a session bean and display it in a jsf file, it won't be rendered, but simply displayed as a normal string as far as I know.



            yea....i am trying to create a breadcrumb trail for one of my sites.....so is there anyway i can do that in seam easily?

            • 3. Re: Rendering jsf on the fly
              Adrien Orsier Newbie

              Depends how your urls are made mostly.
              You could store your objects in a list you use to generate this breakcrumbtrail, something like:


              <ui:repeart value="#{myObjectList}" var="object">
              <s:link ...> <f:param name="" value="#{object.id}"/></s:link>
              </ui:repeat>



              Or you could use a long running conversation and the conversation stack.
              Basically nest do a


              propagation="nest"



              on all your s:link, and display the conversation stack which will represent the break crumb trail like that:



              <h:form rendered="#{not empty conversationStack}">
                   <div id="breadcrumbs">
                        <ui:repeat value="#{conversationStack}" var="entry">
                                 <h:outputText value=" > "/> 
                                 <h:commandLink value="#{entry.description}" action="#{entry.select}"/>
                        </ui:repeat>
                   </div>
                   <br />
              </h:form>


              conversationStack is handled by Seam, and the 'description' of entry will be the description you put to a jsf page in the xx.page.xml file, such as:


              <description>#{myObjectHome.instance.name}</description>



              This second solution seems far better I think.


              • 4. Re: Rendering jsf on the fly
                Bart DP Newbie

                Is it possible to explain this in detail?
                I just need to make a breadcrumb in my webapplication.
                This is also useful for other users.


                Thx, Bart