Results 1 to 2 of 2

Thread: How to handle ajax event?

  1. #1
    Join Date
    Jan 2012
    Posts
    11

    Default 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. #2
    Join Date
    Jan 2012
    Posts
    11

    Default

    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}" />

Posting Permissions

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