Announcement Announcement Module
Collapse
No announcement yet.
Web Flow 2 and YUI integration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Web Flow 2 and YUI integration

    Is there any easy way to integrate Spring Web Flow 2 with Yahoo! User Interface Library when it comes to rendering fragments iwth AJAX?

    Code:
    <render fragments="test"></render>
    I looked at http://static.springsource.org/sprin...l/ch11s05.html

    As I understand I have to implement my own org.springframework.js.AjaxHandler since there is no implementation shipped with Web Flow that can integrate with YUI?

  • #2
    I implemented a
    Code:
    public class YUIAjaxHandler implements AjaxHandler
    I have a initial state
    Code:
      <view-state id="helloYuiAjax" view="bookingTemplate">
        <transition on="ajaxSample">
          <render fragments="testPart"></render>
        </transition>
      </view-state>
    And the bookingTemplate is:
    Code:
    <form action="${flowExecutionUrl}&_eventId=ajaxSample&yuiAjaxRequest=true" method="post">
    	<input type="submit" />
    </form>
    And the testPart is:
    Code:
    Hello test part!
    
    This is only for testing AJAX fragments rendering for YUI.
    When I submit the form in debug in Tomcat I see that
    Code:
    public boolean isAjaxRequest(HttpServletRequest request, HttpServletResponse response)
    method returns true.

    But I get no "testPart" fragment renered returned. I get "bookingTemplate" rendered (the form).
    How do i trigger a fragment render?

    EDIT:
    I also tried bookingTemplate:
    Code:
    <form action="${flowExecutionUrl}" method="post">
    	<input type="hidden" name="yuiAjaxRequest" value="true" />
    	<input type="submit" name="_eventId_ajaxSample" value="ajaxSample" />
    </form>
    Last edited by wojtekb82; Jan 12th, 2010, 12:34 PM.

    Comment


    • #3
      try to check your Tiles2 definition...
      then see your firebug console for the response...

      Comment


      • #4
        Originally posted by eros View Post
        try to check your Tiles2 definition...
        then see your firebug console for the response...
        I have no tiles. I use freemarker. firebug console shows a request to server and as I said the rendered bookingTemplate is reutrned.

        Comment

        Working...
        X