Announcement Announcement Module
Collapse
No announcement yet.
IS IT POSSIBLE TO HANDLE p:ajax event IN WEBFLOW OR IT'S IMPOSSIBLE AT ALL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Solution

    http://forum.primefaces.org/viewtopi...p=57563#p57563
    Last edited by Alekss; Feb 19th, 2012, 02:06 PM. Reason: solution found

    Comment

    Working...
    X