Component ids must be unique within a template (not within an element
such as that @If).  All of these components, regardless of how they
are enclosed by each other, are all contained by the page, and must
have a unique id within the page. So just given them different ids.

On 2/15/07, Daniel Anguita O. <[EMAIL PROTECTED]> wrote:
Hi all,
I'm trying to show different components with the same id using an If
component, but when I run the app it says that i have multiple
components with the same id, so it throws exception error.

For example:

<span jwcid="@If" condition="ognl:isMale">
    <select jwcid="[EMAIL PROTECTED]" model="ognl:person"
value="ognl:person"/>
</span>
<span jwcid="@Else">
    <span jwcid="[EMAIL PROTECTED]" value="literal:notMale"/>
</span>

Why i'm trying to do this? Becouse i'm refreshing this component with
the same id with UpdateComponent from an EventListener.
In this example, if is not a Male, the user can click a button and ask
again if it's a Male, so i'll update the same component if now it's male.

The problems rather in the eventlistener, becauso if I use diferent
eventlisteners with diferents components id it will be necesary to have
both components displayed and loaded, but i want that only one will...
so i'm trying to use the same id, but tapestry doesn't let me.

Other clasic example is when i make a form with a Country and State
ListBoxs. When you select the country it calls an eventlistener that
will read from the database the States and update the state component,
but if in one country haves regions and not states, the component if
diferent (due to different objects), but you have to use the same id to
receive the information in the form.

How do I do this?! Maybe my problem is that i'm using auto-generation
dojo ajax code from tapestry with eventlistener.. so i have to make the
dojo code by myself?
Any ideas?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to