webtier@glassfish.java.net

f:ajax and javascript events in JSF 2.0

From: <webtier_at_javadesktop.org>
Date: Mon, 01 Mar 2010 22:28:58 PST

I'm attempting to integrate some JQuery UI features with JSF.

My layout is such that each tab contains a form that is posting to a session managed bean. I've been using f:event to validate each page, and f:ajax to submit each form. The problem I am having is that upon the result of the f:ajax call I want the javascript environment to have some information about the result of the f:ajax call.

I tried using onEvent, but the data in there is not helpful for what I want to do. Is there anyway for me to add data on the server side to the event that is passed to the "onevent" method (handleTabChangeEvent)?


<code>
 <h:commandButton id="buttonId" actionListener="#{sessionBean.doSomeStuff}">
            <f:ajax execute="@form"
                    onevent="handleTabChangeEvent"
                    render="@form"/>
        </h:commandButton>
</code>

javascript

<code>

function handleOutcome(event){
//event.status
//event.source
//event.type

event.myCustomDataHereThatICanManipulateTheDOMWith
}

</code


Thanks!
[Message sent by forum member 'broeks' (broeks_at_gmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=389561