Re: Problem deploying tapestry webapp

2011-06-16 Thread ael
I think this is very obvious?

java.lang.ArrayIndexOutOfBoundsException: -1
java.util.ArrayList.get(ArrayList.java:324) 


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-deploying-tapestry-webapp-tp3397765p4493912.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: How can I use Progressive display in my code

2011-06-16 Thread pradeepchy
Thanks Laurent :-), It was really helpful and I got my problem resolved.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-can-I-use-Progressive-display-in-my-code-tp4491860p4494308.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



AW: ajaxformloop: adding script dynamically - solved

2011-06-16 Thread Deininger, Andreas
Thanks Josh, that was exactly what I was looking for!

Andreas

 -Ursprüngliche Nachricht-
 Von: Josh Canfield [mailto:joshcanfi...@gmail.com]
 Gesendet: Mittwoch, 15. Juni 2011 18:49
 An: Tapestry users; andr...@deininger.net
 Betreff: Re: ajaxformloop: accessing id of elements
 
  I used a prototype based plug in to mask the input for a text field
  with the id 'myid'.
  This is the code inside my page.tml which works perfectly fine:
 
 You may want to consider making MaskedInput into a mixin then you can
 add the script dynamically as the fields are added to the page.
 
 t:textfield t:id=myid value=currentprop.prop mixins=MaskedInput
 pattern='99/99/'/
 
 http://tapestry.apache.org/component-mixins.html
 
 Josh

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



Unit testing mixins

2011-06-16 Thread P . Stavrinides
Hi all,

We are converting most of our JavaScript code in our Tapestry applications into 
mixins, and I was wandering if anyone can recommend a testing framework / 
methodology for unit testing these mixins. 

We have only just started to think about a solution, but we currently use JUnit 
4 and Testify to test IoC services, so we are familiar with these... an ideal 
solution would play nice with these frameworks. 

I am also aware of the @ForComponents annotation in Testify for testing 
components, to be honest I haven't used it much and couldn't found any examples 
of using it to test mixins... can it? 

If there isn't anything already integrated with Tapestry's mixin architecture, 
then I guess I could test only the JavaScript code. Since we always try to use 
external .js files with a mixins, we do have have the required separation.

Would love to know what others are doing... any thoughts?

Kind regards,
Peter




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



Re: GZip Filter getting in the way of my LessCSS Filter

2011-06-16 Thread redijedi
Thanks for all of your help! I ended up hacking up the URI from the request
and creating context: and classpath: resource paths manually. Seems clunky,
but works. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/GZip-Filter-getting-in-the-way-of-my-LessCSS-Filter-tp4491550p4495155.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Unit testing mixins

2011-06-16 Thread Thiago H. de Paula Figueiredo

On Thu, 16 Jun 2011 08:43:28 -0300, p.stavrini...@albourne.com wrote:


Hi all,


Hi!

We are converting most of our JavaScript code in our Tapestry  
applications into mixins, and I was wandering if anyone can recommend a  
testing framework / methodology for unit testing these mixins.


I use JUnit (it could be TestNG or any other similar framework) +  
Selenium. I create a page using the given mixin and test it. This isn't an  
unit test: it's an integration one, but it does the work, specially when  
there's JavaScript involved.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Mixin competes with Zone's event handler

2011-06-16 Thread Nicolas Barrera
Hi T5 users!

I got the following problem (I think my mixin is competing with the Zone's
javascript code when the actionLink I apply my mixing has also a t:zone),

i 'm developing a confirmation dialog box Mixin... (using some cool modal
window plugin)

that is.., i got an ActionLink with t:mixin=confirmBox attribute so when i
click on it a dialog box appears with two buttons (Yes/No) if I click No the
dialog box dissapears and
the page remain the same (I 'm using prototype's Event.stop(e) here)

If I click Yes, then the dialog box dissapears and the page should do what
clicking in an ordinary eventLink would do.


The problem arises when I apply my mixin to an actionLink which also has a
zone associated to it, in this case the dialog box appears but rapidly
dissapears and the zone is refreshed, first it seemed that
the Event.stop(e) wasn't working but then,

I realized that the actionLink had two listeners to the action link's
onclick event:

* My event handler
* And the Tapestry.ZoneManager event handler where he does the ajax request
and refreshes the zone


is there any way to manage to execute the Tapestry.ZoneManager's event
handler only after user clicks Yes button on my mixin's Yes button?

cheers and thanks in advance!

Nicolás.-


Parameter namespace usage.

2011-06-16 Thread Lenny Primak
Hi!

It seems to me that the parameter namespace is optional. Everything works with 
or without it. 
Is there a specific recommended use of this namespace or am I missing something?

Thanks. 



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



Re: Parameter namespace usage.

2011-06-16 Thread Thiago H. de Paula Figueiredo
On Thu, 16 Jun 2011 12:52:27 -0300, Lenny Primak lpri...@hope.nyc.ny.us  
wrote:



Hi!


Hi!

It seems to me that the parameter namespace is optional. Everything  
works with or without it.


Please be more specific.

Is there a specific recommended use of this namespace or am I missing  
something?


Passing block parameters to components (such as p:nameCell in Grid).

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Mixin competes with Zone's event handler

2011-06-16 Thread Josh Canfield
 is there any way to manage to execute the Tapestry.ZoneManager's event
 handler only after user clicks Yes button on my mixin's Yes button?

No, I don't believe you can. As I recall it binds to click on the a
and events are executed in an undefined order.

The following link from the list describes doing exactly what you're
looking for.

http://tapestry-users.832.n2.nabble.com/quot-Confirm-quot-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950

Josh

On Thu, Jun 16, 2011 at 8:42 AM, Nicolas Barrera nbarr...@gmail.com wrote:
 Hi T5 users!

 I got the following problem (I dsthink my mixin is competing with the Zone's
 javascript code when the actionLink I apply my mixing has also a t:zone),

 i 'm developing a confirmation dialog box Mixin... (using some cool modal
 window plugin)

 that is.., i got an ActionLink with t:mixin=confirmBox attribute so when i
 click on it a dialog box appears with two buttons (Yes/No) if I click No the
 dialog box dissapears and
 the page remain the same (I 'm using prototype's Event.stop(e) here)

 If I click Yes, then the dialog box dissapears and the page should do what
 clicking in an ordinary eventLink would do.


 The problem arises when I apply my mixin to an actionLink which also has a
 zone associated to it, in this case the dialog box appears but rapidly
 dissapears and the zone is refreshed, first it seemed that
 the Event.stop(e) wasn't working but then,

 I realized that the actionLink had two listeners to the action link's
 onclick event:

 * My event handler
 * And the Tapestry.ZoneManager event handler where he does the ajax request
 and refreshes the zone


 is there any way to manage to execute the Tapestry.ZoneManager's event
 handler only after user clicks Yes button on my mixin's Yes button?

 cheers and thanks in advance!

 Nicolás.-


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



Re: Mixin competes with Zone's event handler

2011-06-16 Thread Nicolas Barrera
Thanks so much Josh,

I was just diving in nabble and found another thread suggesting the same
solution as the one you mention which i 'll post here just for the record:
http://tapestry.1045711.n5.nabble.com/T5-actionlink-ajax-zone-and-user-onclick-handler-tt2400741.html

anyway i believe the thread you wrote about is much more clearer :)
so thanks again

cheers

Nicolás.-


On Thu, Jun 16, 2011 at 1:48 PM, Josh Canfield joshcanfi...@gmail.comwrote:

  is there any way to manage to execute the Tapestry.ZoneManager's event
  handler only after user clicks Yes button on my mixin's Yes button?

 No, I don't believe you can. As I recall it binds to click on the a
 and events are executed in an undefined order.

 The following link from the list describes doing exactly what you're
 looking for.


 http://tapestry-users.832.n2.nabble.com/quot-Confirm-quot-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950

 Josh

 On Thu, Jun 16, 2011 at 8:42 AM, Nicolas Barrera nbarr...@gmail.com
 wrote:
  Hi T5 users!
 
  I got the following problem (I dsthink my mixin is competing with the
 Zone's
  javascript code when the actionLink I apply my mixing has also a t:zone),
 
  i 'm developing a confirmation dialog box Mixin... (using some cool modal
  window plugin)
 
  that is.., i got an ActionLink with t:mixin=confirmBox attribute so
 when i
  click on it a dialog box appears with two buttons (Yes/No) if I click No
 the
  dialog box dissapears and
  the page remain the same (I 'm using prototype's Event.stop(e) here)
 
  If I click Yes, then the dialog box dissapears and the page should do
 what
  clicking in an ordinary eventLink would do.
 
 
  The problem arises when I apply my mixin to an actionLink which also has
 a
  zone associated to it, in this case the dialog box appears but rapidly
  dissapears and the zone is refreshed, first it seemed that
  the Event.stop(e) wasn't working but then,
 
  I realized that the actionLink had two listeners to the action link's
  onclick event:
 
  * My event handler
  * And the Tapestry.ZoneManager event handler where he does the ajax
 request
  and refreshes the zone
 
 
  is there any way to manage to execute the Tapestry.ZoneManager's event
  handler only after user clicks Yes button on my mixin's Yes button?
 
  cheers and thanks in advance!
 
  Nicolás.-
 

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




RE : Mixin competes with Zone's event handler

2011-06-16 Thread Guerin Laurent
Perhaps, i have missing something, but i think you can, by setting the 
parameter InitializationPriority.LATE on your Javascript initialisation call :

// Late, to overwrite other event handlers
javascriptSupport.addInitializerCall(InitializationPriority.LATE, 
yourModalBoxBuilder, spec);

In this way, your handle has the priority and you'll be able stop the initial 
event fired by the actionlink (even if there is an ajax zone).

This is what is done by the Confirm modalBox mixin written by Howard into tapx 
project :
 
https://github.com/hlship/tapx/blob/master/tapx-core/src/main/java/com/howardlewisship/tapx/core/mixins/Confirm.java

My 2 cents :-)

Laurent

De : Josh Canfield [joshcanfi...@gmail.com]
Date d'envoi : jeudi 16 juin 2011 18:48
À : Tapestry users
Objet : Re: Mixin competes with Zone's event handler

 is there any way to manage to execute the Tapestry.ZoneManager's event
 handler only after user clicks Yes button on my mixin's Yes button?

No, I don't believe you can. As I recall it binds to click on the a
and events are executed in an undefined order.

The following link from the list describes doing exactly what you're
looking for.

http://tapestry-users.832.n2.nabble.com/quot-Confirm-quot-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950

Josh

On Thu, Jun 16, 2011 at 8:42 AM, Nicolas Barrera nbarr...@gmail.com wrote:
 Hi T5 users!

 I got the following problem (I dsthink my mixin is competing with the Zone's
 javascript code when the actionLink I apply my mixing has also a t:zone),

 i 'm developing a confirmation dialog box Mixin... (using some cool modal
 window plugin)

 that is.., i got an ActionLink with t:mixin=confirmBox attribute so when i
 click on it a dialog box appears with two buttons (Yes/No) if I click No the
 dialog box dissapears and
 the page remain the same (I 'm using prototype's Event.stop(e) here)

 If I click Yes, then the dialog box dissapears and the page should do what
 clicking in an ordinary eventLink would do.


 The problem arises when I apply my mixin to an actionLink which also has a
 zone associated to it, in this case the dialog box appears but rapidly
 dissapears and the zone is refreshed, first it seemed that
 the Event.stop(e) wasn't working but then,

 I realized that the actionLink had two listeners to the action link's
 onclick event:

 * My event handler
 * And the Tapestry.ZoneManager event handler where he does the ajax request
 and refreshes the zone


 is there any way to manage to execute the Tapestry.ZoneManager's event
 handler only after user clicks Yes button on my mixin's Yes button?

 cheers and thanks in advance!

 Nicolás.-


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


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



Re: RE : Mixin competes with Zone's event handler

2011-06-16 Thread Josh Canfield
        // Late, to overwrite other event handlers
        javascriptSupport.addInitializerCall(InitializationPriority.LATE, 
 yourModalBoxBuilder, spec);

Getting a late initialization is critical but not the solution.
Howard's solution is to remove all the click handlers from the link
and replace them with a new one.

/*
 * Replace the normal click event, knowing that in most cases, the
 * original link or button has an Tapestry.ACTION_EVENT event handler to
 * do its real work.
*/
element.stopObserving(click);

Look towards the bottom of this file:
https://github.com/hlship/tapx/blob/master/tapx-core/src/main/resources/com/howardlewisship/tapx/core/tapx.js

I have an irrational fear of removing all click handlers from a link.
I know it's irrational and yet the fear persists...

Nicolás should definitely have a look at tapx for inspiration :)

Josh

On Thu, Jun 16, 2011 at 10:55 AM, Guerin Laurent lgue...@sopragroup.com wrote:
 Perhaps, i have missing something, but i think you can, by setting the 
 parameter InitializationPriority.LATE on your Javascript initialisation call :

        // Late, to overwrite other event handlers
        javascriptSupport.addInitializerCall(InitializationPriority.LATE, 
 yourModalBoxBuilder, spec);

 In this way, your handle has the priority and you'll be able stop the initial 
 event fired by the actionlink (even if there is an ajax zone).

 This is what is done by the Confirm modalBox mixin written by Howard into 
 tapx project :
  https://github.com/hlship/tapx/blob/master/tapx-core/src/main/java/com/howardlewisship/tapx/core/mixins/Confirm.java

 My 2 cents :-)

 Laurent
 
 De : Josh Canfield [joshcanfi...@gmail.com]
 Date d'envoi : jeudi 16 juin 2011 18:48
 À : Tapestry users
 Objet : Re: Mixin competes with Zone's event handler

 is there any way to manage to execute the Tapestry.ZoneManager's event
 handler only after user clicks Yes button on my mixin's Yes button?

 No, I don't believe you can. As I recall it binds to click on the a
 and events are executed in an undefined order.

 The following link from the list describes doing exactly what you're
 looking for.

 http://tapestry-users.832.n2.nabble.com/quot-Confirm-quot-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950

 Josh

 On Thu, Jun 16, 2011 at 8:42 AM, Nicolas Barrera nbarr...@gmail.com wrote:
 Hi T5 users!

 I got the following problem (I dsthink my mixin is competing with the Zone's
 javascript code when the actionLink I apply my mixing has also a t:zone),

 i 'm developing a confirmation dialog box Mixin... (using some cool modal
 window plugin)

 that is.., i got an ActionLink with t:mixin=confirmBox attribute so when i
 click on it a dialog box appears with two buttons (Yes/No) if I click No the
 dialog box dissapears and
 the page remain the same (I 'm using prototype's Event.stop(e) here)

 If I click Yes, then the dialog box dissapears and the page should do what
 clicking in an ordinary eventLink would do.


 The problem arises when I apply my mixin to an actionLink which also has a
 zone associated to it, in this case the dialog box appears but rapidly
 dissapears and the zone is refreshed, first it seemed that
 the Event.stop(e) wasn't working but then,

 I realized that the actionLink had two listeners to the action link's
 onclick event:

 * My event handler
 * And the Tapestry.ZoneManager event handler where he does the ajax request
 and refreshes the zone


 is there any way to manage to execute the Tapestry.ZoneManager's event
 handler only after user clicks Yes button on my mixin's Yes button?

 cheers and thanks in advance!

 Nicolás.-


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


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



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



RE : RE : Mixin competes with Zone's event handler

2011-06-16 Thread Guerin Laurent
Yep, forgot to mention the replacement and the potential consequence when 
original event differ from the normal click event.
Thanks for the add :-)


De : Josh Canfield [joshcanfi...@gmail.com]

/*
 * Replace the normal click event, knowing that in most cases, the
 * original link or button has an Tapestry.ACTION_EVENT event handler to
 * do its real work.
*/
element.stopObserving(click);


On Thu, Jun 16, 2011 at 10:55 AM, Guerin Laurent lgue...@sopragroup.com wrote:
 Perhaps, i have missing something, but i think you can, by setting the 
 parameter InitializationPriority.LATE on your Javascript initialisation call :

// Late, to overwrite other event handlers
javascriptSupport.addInitializerCall(InitializationPriority.LATE, 
 yourModalBoxBuilder, spec);

 In this way, your handle has the priority and you'll be able stop the initial 
 event fired by the actionlink (even if there is an ajax zone).

 This is what is done by the Confirm modalBox mixin written by Howard into 
 tapx project :
  
 https://github.com/hlship/tapx/blob/master/tapx-core/src/main/java/com/howardlewisship/tapx/core/mixins/Confirm.java

 My 2 cents :-)

 Laurent
 
 De : Josh Canfield [joshcanfi...@gmail.com]
 Date d'envoi : jeudi 16 juin 2011 18:48
 À : Tapestry users
 Objet : Re: Mixin competes with Zone's event handler

 is there any way to manage to execute the Tapestry.ZoneManager's event
 handler only after user clicks Yes button on my mixin's Yes button?

 No, I don't believe you can. As I recall it binds to click on the a
 and events are executed in an undefined order.

 The following link from the list describes doing exactly what you're
 looking for.

 http://tapestry-users.832.n2.nabble.com/quot-Confirm-quot-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950

 Josh

 On Thu, Jun 16, 2011 at 8:42 AM, Nicolas Barrera nbarr...@gmail.com wrote:
 Hi T5 users!

 I got the following problem (I dsthink my mixin is competing with the Zone's
 javascript code when the actionLink I apply my mixing has also a t:zone),

 i 'm developing a confirmation dialog box Mixin... (using some cool modal
 window plugin)

 that is.., i got an ActionLink with t:mixin=confirmBox attribute so when i
 click on it a dialog box appears with two buttons (Yes/No) if I click No the
 dialog box dissapears and
 the page remain the same (I 'm using prototype's Event.stop(e) here)

 If I click Yes, then the dialog box dissapears and the page should do what
 clicking in an ordinary eventLink would do.


 The problem arises when I apply my mixin to an actionLink which also has a
 zone associated to it, in this case the dialog box appears but rapidly
 dissapears and the zone is refreshed, first it seemed that
 the Event.stop(e) wasn't working but then,

 I realized that the actionLink had two listeners to the action link's
 onclick event:

 * My event handler
 * And the Tapestry.ZoneManager event handler where he does the ajax request
 and refreshes the zone


 is there any way to manage to execute the Tapestry.ZoneManager's event
 handler only after user clicks Yes button on my mixin's Yes button?

 cheers and thanks in advance!

 Nicolás.-


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


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



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


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



Re: Parameter namespace usage.

2011-06-16 Thread Lenny Primak
Thanks, Thiago, That's the answer I was looking for.
I was confusing regular parameters with block parameters.

On Jun 16, 2011, at 12:09 PM, Thiago H. de Paula Figueiredo wrote:

 On Thu, 16 Jun 2011 12:52:27 -0300, Lenny Primak lpri...@hope.nyc.ny.us 
 wrote:
 
 Hi!
 
 Hi!
 
 It seems to me that the parameter namespace is optional. Everything works 
 with or without it.
 
 Please be more specific.
 
 Is there a specific recommended use of this namespace or am I missing 
 something?
 
 Passing block parameters to components (such as p:nameCell in Grid).


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



Re: RE : Mixin competes with Zone's event handler

2011-06-16 Thread Thiago H. de Paula Figueiredo
On Thu, 16 Jun 2011 15:44:08 -0300, Josh Canfield joshcanfi...@gmail.com  
wrote:



I have an irrational fear of removing all click handlers from a link.
I know it's irrational and yet the fear persists...


Quite understandable. :)

Couldn't Tapestry have some function that adds ordered event handlers to  
elements, something like the Command design pattern?


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: RE : Mixin competes with Zone's event handler

2011-06-16 Thread Josh Canfield
 Couldn't Tapestry have some function that adds ordered event handlers to
 elements, something like the Command design pattern?

Sure. A dispatcher could be created that holds the handlers and calls
them in some defined order (insertion, before:xxx, etc)

JQuery appears to at least provide a stable order for events
registered with bind.
If there are multiple handlers registered, they will always execute
in the order in which they were bound.
http://api.jquery.com/bind/


Josh

On Thu, Jun 16, 2011 at 12:24 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 On Thu, 16 Jun 2011 15:44:08 -0300, Josh Canfield joshcanfi...@gmail.com
 wrote:

 I have an irrational fear of removing all click handlers from a link.
 I know it's irrational and yet the fear persists...

 Quite understandable. :)

 Couldn't Tapestry have some function that adds ordered event handlers to
 elements, something like the Command design pattern?

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
 instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br


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



Re: RE : Mixin competes with Zone's event handler

2011-06-16 Thread Thiago H. de Paula Figueiredo
On Thu, 16 Jun 2011 17:09:46 -0300, Josh Canfield joshcanfi...@gmail.com  
wrote:



Couldn't Tapestry have some function that adds ordered event handlers to
elements, something like the Command design pattern?


Sure. A dispatcher could be created that holds the handlers and calls
them in some defined order (insertion, before:xxx, etc)


JIRA? :)

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: RE : Mixin competes with Zone's event handler

2011-06-16 Thread Nicolas Barrera
Hi Thiago, thanks for answering...

perhaps before getting this in a JIRA issue, you would ilke to analyze what
Kalle says here:
http://tapestry.1045711.n5.nabble.com/T5-actionlink-ajax-zone-and-user-onclick-handler-tp2400741p2400745.html

about that setting an order of the event handler calls you could lost the
ability of running many handlers concurrently.

Although I don't know if that's really desired, just trying to help with
some lecture I got in the nabble archive :)

cheers

Nicolás.-


On Thu, Jun 16, 2011 at 5:36 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Thu, 16 Jun 2011 17:09:46 -0300, Josh Canfield joshcanfi...@gmail.com
 wrote:

  Couldn't Tapestry have some function that adds ordered event handlers to
 elements, something like the Command design pattern?


 Sure. A dispatcher could be created that holds the handlers and calls
 them in some defined order (insertion, before:xxx, etc)


 JIRA? :)

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: RE : Mixin competes with Zone's event handler

2011-06-16 Thread Thiago H. de Paula Figueiredo
On Thu, 16 Jun 2011 17:51:11 -0300, Nicolas Barrera nbarr...@gmail.com  
wrote:



Hi Thiago, thanks for answering...


Hi! :)

perhaps before getting this in a JIRA issue, you would ilke to analyze  
what

Kalle says here:
http://tapestry.1045711.n5.nabble.com/T5-actionlink-ajax-zone-and-user-onclick-handler-tp2400741p2400745.html
about that setting an order of the event handler calls you could lost the
ability of running many handlers concurrently.


I agree, but I don't know of any browser that triggers event listeners in  
parallel. Until the Web Workers were proposed JavaScript in browsers were  
non-threaded. This ordering I'm proposing would be absolutely optional and  
Tapestry-specific.



Although I don't know if that's really desired, just trying to help with
some lecture I got in the nabble archive :)


Thanks for that! :)

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: RE : Mixin competes with Zone's event handler

2011-06-16 Thread Kalle Korhonen
On Thu, Jun 16, 2011 at 2:11 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 On Thu, 16 Jun 2011 17:51:11 -0300, Nicolas Barrera nbarr...@gmail.com
 wrote:
 perhaps before getting this in a JIRA issue, you would ilke to analyze
 what
 Kalle says here:
 http://tapestry.1045711.n5.nabble.com/T5-actionlink-ajax-zone-and-user-onclick-handler-tp2400741p2400745.html
 about that setting an order of the event handler calls you could lost the
 ability of running many handlers concurrently.
 I agree, but I don't know of any browser that triggers event listeners in
 parallel. Until the Web Workers were proposed JavaScript in browsers were
 non-threaded. This ordering I'm proposing would be absolutely optional and
 Tapestry-specific.

Parallelism is just a possibility, but the essence of what I was
trying to say was that no other event frameworks allow ordering event
handlers either and that nesting and event propagation is the right
way of ordering html dom events.

Kalle

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



T5: How to use context-param or init-param from web.xml in contributeApplicationDefaults?

2011-06-16 Thread Nillehammer

Hi List,

I would like to replace the constant Strings in the method 
contributeApplicationDefaults in my AppModule. E.g. replace the 
following line:


configuration.add(SymbolConstants.SUPPORTED_LOCALES, en,de); // don't 
like the en,de here. Would like to replace it.


with something configurable in  a text file. I thought providing the 
values in web.xml either as context-param or as init-param for the 
TapestryFilter was a good idea.


My first try was to inject the Context service as additional parameter 
to the contribution method to get access to the context-params. That did 
not work. The parameter is null and Tapestry throws an exception. Same 
with ApplicationGlobals.


I then browsed through Tapestry's source code and found out that I could 
implement my own filter inheriting from 
org.apache.tapestry5.TapestryFilter. So my next try was to do that and 
override the method protected void init(Registry registry ). My hope 
was to be able to do something sensible with the 
javax.servlet.FilterConfig that is returned by getFilter(). But I have 
no clue, what to do.


Does someone have an idea what to do?

Thanks in advance,
nillehammer

--
http://www.winfonet.eu


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



Re: T5: How to use context-param or init-param from web.xml in contributeApplicationDefaults?

2011-06-16 Thread Lenny Primak
I use system properties. 



On Jun 16, 2011, at 6:28 PM, Nillehammer tapestry.nilleham...@winfonet.eu 
wrote:

 Hi List,
 
 I would like to replace the constant Strings in the method 
 contributeApplicationDefaults in my AppModule. E.g. replace the following 
 line:
 
 configuration.add(SymbolConstants.SUPPORTED_LOCALES, en,de); // don't like 
 the en,de here. Would like to replace it.
 
 with something configurable in  a text file. I thought providing the values 
 in web.xml either as context-param or as init-param for the TapestryFilter 
 was a good idea.
 
 My first try was to inject the Context service as additional parameter to the 
 contribution method to get access to the context-params. That did not work. 
 The parameter is null and Tapestry throws an exception. Same with 
 ApplicationGlobals.
 
 I then browsed through Tapestry's source code and found out that I could 
 implement my own filter inheriting from org.apache.tapestry5.TapestryFilter. 
 So my next try was to do that and override the method protected void 
 init(Registry registry ). My hope was to be able to do something sensible 
 with the javax.servlet.FilterConfig that is returned by getFilter(). But I 
 have no clue, what to do.
 
 Does someone have an idea what to do?
 
 Thanks in advance,
 nillehammer
 
 -- 
 http://www.winfonet.eu
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 

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



Re: T5: How to use context-param or init-param from web.xml in contributeApplicationDefaults?

2011-06-16 Thread Nillehammer
Yeah, a possible way to go. But I'd like a more persistent solution 
hence the idea of using params in web.xml


Am 17.06.2011 00:36, schrieb Lenny Primak:

I use system properties.



On Jun 16, 2011, at 6:28 PM, Nillehammertapestry.nilleham...@winfonet.eu  
wrote:


Hi List,

I would like to replace the constant Strings in the method 
contributeApplicationDefaults in my AppModule. E.g. replace the following 
line:

configuration.add(SymbolConstants.SUPPORTED_LOCALES, en,de); // don't like the 
en,de here. Would like to replace it.

with something configurable in  a text file. I thought providing the values in 
web.xml either as context-param or as init-param for the TapestryFilter was a 
good idea.

My first try was to inject the Context service as additional parameter to the 
contribution method to get access to the context-params. That did not work. The 
parameter is null and Tapestry throws an exception. Same with 
ApplicationGlobals.

I then browsed through Tapestry's source code and found out that I could implement my own 
filter inheriting from org.apache.tapestry5.TapestryFilter. So my next try was to do that 
and override the method protected void init(Registry registry ). My hope was 
to be able to do something sensible with the javax.servlet.FilterConfig that is returned 
by getFilter(). But I have no clue, what to do.

Does someone have an idea what to do?

Thanks in advance,
nillehammer

--
http://www.winfonet.eu


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


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





--
http://www.winfonet.eu


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



Re: T5: How to use context-param or init-param from web.xml in contributeApplicationDefaults?

2011-06-16 Thread Martin Strand
ApplicationDefaults is only one of many SymbolProviders, you don't need to  
configure that specific SymbolProvider to set the supported locales.
There are other options, including support for .properties files or system  
properties.



I prefer context parameters myself, everything should just work if you  
add it to web.xml like so:


context-param
  param-nametapestry.supported-locales/param-name
  param-valueen,de/param-value
/context-param

The ServletContextSymbolProvider will handle the rest for you.
I'm sure you're already doing this for other symbols, at least  
tapestry.app-package :)



On Fri, 17 Jun 2011 00:28:17 +0200, Nillehammer  
tapestry.nilleham...@winfonet.eu wrote:



Hi List,

I would like to replace the constant Strings in the method  
contributeApplicationDefaults in my AppModule. E.g. replace the  
following line:


configuration.add(SymbolConstants.SUPPORTED_LOCALES, en,de); // don't  
like the en,de here. Would like to replace it.


with something configurable in  a text file. I thought providing the  
values in web.xml either as context-param or as init-param for the  
TapestryFilter was a good idea.


My first try was to inject the Context service as additional parameter  
to the contribution method to get access to the context-params. That did  
not work. The parameter is null and Tapestry throws an exception. Same  
with ApplicationGlobals.


I then browsed through Tapestry's source code and found out that I could  
implement my own filter inheriting from  
org.apache.tapestry5.TapestryFilter. So my next try was to do that and  
override the method protected void init(Registry registry ). My hope  
was to be able to do something sensible with the  
javax.servlet.FilterConfig that is returned by getFilter(). But I have  
no clue, what to do.


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



Re: Choose witch Component to use by a String

2011-06-16 Thread Bo Gao
 You can use ComponentSource to grab other pages, and then grab components off 
 of those pages.
 I've used this approach for plugin-style apps where the components to use for 
 a given data type are determined at runtime and can be plugged-in. 

I tried this approach.
Is this means I must put all my components in a page. 
Is their a performance problem if i have many components in one page?

How to pass parameter to the component I get in this way.

Thanks


On Jun 16, 2011, at 2:37 AM, Robert Zeigler wrote:

 You can use ComponentSource to grab other pages, and then grab components off 
 of those pages.
 I've used this approach for plugin-style apps where the components to use for 
 a given data type are determined at runtime and can be plugged-in. 
 
 Robert
 
 On Jun 15, 2011, at 6/151:31 PM , Bo Gao wrote:
 
 Thanks.
 
 You can't choose your components at runtime. Although, if you have a
 set of known components that you want to choose from you can put your
 components in t:block and load the block by id.
 
 
 If there are too many known components, I don't want to put so many 
 components in on page.
 
 I have another thought. Can I create a new component, and based on a String
 parameter, render this component as another known component. 
 (Like a page forward to another page).
 
 or, is there a way to get an instance of a Component using java code at 
 runtime.
 
 
 On Jun 16, 2011, at 1:26 AM, Josh Canfield wrote:
 
 I want to use a component in a page, but i don't know which to use,
 I only know a String at Runtime, How can I do this.
 
 http://tapestry.apache.org/principles.html
 
 Principle 1 – Static Structure, Dynamic Behavior
 
 You can't choose your components at runtime. Although, if you have a
 set of known components that you want to choose from you can put your
 components in t:block and load the block by id.
 
 
 t:delegate to=namedBlock/!-- where namedBlock is a page property
 which returns the block based on your runtime value --
 
 t:block t:id=circlet:drawcircle//t:block
 t:block t:id=squaret:drawsquare//t:block
 t:block t:id=trianglet:drawtriangle//t:block
 
 
 Josh
 
 On Wed, Jun 15, 2011 at 10:20 AM, Bo Gao eli...@gmail.com wrote:
 I want to use a component in a page, but i don't know which to use,
 I only know a String at Runtime, How can I do this.
 
 I add div t:type=component1/divto a .tml file, component1 is the 
 Component Class name.
 I try to add a method getComponentName() to the java file, then i can 
 control which
 component to use, but i failed.
 
 Is their another way to do this?
 
 Thanks.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 --
 Bo Gao
 eli...@gmail.com
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 

--
Bo Gao
eli...@gmail.com





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



Re: Choose witch Component to use by a String

2011-06-16 Thread Thiago H. de Paula Figueiredo

On Thu, 16 Jun 2011 23:21:27 -0300, Bo Gao eli...@gmail.com wrote:


I tried this approach.
Is this means I must put all my components in a page.
Is their a performance problem if i have many components in one page?


No.


How to pass parameter to the component I get in this way.


Use the Environment service.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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