First, define your action in a hidden command or inputtext field.
<h:commandButton id="mybutton" styleClass="myclass" style="display:none;" ...>
<f:ajax ...></f:ajax>
</h:commandButton>
javascript in YUI
myfunction =function()
{
Y.one("input.myclass").simulate("click");
}javascript in jQuery
myfucntion=function()
{
jQuery("input.myclass").trigger("click");
} After this you can use myfunction anywhere to trigger the ajax behavior.
No comments:
Post a Comment