Another option which avoids reliance on class name:
$$('[id^=techFirstName]')[0]
J
typo ... should have been $$('.billing') ... i need some new glasses!
2009/10/6 Toby Hobson
> I can confirm that both Thiago's and Christophe's approaches work. In the
> end I used Thiago's suggestion because although I gave the example of
> needing to copy one text field, in fact I needed to do
I can confirm that both Thiago's and Christophe's approaches work. In the
end I used Thiago's suggestion because although I gave the example of
needing to copy one text field, in fact I needed to do this for 10 fields so
passing 20 clientIds to a javascript function/constructor was less than
ideal.
Thanks Thiago, never thought about this approach.
Even if class is not unique, we would be able to find my elements like this
too.
Well done Thiago ... a good example of thinking "outside the box" :-)
Thanks!
2009/10/5 Thiago H. de Paula Figueiredo
> Em Mon, 05 Oct 2009 19:38:59 -0300, Toby Hobson <
> toby.hob...@googlemail.com> escreveu:
>
> Hi Thiago
>>
>
> Hi!
>
> I tried that but unfortunately T5 is appending a rando
Em Mon, 05 Oct 2009 19:38:59 -0300, Toby Hobson
escreveu:
Hi Thiago
Hi!
I tried that but unfortunately T5 is appending a random string at the
end of the id e.g.
According to firebug the html generated is
You can use the class attribute instead then use Prototype (or jQuery) to
get
Hi Thiago
I tried that but unfortunately T5 is appending a random string at the end of
the id e.g.
@Component(id="techFirstName", paramaters={"value=order.techFirstName",
"clientId=techFirstName"}
private TextField techFirstName;
According to firebug the html generated is
It's strange becaus
Em Mon, 05 Oct 2009 09:56:07 -0300, Toby Hobson
escreveu:
Hello Everyone
Hi!
Does anyone know what is the best way to get a clientId for an element
which is rendered via Ajax?
In this case, provide the ids yourself.
--
Thiago H. de Paula Figueiredo
Independent Java consultant, develop
Thanks again ... I'll try that approach
2009/10/5 cordenier christophe
> Hi
> As you have clearlay said id, the problem is to generate javascript
> initialization code once everything is rendered. I think that the
> AfterRender of the main page is not called in an Zone refresh. Only the
> block
Hi
As you have clearlay said id, the problem is to generate javascript
initialization code once everything is rendered. I think that the
AfterRender of the main page is not called in an Zone refresh. Only the
block is rendered.
Replacing the block by a 'component' will allow you to implement such
Sorry to clarify ...
"I guess the problem is that the textField is nested in a block which is
rendered using AJAX so although the page has completed it's rendering the
textField has not yet being rendered therefore it doesn't have a clientId?"
2009/10/5 Toby Hobson
> Hi Christophe
>
> Unfortuna
Hi Christophe
Unfortunately this doesn't seem to work, although maybe I have missed
something. For example
@Component
private TextField techFirstName;
void afterRender() {
logger.debug("techFirstName clientId: " + techFirstName.getClientId());
}
[DEBUG] pages.Order techFirstName clientId: nul
Hello
You'd better use a RenderSupport and @AfterRender to create a javascript
method call that will link your checkbox with the copyDetails() method.
Something like this, i guess :
In a separate JS file injected via @IncludeJavascript
copyDetails : function(techFirstId) {
}
linkDetails:
Hello Everyone
It's about 12 months since I used Tapestry but its good to be back :-) I'm
currently writing an Ajax based order form for a client but I've hit a
little problem. Basically I have a series of blocks which are used to
represent 'pages' in the order form i.e. I have a block for product
14 matches
Mail list logo