I've figured out why the exception is being thrown: my formSubmit method requires the submission control (Submit or LinkSubmit) to have set the tag and selected attributes/parameters. Now, my async button comes in without those set and the null pointer is thrown.

So I've added an "if null return" block and the dialog appears as required, but ...

... that still doesn't explain why the autoSubmit parameter in the Annotation isn't stopping formSubmit from being called. I've also tried with a Submit component and a LinkSubmit using attributes in the markup to define the listener etc, still the form submit listener is called.

So, could the issue be that autoSubmit attribute does not work?

Seems like my only option (besides living with it for now) is to use a DirectLink which works fine as it's not associated with a form .. so I'll have to figure out how to style that like a button, or emulate it's behaviour in a button.

Jesse, I've logged an issue in Jira for you.
https://issues.apache.org/jira/browse/TAPESTRY-1630

Thanks, Paul.

Paul Stanton wrote:
Should I log this in Jira Jesse?

Paul Stanton wrote:
Thanks Jesse,

I've changed it to
@EventListener(targets = {"myButton"}, events = "onclick", async = true, autoSubmit = false)
   public void showMyDialog()
and the same exception is thrown. Any more info?

Paul.

Jesse Kuhnert wrote:
Components implementing IFormComponent that are targeted with an
@EventListener do now have their surrounding forms submitted automatically
as part of the async request.  If there is something in your logic that
doesn't need/want this to happen you can set the autoSubmit = false
parameter in the annotation and it will do the pure async request only
without the form submission.

http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html#EventListener

On 7/3/07, Paul Stanton <[EMAIL PROTECTED]> wrote:

Hi,

I've upgraded to 4.1.2 from 4.1.1 and am getting the following when I
try to load one of my Dojo Dialogs (async).

It seems tapestry is trying to call getPage with a null page name, but
I'm not sure why formSubmit is being called at all (unless it's part of
a rewind?)

The trigger is being defined like so:
    <input type="button" jwcid="[EMAIL PROTECTED]" label="show dialog"/>

The listener being called is defined like so:
    @EventListener(targets = {"myButton"}, events = "onclick", async =
true)
    public void showMyDialog()

If i click my button i get the following exception wrapped in a error
dialog  (async):

Failure invoking listener method 'public org.apache.tapestry.IPage
MyPage.formSubmit()' on [EMAIL PROTECTED]: Parameter name must not
be null.
org.apache.hivemind.ApplicationRuntimeException
Failure invoking listener method 'public org.apache.tapestry.IPage
com.pds.pdsv3.tapestry.pages.veridical.VeridicalPage.formSubmit()' on
[EMAIL PROTECTED]/Comparables]: Parameter name must not be
null.
component:
        [EMAIL PROTECTED]/Comparables]
location:
        context:/WEB-INF/veridical/Comparables.page, line 5, column 81
1
        <?xml version="1.0" encoding="UTF-8"?>
2
        <!DOCTYPE page-specification PUBLIC "-//Apache Software
Foundation//Tapestry Specification 4.0//EN"
3
        "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";>
4

5
        <page-specification
class="com.pds.pdsv3.tapestry.pages.veridical.Comparables"/>




[ +/- ] Exception: <http://localhost:8080/PDS/app> Parameter name must
not be null.
java.lang.NullPointerException
Parameter name must not be null.
Stack Trace:

    * org.apache.hivemind.util.Defense.notNull(Defense.java:41)
* org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java
:217)

* $IRequestCycle_1138a7ba350.getPage($IRequestCycle_1138a7ba350.java) * $IRequestCycle_1138a7ba25a.getPage($IRequestCycle_1138a7ba25a.java)
    * MyPage.formSubmit(VeridicalPage.java:65)
    * sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    * sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)

    * sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)

    * java.lang.reflect.Method.invoke(Method.java:597)
    *
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(
ListenerMethodInvokerImpl.java:276)

    *
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod
(ListenerMethodInvokerImpl.java:221)

    *
org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(
ListenerMethodInvokerImpl.java:157)

    *
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod
(ListenerMethodInvokerImpl.java:80)

    * org.apache.tapestry.listener.SyntheticListener.actionTriggered(
SyntheticListener.java:52)

    *
org.apache.tapestry.listener.ListenerInvokerTerminator.invokeListener(
ListenerInvokerTerminator.java:50)

    *
$ListenerInvoker_1138a7ba23c.invokeListener($ListenerInvoker_1138a7ba23c.java)

    * org.apache.tapestry.form.Form.renderComponent(Form.java:200)
* org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
:725)

* org.apache.tapestry.services.impl.DojoAjaxResponseBuilder.render(
DojoAjaxResponseBuilder.java:625)

    * org.apache.tapestry.form.Form.rewind(Form.java:269)
* org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java
:453)

    * org.apache.tapestry.form.Form.trigger(Form.java:280)
    * org.apache.tapestry.engine.DirectService.triggerComponent(
DirectService.java:166)

* org.apache.tapestry.engine.DirectService.service(DirectService.java
:142)

    *
$IEngineService_1138a7ba2ba.service($IEngineService_1138a7ba2ba.java)
* org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(
EngineServiceOuterProxy.java:72)

    * org.apache.tapestry.engine.AbstractEngine.service(
AbstractEngine.java:237)

* org.apache.tapestry.services.impl.InvokeEngineTerminator.service(
InvokeEngineTerminator.java:54)

    *
$WebRequestServicer_1138a7ba28e.service($WebRequestServicer_1138a7ba28e.java)

    * org.apache.tapestry.services.impl.DisableCachingFilter.service(
DisableCachingFilter.java:54)

    *
$WebRequestServicerFilter_1138a7ba290.service($WebRequestServicerFilter_1138a7ba290.java)






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







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







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







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

Reply via email to