You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kristian Marinkovic <kr...@porsche.co.at> on 2007/01/24 15:21:33 UTC

multiple events fired on @EventListener although it should fire once (Tapestry 4.1.1/4.1.2-20070121)

Hi,

the DIV element within the For component has an @EventListener
attached. When i click on it my listener method SOMETIMES gets invoked
more than once!!! (twice)

This happens in 4.1.1 and 4.1.2-SNAPSHOT (20070121).

>From the generated HTML page i can see that the Javascript code
for attaching the events gets generated twice... but only sometimes :)

Anyone experienced the same problem? Is it a bug?
Any workaround would be appreciated.

html file
<li jwcid="list_gp">
  <div jwcid="gpdiv@Any" class="ognl:classForGP">
    <p>
      <span jwcid="list_gp_info">lastname, firstname, zip city</span>
    </p>
  </div>
</li>

page file
<component id="list_gp" type="For">
  <binding name="source" value="ognl:GPList" />
  <binding name="value"  value="gpObject" />
</component>

java file
@EventListener(events={"onclick"},targets="gpdiv")
public void doClick(BrowserEvent event) {
  System.out.println("click: " + event.getTarget().get("id"));
}

greetings
kris


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


Antwort: Re: multiple events fired on @EventListener although it should fire once (Tapestry 4.1.1/4.1.2-20070121)

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi jesse,

bug is filed under:
https://issues.apache.org/jira/browse/TAPESTRY-1241

it contains a maven project and instructions to
reproduce the bug

g,
kris



                                                                           
             "Jesse Kuhnert"                                               
             <jkuhnert@gmail.c                                             
             om>                                                        An 
                                        "Tapestry users"                   
             05.02.2007 05:37           <us...@tapestry.apache.org>        
                                                                     Kopie 
                                                                           
              Bitte antworten                                        Thema 
                    an                  Re: multiple events fired on       
             "Tapestry users"           @EventListener although it should  
             <users@tapestry.a          fire once (Tapestry 4.1.1          
                pache.org>              /4.1.2-20070121)                   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Need more information probably, or a jira issue with some sort of
reasonable test case.

The situation you are describing sounds almost identical to :

http://opencomponentry.com:8080/timetracker/LocaleList.htm

Maybe there is something different for you?

JIRA .

On 1/24/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:
> [update]
>
> i just discovered that the Javascript code gets generated
> again for every iteration of the For component... but the
> event reaches the java class at most twice.
>
> hope this helps
>
>
>
>
>
>
>              Kristian
>              Marinkovic
>              <kristian.marinko
An
>              vic@porsche.co.at          Tapestry users
>              >                          <us...@tapestry.apache.org>
>
Kopie
>              24.01.2007 15:21
>
Thema
>                                         multiple events fired on
>               Bitte antworten           @EventListener although it should
>                     an                  fire once (Tapestry 4.1.1
>              "Tapestry users"           /4.1.2-20070121)
>              <users@tapestry.a
>                 pache.org>
>
>
>
>
>
>
>
>
>
> Hi,
>
> the DIV element within the For component has an @EventListener
> attached. When i click on it my listener method SOMETIMES gets invoked
> more than once!!! (twice)
>
> This happens in 4.1.1 and 4.1.2-SNAPSHOT (20070121).
>
> From the generated HTML page i can see that the Javascript code
> for attaching the events gets generated twice... but only sometimes :)
>
> Anyone experienced the same problem? Is it a bug?
> Any workaround would be appreciated.
>
> html file
> <li jwcid="list_gp">
>   <div jwcid="gpdiv@Any" class="ognl:classForGP">
>     <p>
>       <span jwcid="list_gp_info">lastname, firstname, zip city</span>
>     </p>
>   </div>
> </li>
>
> page file
> <component id="list_gp" type="For">
>   <binding name="source" value="ognl:GPList" />
>   <binding name="value"  value="gpObject" />
> </component>
>
> java file
> @EventListener(events={"onclick"},targets="gpdiv")
> public void doClick(BrowserEvent event) {
>   System.out.println("click: " + event.getTarget().get("id"));
> }
>
> greetings
> kris
>
>
> ---------------------------------------------------------------------
> 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
>
>


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
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: multiple events fired on @EventListener although it should fire once (Tapestry 4.1.1/4.1.2-20070121)

Posted by Jesse Kuhnert <jk...@gmail.com>.
Need more information probably, or a jira issue with some sort of
reasonable test case.

The situation you are describing sounds almost identical to :

http://opencomponentry.com:8080/timetracker/LocaleList.htm

Maybe there is something different for you?

JIRA .

On 1/24/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:
> [update]
>
> i just discovered that the Javascript code gets generated
> again for every iteration of the For component... but the
> event reaches the java class at most twice.
>
> hope this helps
>
>
>
>
>
>
>              Kristian
>              Marinkovic
>              <kristian.marinko                                          An
>              vic@porsche.co.at          Tapestry users
>              >                          <us...@tapestry.apache.org>
>                                                                      Kopie
>              24.01.2007 15:21
>                                                                      Thema
>                                         multiple events fired on
>               Bitte antworten           @EventListener although it should
>                     an                  fire once (Tapestry 4.1.1
>              "Tapestry users"           /4.1.2-20070121)
>              <users@tapestry.a
>                 pache.org>
>
>
>
>
>
>
>
>
>
> Hi,
>
> the DIV element within the For component has an @EventListener
> attached. When i click on it my listener method SOMETIMES gets invoked
> more than once!!! (twice)
>
> This happens in 4.1.1 and 4.1.2-SNAPSHOT (20070121).
>
> From the generated HTML page i can see that the Javascript code
> for attaching the events gets generated twice... but only sometimes :)
>
> Anyone experienced the same problem? Is it a bug?
> Any workaround would be appreciated.
>
> html file
> <li jwcid="list_gp">
>   <div jwcid="gpdiv@Any" class="ognl:classForGP">
>     <p>
>       <span jwcid="list_gp_info">lastname, firstname, zip city</span>
>     </p>
>   </div>
> </li>
>
> page file
> <component id="list_gp" type="For">
>   <binding name="source" value="ognl:GPList" />
>   <binding name="value"  value="gpObject" />
> </component>
>
> java file
> @EventListener(events={"onclick"},targets="gpdiv")
> public void doClick(BrowserEvent event) {
>   System.out.println("click: " + event.getTarget().get("id"));
> }
>
> greetings
> kris
>
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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


Antwort: multiple events fired on @EventListener although it should fire once (Tapestry 4.1.1/4.1.2-20070121)

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
[update]

i just discovered that the Javascript code gets generated
again for every iteration of the For component... but the
event reaches the java class at most twice.

hope this helps





                                                                           
             Kristian                                                      
             Marinkovic                                                    
             <kristian.marinko                                          An 
             vic@porsche.co.at          Tapestry users                     
             >                          <us...@tapestry.apache.org>        
                                                                     Kopie 
             24.01.2007 15:21                                              
                                                                     Thema 
                                        multiple events fired on           
              Bitte antworten           @EventListener although it should  
                    an                  fire once (Tapestry 4.1.1          
             "Tapestry users"           /4.1.2-20070121)                   
             <users@tapestry.a                                             
                pache.org>                                                 
                                                                           
                                                                           
                                                                           
                                                                           





Hi,

the DIV element within the For component has an @EventListener
attached. When i click on it my listener method SOMETIMES gets invoked
more than once!!! (twice)

This happens in 4.1.1 and 4.1.2-SNAPSHOT (20070121).

>From the generated HTML page i can see that the Javascript code
for attaching the events gets generated twice... but only sometimes :)

Anyone experienced the same problem? Is it a bug?
Any workaround would be appreciated.

html file
<li jwcid="list_gp">
  <div jwcid="gpdiv@Any" class="ognl:classForGP">
    <p>
      <span jwcid="list_gp_info">lastname, firstname, zip city</span>
    </p>
  </div>
</li>

page file
<component id="list_gp" type="For">
  <binding name="source" value="ognl:GPList" />
  <binding name="value"  value="gpObject" />
</component>

java file
@EventListener(events={"onclick"},targets="gpdiv")
public void doClick(BrowserEvent event) {
  System.out.println("click: " + event.getTarget().get("id"));
}

greetings
kris


---------------------------------------------------------------------
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