Results 1 to 5 of 5

Thread: Inject a custom AjaxHandler into FlowHandlerAdapter in a portlet environment

  1. #1
    Join Date
    Nov 2010
    Location
    Winterthur
    Posts
    49

    Default Inject a custom AjaxHandler into FlowHandlerAdapter in a portlet environment

    Hi all,

    I am using Spring Webflow 2.2.1 in a Portlet environment.
    The UI Techology is JSF1.2 with Primefaces 1.1.

    I want to make use uf the primefaces buttons. For this I wanted to add the PrimeFacesAjaxHandler to handle the ajax requests from primefaces.
    In the Spring documentation it says that the custom ajax handlers must be injected into the FlowHandlerAdapter.
    Unfortunately there exist two FlowHandlerAdapter:
    • org.springframework.webflow.mvc.servlet.FlowHandle rAdapter
    • org.springframework.webflow.mvc.portlet.FlowHandle rAdapter

    In my configuration I use the org.springframework.webflow.mvc.portlet.FlowHandle rAdapter and this does not have a filed ajaxHandler.
    I could only inject into the org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.

    Is it possible to use a custom AjaxHandler in a portlet environment?
    If yes, how?
    If no, why not?

    Regards,
    Florian
    Last edited by huof; Dec 30th, 2010 at 10:07 AM.

  2. #2
    Join Date
    Apr 2010
    Location
    New Jersey, NJ
    Posts
    42

    Default

    In portlet env, AjaxRequest should be handled as a EventRequest!

    There is a ticket for this, https://jira.springframework.org/browse/SWF-1415

    Anyway, you can extent the FlowHandlerAdapter and add custom implementation. But I am not sure how to add the Ajax behaviour.

  3. #3
    Join Date
    Nov 2010
    Location
    Winterthur
    Posts
    49

    Default

    Hi

    Issue SWF-1415 is now solved.
    But a problem remains.
    How to I get my JSF 1.2 (Primefaces 1.1) UI to render the AJAX-URLs as resource URLs.
    In JSP it's easy, there you can uses <portlet:resourceURL />.

    Any ideas?

    Regards,
    Florian

  4. #4
    Join Date
    Apr 2008
    Posts
    14

    Default

    Hi Florian,

    I posted some remarks as a comment for SWF-1415. Regarding your question here:

    you can extend the Primefaces renderers and replace their getActionURL(facesContext) by your own call to something like getPortletResourceURL(facesContext) whose purpose is to generate a resourceURL from the renderResponse. Then the client parts of the Primefaces components will emit resource URLs which enter the SWF machinery having been enhanced for treating resource URLs properly.

  5. #5
    Join Date
    Nov 2010
    Location
    Winterthur
    Posts
    49

    Default

    Hi Mike,

    Thank you four your post.
    I already saw your comments and had a first look at it.

    Unfortunately I am currently stuck with some other issues and I did not have time up to now to got a little bit deeper into it.

    But I definitely will. I will then come back to you. Maybe also with some questions

    Best regards,
    Florian

    PS. I think https://jira.springsource.org/browse/SWF-1440 this should be the destination. Maybe you'd like to vote.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •