Forgot to add code examples:

page class:

public abstract class TestPage extends BasePage
{
    public abstract boolean getChecked();

@EventListener(targets="submitFormAsync", events="onclick", submitForm="myForm", async=true)
    public void submitFormAsync() {
        System.out.println("EventListener called from submitFormAsync");
    }

@EventListener(targets="submitForm", events="onclick", submitForm="myForm")
    public void submitForm() {
        System.out.println("EventListener called from submitForm");
    }

@EventListener(targets="callListenerAsync", events="onclick", async=true)
    public void callListenerAsync() {
        System.out.println("EventListener called from callListenerAsync");
    }

    public void formListener()
    {
        System.out.println("Form's listener got called");
        System.out.println("checked: " + getChecked());
    }
}

page template:

<html jwcid="@Shell" title="Test Page"
  xmlns='http://www.w3.org/1999/xhtml'
doctype='html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\";'
  debugEnabled="true"
  browserLogLevel="DEBUG"
  consoleEnabled="true">
<head>
<title>Test Page</title>
<body jwcid="@Body">
<form jwcid="[EMAIL PROTECTED]" listener="listener:formListener">
<input jwcid="@Checkbox" value="ognl:checked" /><br />

</form>
<p><input jwcid="[EMAIL PROTECTED]" type="button" value="literal:submit form via EventListener" /></p> <p><input jwcid="[EMAIL PROTECTED]" type="button" value="literal:submit form async via EventListener" /></p> <p><input jwcid="[EMAIL PROTECTED]" type="button" value="literal:call an EventListener async without submitting the Form" /></p>
</body>
</html>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to