Announcement Announcement Module
Collapse
No announcement yet.
How to handle ajax event? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to handle ajax event?

    Could anyone explain how to bind the event on the page with spring bean?
    For example if we have page code
    <h:commandLink id="nextPageLink" value="More Results" action="next"/>
    so we can use "next" in flow definition
    <transition on="next">

    But what about such evebts like
    <p:accordionPanel>
    <p:ajax event="tabChange" listener="#{myBean.onTabChange}" />

    By primefaces tutorial it can be handled in MyBean in such way:

    public void onChange(TabChangeEvent event)
    {
    Tab activeTab = event.getTab();
    }

    But how this event may be handled in Spring context?

    Thank you

  • #2
    Solution in <p:remoteCommand


    RemoteCommand is used by invoking the command from your javascript code.

    <p:remoteCommand name="increment" actionListener="#{counter.increment}"

    out="count" />
    <h:outputText id="count" value="#{counter.count}" />

    Comment

    Working...
    X