You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nicholoz Koka Kiknadze <ki...@hotmail.com> on 2004/09/29 10:02:43 UTC

Components with same ID

Hi,

I am using contrib:Choose element to insert different components. All
possible components represent objects that implement same interface, so
further processing logic does not depend which component is actually
displayed on the page. However, I found I can not use same ID for those
components (although only one of them wold be displayed). I.e. I'd like to
have something like this:

<span jwcid="@contrib:Choose">
  <span jwcid="@contrib:When"
condition="ognl:Some_Condition_That_Checks_Which_Object_Is_Contained_in_Cont
ract_Customer">
            <input jwcid="ICustomer@Individual"
value="ognl:page.visit.contract.customer">
   </span>
   <span jwcid="@contrib:Otherwise">
        <input jwcid="ICustomer@Organization"
value="ognl:page.visit.contract.customer">
    </span>
</span>

Beeing unable to name both components with the same ID (say - ICustomer)
overcomplicates later processing - I have to 'invent' some naming logic etc.

But the real question is, am I on the correct track at all? Maybe there's
more elegant way of inserting different components for the objects that
implement same interface, or should I ask to allow components with same ID's
when only one of them is rendered?

TYA

BTW using Tapestry is fun indeed :)

Koka


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


Re: Components with same ID

Posted by Marius Siegas <in...@gmail.com>.
I think Tapestry should remove the possibility to define components
inside templates (or at least th possibility to define component
bindings). Would spare some questions/misunderstandings :). It's ugly
anyway... I don't use this "feature" anymore even though i used it for
some time when i was beginning to learn Tapestry (AFAIK this is not a
very old Tapestry feature).

On Wed, 29 Sep 2004 09:55:50 -0400, Jamie Orchard-Hays <ja...@dang.com> wrote:
> I'm not clear on what having the same name for your component gets you. If
> you need to reference it for client-side scripting, you can use id="name" to
> identify your element. If you need to process a form, the component name is
> irrelevant to the form submission. Can you give some more details about what
> you're trying to accomplish?
> 
> Are Individual and Organization custom components you have created?
> 
> Jamie
> 
> ----- Original Message -----
> From: "Nicholoz Koka Kiknadze" <ki...@hotmail.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Wednesday, September 29, 2004 4:02 AM
> Subject: Components with same ID
> 
> > Hi,
> >
> > I am using contrib:Choose element to insert different components. All
> > possible components represent objects that implement same interface, so
> > further processing logic does not depend which component is actually
> > displayed on the page. However, I found I can not use same ID for those
> > components (although only one of them wold be displayed). I.e. I'd like to
> > have something like this:
> >
> > <span jwcid="@contrib:Choose">
> >   <span jwcid="@contrib:When"
> >
> condition="ognl:Some_Condition_That_Checks_Which_Object_Is_Contained_in_Cont
> > ract_Customer">
> >             <input jwcid="ICustomer@Individual"
> > value="ognl:page.visit.contract.customer">
> >    </span>
> >    <span jwcid="@contrib:Otherwise">
> >         <input jwcid="ICustomer@Organization"
> > value="ognl:page.visit.contract.customer">
> >     </span>
> > </span>
> >
> > Beeing unable to name both components with the same ID (say - ICustomer)
> > overcomplicates later processing - I have to 'invent' some naming logic
> etc.
> >
> > But the real question is, am I on the correct track at all? Maybe there's
> > more elegant way of inserting different components for the objects that
> > implement same interface, or should I ask to allow components with same
> ID's
> > when only one of them is rendered?
> >
> > TYA
> >
> > BTW using Tapestry is fun indeed :)
> >
> > Koka

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


Re: Components with same ID

Posted by Jamie Orchard-Hays <ja...@dang.com>.
I'm not clear on what having the same name for your component gets you. If
you need to reference it for client-side scripting, you can use id="name" to
identify your element. If you need to process a form, the component name is
irrelevant to the form submission. Can you give some more details about what
you're trying to accomplish?

Are Individual and Organization custom components you have created?

Jamie



----- Original Message ----- 
From: "Nicholoz Koka Kiknadze" <ki...@hotmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, September 29, 2004 4:02 AM
Subject: Components with same ID


> Hi,
>
> I am using contrib:Choose element to insert different components. All
> possible components represent objects that implement same interface, so
> further processing logic does not depend which component is actually
> displayed on the page. However, I found I can not use same ID for those
> components (although only one of them wold be displayed). I.e. I'd like to
> have something like this:
>
> <span jwcid="@contrib:Choose">
>   <span jwcid="@contrib:When"
>
condition="ognl:Some_Condition_That_Checks_Which_Object_Is_Contained_in_Cont
> ract_Customer">
>             <input jwcid="ICustomer@Individual"
> value="ognl:page.visit.contract.customer">
>    </span>
>    <span jwcid="@contrib:Otherwise">
>         <input jwcid="ICustomer@Organization"
> value="ognl:page.visit.contract.customer">
>     </span>
> </span>
>
> Beeing unable to name both components with the same ID (say - ICustomer)
> overcomplicates later processing - I have to 'invent' some naming logic
etc.
>
> But the real question is, am I on the correct track at all? Maybe there's
> more elegant way of inserting different components for the objects that
> implement same interface, or should I ask to allow components with same
ID's
> when only one of them is rendered?
>
> TYA
>
> BTW using Tapestry is fun indeed :)
>
> Koka
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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