Well, actually I works excellent!

I have it like this in my template now:

<span jwcid="loopContacts">
    <tr id="ognl:'contact_'+currentContact.contactId" jwcid="@Any"
renderTag="true">
       ...
    </tr>
</span>

(loopContacts is of type For)
and on every row I have edit button which swithes current contact from
display to edit form.
So on edit linkbutton I have this:

<binding name="async" value="true" />
<binding name="updateComponents"
value="ognl:'contact_'+currentContact.contactId"></binding>

and the same on submit/save button.
Result is very neat AJAX style table with editable rows without reload of
page :)




On 7/6/07, Marcus Schulte <[EMAIL PROTECTED]> wrote:

Yes, you should be able to define any attribute (=informal parameter) in
the
template, in the spec or in annotated Java. In some components, however,
id
is a reserved parameter, because the component insists on generating it
itself.

But I think even if you had your data-id in the client-side element-id,
your
problem of updating only one "rendering" of a component in a @For would
not
be solved.

One approach would be to make your loopContacts component a JSON-Component
like it's described here:
http://tapestry.apache.org/tapestry4.1/ajax/json.html .

2007/7/6, Malin Ljungh <[EMAIL PROTECTED]>:
>
> OK, it does NOT work to have the ognl id in the page-file.
> Not that it's important - but ... am I correct?
>
> I thought everything could be done either way.
>
>
> On 7/6/07, Malin Ljungh <[EMAIL PROTECTED]> wrote:
> >
> > Andreas!
> >
> > That was EXACTLY what I was looking for!!! Thanks!!!
> > (And thank you Marcus too, I'll to refresh the whole loop if this
> doesn't
> > work out)
> >
> > Actually I started with something like this but I normally use just
> jwcid
> > in my .html file and have everything else in the page-specification
> (.page
> > file) but it seemed so weird to have ognl in the jwcid in the .html
file
> > that I didn't even test it... would it work? I guess I should just
> try...
> >
> > Thanks again! *happy*
> >
> > /Malin - I'm a she btw ;)
> >
> >
> >
> > On 7/6/07, Andreas Andreou <[EMAIL PROTECTED] > wrote:
> > >
> > > But he can set the id parameter to whatever he likes, i.e.
> > > <span jwcid="@MyComponent" id="ognl:'data_'+currentId">data</span>
> > >
> > > On 7/6/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > >
> > > > As there are no dynamic component instances in Tapestry, there are
> no
> > > > dynamic component-ids. What you are seeing (loopContacts_i, i=1
...)
> > > are
> > > > multiple clientId's (Element id's on the client side) rendere by
one
> > > and
> > > > the same component instance, whose id, the component-id on the
> server,
> > >
> > > > is "loopContacts". So, tapestry wouldn't recognise loopContact_0
as
> a
> > > > valid component-id anyway.
> > > >
> > > > So, I'd just try to refresh "loopContacts" and see whether the
> > > overhead
> > > > of refreshing all instances really hurts.
> > > >
> > > > > -----Original Message-----
> > > > > From: Malin Ljungh [mailto:[EMAIL PROTECTED]
> > > > > Sent: Friday, July 06, 2007 9:03 AM
> > > > > To: Tapestry users
> > > > > Subject: T4: Can I have dynamic component id or how do I solve
> this?
> > > > >
> > > > > I have a loop - a component of type="For", displaying contacts.
> > > > > I'd like to have a component inside the loop with component
> > > > > id equals something with the database key in it, the contact
> > > > > ID. Is that possible?
> > > > >
> > > > > Or is there a smarter way to solve my issue?
> > > > > The reason I want it this way is that I want to use it in
> > > > > updateComponents with async="true". Then I could set
> > > > > updateComponents to the desired contact ID that I want to
> > > > > update on the client.
> > > > >
> > > > > All I have now is loopContacts, loopContacts_0,
> > > > > loopContacts_1 and so on, but I don't know which contact is
> which...
> > > > >
> > > > > Hope someone understood something... :)
> > > > > Any input appreciated!!!
> > > > >
> > > > > Malin
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
> > > Tapestry / Tacos developer
> > > Open Source / JEE Consulting
> > >
> >
> >
>



--
Marcus Schulte
http://marcus-schulte.blogspot.com

Reply via email to