Results 1 to 2 of 2

Thread: IS IT POSSIBLE TO HANDLE p:ajax event IN WEBFLOW OR IT'S IMPOSSIBLE AT ALL

  1. #1
    Join Date
    Jan 2012
    Posts
    11

    Default IS IT POSSIBLE TO HANDLE p:ajax event IN WEBFLOW OR IT'S IMPOSSIBLE AT ALL

    Can someone to answer how to handle p:ajax event in webflow?!

    I have in my page
    Code:
    <p:tabView id="tabView" var="category" value="#{showcaseBean.categories}">
    When I'm clicking every tab the next tab with related goods to this category should appear.
    So I have to catch
    Code:
    <p:ajax event=”tabChange” listener=”#{showcaseBean.onChange}” />
    in my showcaseBean and fetch the related goods from database like
    Code:
    ShowcaseService.getGoodsByCategory(Category category) {}
    This ShowcaseService can work with database only through flow.xml file (because transaction is bound to flow).
    So I cannot make something like
    Code:
     (inside ShowcaseBean)
       ShowcaseService showcaseService = new ShowcaseService(); 
       showcaseService.getGoodsByCategory(Category category)
    Instead of it I have to reflect this fetching in flow.xml like
    Code:
    <transition on="changeTab">
      <evaluate expression="showcaseService.getGoodsByCategory(showcaseBean.selectedCategory)" />
    </transition>
    But examples (that I have seen) show the handling only JSF action (in flow.xml ) like
    Code:
    <transition on="cancelBooking">
    			      <evaluate expression="bookingService.cancelBooking(bookings.selectedRow)" />
    		          </transition>
    where cancelBooking taken from
    Code:
     <p:commandButton id="cancel" value="Cancel" action="cancelBooking"/>
    So how can I reflect ”tabChange” event
    Code:
    <p:ajax event=”tabChange” listener=”#{showcaseBean.onChange}” />
    in flow.xml to invoke method getGoodsByCategory of ShowcaseService?

    It's strange if webflow works with action events only!

  2. #2
    Join Date
    Jan 2012
    Posts
    11

    Default

    Last edited by Alekss; Feb 19th, 2012 at 02:06 PM. Reason: solution found

Posting Permissions

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