Announcement Announcement Module
Collapse
No announcement yet.
Facelets include in Spring WF Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facelets include in Spring WF

    Hi everybody,

    I need some help please about using Facelets templates with Spring Web Flow :

    I have a template file like this :

    <html xmlns= ... >
    <f:view contentType="text/html" encoding="UTF-8">
    <head>
    ...
    </head>
    <body>
    ...
    <div id="divId">
    <ui:insert name="zoneName"/>
    </div>
    ...
    </body>
    </f:view>
    </html>


    1st question) How can I populate a view from this template on-the-fly directly in Spring WF config, like this :

    <view-state id="id1">
    <transition on="event" to="the template populated with 'zoneName=some_file.xhtml'" />
    </view-state>

    2d question) Can I then (in the SWF config) change the included file 'some_file.xhtml' as a fragment using Ajax (to refresh only this portion of the view) ?


    Thank you very much !

  • #2
    I have exactly the same question. Is this possible?
    Almost all examples are done with tiles.

    Comment


    • #3
      Maybe you should include your template.xhtml within every page you want to display with something like:

      Code:
      [...]
      xmlns:ui="http://java.sun.com/jsf/facelets"
      [...]
      <ui:composition template="./template.xhtml">
      [...]
      <here goes some code specific for your different pages>
      then you create view-states for your several pages and do the transitions to them. the facelet engine will do the rest and put your pages properly together.

      concerning your 2nd question, you should take a look at the '4.12.Rendering fragments' of the swf doku (2.0.5 that is). like this:

      Code:
      <transition on="next">
          <evaluate expression="searchCriteria.nextPage()" />
          <render fragments="searchResultsFragment" />
      </transition>
      hope this helps

      Comment


      • #4
        Yes, but with render fragments you rerender a part on your page with a given id. But what I want to do is repace a part of the page with a new view. At the moment I have to include my global template on each view (<ui:composition template="../layout/template.xhtml">) resulting in a complete page refresh.

        So basicly I want a menu on the left to refresh the page on the right using ajax. Im using richfaces, facelets and spring webflow. I know this can be done with tiles, but I havent seen a example with facelets yet.

        Comment


        • #5
          Hello,

          Yes, it is very good and promising question. I browsed all the forum and found only questions about that, but no answers.... It is very useful feature, I think more and more people will try to implement it in the future.

          Spring team, please answer, is it possible to do that using SWF?




          Mindaugas

          Comment

          Working...
          X