You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by gladstone <es...@onecornerstone.com> on 2009/02/19 21:28:16 UTC

Dependent implemented with @OnEvent mixin + AjaxFormLoop

Posted by gladstone <es...@onecornerstone.com>.
Thanks Thiago, you are very helpful.

I tried a cheaper fix, but hacking the T5COnEvent.js file and creating my
own version of T5 Components JAR.  All I did was add a second parameter to
the JavaScript method that is the clientId (elementId).  This only allows my
dependent select solution to work inside an AjaxFormLoop.

I have another problem now though as I can not seem to be able to have two
AjaxFormLoop inside a form.  There is only one onAddRow/onRemoveRow method
so I can't distinguish which loop is firing the events.  &#*$&^@#&^@*




Thiago H. de Paula Figueiredo wrote:
> 
> Em Thu, 19 Feb 2009 17:44:54 -0300, Elmer Smith  
> <es...@venterraliving.com> escreveu:
> 
>> I first thought of somehow using getClientId().  The problem is that I
>> need the id in the JavaScript function (the onCompleteCallback one) to
>> then try and determine which select put values into.
> 
> I have also needed to know what component fired an event, so I filed  
> https://issues.apache.org/jira/browse/TAP5-146. You can vote there. The  
> most votes, the most likely to beee solved. :)
> 
> Another solution, maybe more complicated, would be to write the Javascript  
> yourself instead of using the @OnEvent mixin. Using Prototype, that  
> wouldn't be hard. Your JS code would request an URL generated by  
> ComponentResources.createEventLink(). Maybe you'll need to add the client  
> id to this URL, maybe not. Your event handler method would receive the id  
> through its parameter. I don't know if this works, but that's what I would  
> try to do. ;)
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Dependent-%3Cselect%3E-implemented-with-%40OnEvent-mixin-%2B-AjaxFormLoop-tp22108985p22187544.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Dependent implemented with @OnEvent mixin + AjaxFormLoop

Posted by Elmer Smith <es...@venterraliving.com>.
I first thought of somehow using getClientId().  The problem is that I
need the id in the JavaScript function (the onCompleteCallback one) to
then try and determine which select put values into.

If I could call getClientId() when in the Java @OnEvent method, then I
could sneak it in as the first entry in my JSONArray.  The problem there
is, what could I base the getClientId() method off of?



-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com] 
Sent: Thursday, February 19, 2009 3:33 PM
To: Tapestry users
Subject: Re: Dependent <select> implemented with @OnEvent mixin +
AjaxFormLoop

Em Thu, 19 Feb 2009 17:28:16 -0300, gladstone
<es...@onecornerstone.com>  
escreveu:

> Once this is placed
> inside an AjaxFormLoop, the client id for the select elements are made
> unique by having a unique number appended to it.  Inside the
JavaScript
> function, it can no longer find the select element to update as it  
> doesn't know which one (what id) to update.

Does it help to use Select's (and any other AbstractField class)  
getClientId() method?

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


This message (including any attachments) is intended only for the use of the individual or entity to whom it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if an electronic communication.


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


Re: Dependent