You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Stanton <pa...@gunnsoft.com.au> on 2007/07/04 09:35:27 UTC

4.1.1 Dialog disappears without request

Hi all.

I can't test this under 4.1.2 because of my other issues (post - 4.1.1 
upgrade to 4.1.2 async listener no longer works).

I'm having another issue with my dialogs. This one is totally 
perplexing. What happens is this:
1. I click my add button, the dialog appears.
2. I click my cancel button, the dialog disappears.
3. I click my add button, the dialog appears for a second or two, then 
disappears of it's own accord.

My debugging output:
showDialog
cancelDialog
showDialog
cancelDialog

.. so the 2nd 'cancelDialog' shouldn't be called and is not triggered by 
user input, maybe dojo is calling it? why?

My Java:
    @EventListener(targets = {"myShowButton"}, events = "onclick", async 
= true)
    public void showDialog()
    {
        System.out.println("showDialog");
..do work ..
        setDialogHidden(false);
        getRequestCycle().getResponseBuilder().updateComponent("addDialog");
    }

    @EventListener(targets = "myCancelButton", events = "onclick", async 
= true)
    public void cancelDialog()
    {
        System.out.println("cancelDialog");
..do work ..
        setDialogHidden(true);
        getRequestCycle().getResponseBuilder().updateComponent("addDialog");
    }

My Html:
<form jwcid="borderForm@Form" listener="ognl:page.listeners.formSubmit">
    <input type="button" jwcid="myShowButton@Button" label="Show Dialog"/>
</form>

<div jwcid="myDialog@Dialog" hidden="ognl:dialogHidden">
    <form jwcid="myDialogForm@Form" success="listener:mySaveListener">
        <input type="button" jwcid="myCancelButton@Button" label="Cancel"/>
    </form>
</div>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: 4.1.1 Dialog disappears without request

Posted by Paul Stanton <pa...@gunnsoft.com.au>.
Turns out this is fixed in 4.1.2. I had to do some funky stuff to get 
4.1.2 working and it's not 100% yet, but I can't reproduce this 
particular issue  in 4.1.2. So thanks for the suggestion, it did help me 
figure out another problem ;)

Igor Drobiazko wrote:
> Hi Paul,
>
> just guessing: the might be some bug in @EventListener
> You could try to replace your Buttons by Submit and call your listener
> methods via action parameter:
>
> <input type="submit" jwcid="@Submit" action="listener:showDialog"/>
>
> Why do you prefer the combination of buttons + @EventListener?
> Your listener methods is triggered by clicking on a button, so you don't
> need the event listener?
>
> On 7/4/07, Paul Stanton <pa...@gunnsoft.com.au> wrote:
>>
>> Hi all.
>>
>> I can't test this under 4.1.2 because of my other issues (post - 4.1.1
>> upgrade to 4.1.2 async listener no longer works).
>>
>> I'm having another issue with my dialogs. This one is totally
>> perplexing. What happens is this:
>> 1. I click my add button, the dialog appears.
>> 2. I click my cancel button, the dialog disappears.
>> 3. I click my add button, the dialog appears for a second or two, then
>> disappears of it's own accord.
>>
>> My debugging output:
>> showDialog
>> cancelDialog
>> showDialog
>> cancelDialog
>>
>> .. so the 2nd 'cancelDialog' shouldn't be called and is not triggered by
>> user input, maybe dojo is calling it? why?
>>
>> My Java:
>>     @EventListener(targets = {"myShowButton"}, events = "onclick", async
>> = true)
>>     public void showDialog()
>>     {
>>         System.out.println("showDialog");
>> ..do work ..
>>         setDialogHidden(false);
>>
>>         
>> getRequestCycle().getResponseBuilder().updateComponent("addDialog");
>>     }
>>
>>     @EventListener(targets = "myCancelButton", events = "onclick", async
>> = true)
>>     public void cancelDialog()
>>     {
>>         System.out.println("cancelDialog");
>> ..do work ..
>>         setDialogHidden(true);
>>
>>         
>> getRequestCycle().getResponseBuilder().updateComponent("addDialog");
>>     }
>>
>> My Html:
>> <form jwcid="borderForm@Form" listener="ognl:page.listeners.formSubmit">
>>     <input type="button" jwcid="myShowButton@Button" label="Show 
>> Dialog"/>
>> </form>
>>
>> <div jwcid="myDialog@Dialog" hidden="ognl:dialogHidden">
>>     <form jwcid="myDialogForm@Form" success="listener:mySaveListener">
>>         <input type="button" jwcid="myCancelButton@Button"
>> label="Cancel"/>
>>     </form>
>> </div>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: 4.1.1 Dialog disappears without request

Posted by Igor Drobiazko <ig...@gmail.com>.
Hi Paul,

just guessing: the might be some bug in @EventListener
You could try to replace your Buttons by Submit and call your listener
methods via action parameter:

<input type="submit" jwcid="@Submit" action="listener:showDialog"/>

Why do you prefer the combination of buttons + @EventListener?
Your listener methods is triggered by clicking on a button, so you don't
need the event listener?

On 7/4/07, Paul Stanton <pa...@gunnsoft.com.au> wrote:
>
> Hi all.
>
> I can't test this under 4.1.2 because of my other issues (post - 4.1.1
> upgrade to 4.1.2 async listener no longer works).
>
> I'm having another issue with my dialogs. This one is totally
> perplexing. What happens is this:
> 1. I click my add button, the dialog appears.
> 2. I click my cancel button, the dialog disappears.
> 3. I click my add button, the dialog appears for a second or two, then
> disappears of it's own accord.
>
> My debugging output:
> showDialog
> cancelDialog
> showDialog
> cancelDialog
>
> .. so the 2nd 'cancelDialog' shouldn't be called and is not triggered by
> user input, maybe dojo is calling it? why?
>
> My Java:
>     @EventListener(targets = {"myShowButton"}, events = "onclick", async
> = true)
>     public void showDialog()
>     {
>         System.out.println("showDialog");
> ..do work ..
>         setDialogHidden(false);
>
>         getRequestCycle().getResponseBuilder().updateComponent("addDialog");
>     }
>
>     @EventListener(targets = "myCancelButton", events = "onclick", async
> = true)
>     public void cancelDialog()
>     {
>         System.out.println("cancelDialog");
> ..do work ..
>         setDialogHidden(true);
>
>         getRequestCycle().getResponseBuilder().updateComponent("addDialog");
>     }
>
> My Html:
> <form jwcid="borderForm@Form" listener="ognl:page.listeners.formSubmit">
>     <input type="button" jwcid="myShowButton@Button" label="Show Dialog"/>
> </form>
>
> <div jwcid="myDialog@Dialog" hidden="ognl:dialogHidden">
>     <form jwcid="myDialogForm@Form" success="listener:mySaveListener">
>         <input type="button" jwcid="myCancelButton@Button"
> label="Cancel"/>
>     </form>
> </div>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>