Also, I'm coupling this with Tacos 4 beta 3.   Can that have any bearing on
how the name is being generated?

I think the inference I'm coming to is that if a TextField is embedded in a
custom component the text field name is not "influenced" by the name of the
custom component.

Could someone please validate.

On 9/11/06, Karthik N <[EMAIL PROTECTED]> wrote:

Hi,

I am using 4.0.2

It shows the id of the caller component for <span jwcid="@Insert"
value="ognl:id"/>. So id is always got from the enclosing component even
though name isn't.

TextField.jwc has
  <parameter name="id" property="idParameter" default-value="id"/>

which means that the id parameter actually gets bound to the idParameter
property, and not to the id property.  That's why the ids come out fine.


Tracing some of the sources it appears that:

AbstractFormComponent.java:

method: protected void renderComponent
has this line:         setName(form);

This ends up on: form.getElementId (this);

Which in turn calls:         return _formSupport.getElementId(component,
component.getId());

So it all hinges on how component.setId() happens.

This component.setId () seems to happen in

PageLoader.java:
constructComponent which calls instantiateComponent which does a
result.setId(id);


constructComponent uses containerSpec to get the id.

This id seems to come from the jwcid.

Thanks, Karthik

On 9/11/06, andyhot <[EMAIL PROTECTED] > wrote:
>
> Is this for Tap4.1 ?
> name is a reserved parameter for TextField... there's no way to set it
> yourself.
>
> However, it's supposed to take its value from the id, so i would expect
> it to work
> as you describe...
>
> What's the output when CustomComponent.html  is
> <input jwcid="textField"></input> <span jwcid="@Insert"
> value="ognl:id"/>
>
>
>
> Karthik N wrote:
> > Hi,
> >
> > I have a scenario in which a custom component "wraps" a TextField
> > component.
> >
> > CustomComponent.html
> >
> > <input jwcid="textField"></input>
> >
> > CustomComponent.jwc textfield snippet:
> >
> >    <component id="textField" type="TextField"
> > inherit-informal-parameters="yes">
> >        <binding name="id" value="id"/>
> >        <binding name="name" value="name"/>
> >        <binding name="displayName" value="displayName"/>
> >        <binding name="value" value="value"/>
> >        <binding name="onKeyPress" value="keyPressHandler"/>
> >        <binding name="validators" value="validators"/>
> >        <binding name="disabled" value="disabled"/>
> >    </component>
> >
> >
> > Page configuration of CustomComponent:
> >
> > <input type="text"  jwcid="[EMAIL PROTECTED]" />
> >
> > i find that the underlying TextField id honors the telNo2 prefix for
> the
> > jwcid, but the name parameter of the TextField looks like textfield_xx
> >
> > my requirement is that i want the name parameter of the underlying
> > textfield
> > to be like telNo2_xx
> >
> > Any help will be most appreciated!
> >
>
>
> --
> Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / J2EE Consulting
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Thanks, Karthik

Reply via email to