You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jesse Kuhnert <jk...@gmail.com> on 2007/02/05 05:54:45 UTC

Re: Stale link exception

Tapestry should properly update all of your newly added components in
the local hidden fields of the form. The only time you'd get into
trouble is if you were somehow trying to do this yourself. (maybe? )

On 1/27/07, RonPiterman <rp...@gmx.net> wrote:
> I would say, break the form to (probably) 3 different ones:
> one before, one after and one *the* grid.
>
> You could use a nasty approach and, when editting a row in your gread
> using the EventListener component to clear all validation problems
> recorded before. This will however not work for validation problems
> which accure *after* your row :(
> So you could implement your own validation delegate which can choose
> which problems to record and which not to...
> Cheers,
> Ron
>
>
> Andrea Chiumenti wrote:
> > Thank you for your reply!
> >
> > I've understood my mistake: it was that I set volatile to true in two
> > places
> > I didn't have to.
> >
> > Backing to the normal behavior  now I can also provide the component
> > without
> > its own form.
> > Now I have another question: How can I pervent the validation of components
> > outside the grid when I add a row ?
> >
> > kiuma
> >
> > On 1/27/07, RonPiterman <rp...@gmx.net> wrote:
> >>
> >> first, I would not in any cas try to write my own form component.
> >>
> >> So, stale links:
> >>
> >> In order for tapestry to submit a form, all form components must be
> >> rendered on submit on the same order they were rendered for the response
> >> which generated the form.
> >>
> >> to make sure this happens, tapestry records the order of the components,
> >> and if it doesn't match, generates a stale link.
> >>
> >> why doesn't it match?
> >>
> >> say you have a list of 1 object, and you iterate over it and generate an
> >> input box for each item.
> >>
> >> If when submitting, the list has suddenly 2 objects, two input boxes are
> >> rendered, one too much...
> >>
> >> to prevent this, certain approaches were taken, including the For bean,
> >> If bean ( i think...) and action listeners instead of "listener"
> >> listeners.
> >>
> >> So - when doing thing in the right order and persisting the information
> >> in the right place, stale link exceptions can be avoided - show me yours
> >> and I'll show you mine (code)...
> >>
> >> Cheers,
> >> Ron
> >>
> >>
> >>
> >>
> >>
> >> Andrea Chiumenti wrote:
> >> > Hello,
> >> > I'm using Tapestry 4.1.1 and I'm trying to update a comopnent.
> >> > This component is a grid, that in normal state hasn't any input
> >> component.
> >> > The first time i call addNew, that adds a new row with input elements
> >> all
> >> > goes well.
> >> > The next time i call this function I have a StaleLinkException.
> >> >
> >> > with this message:
> >> > Rewind of form Home/thisForm expected allocated id #9 to be
> >> 'nameField',
> >> > but
> >> > was 'addNew' (requested by component Home/tableForm.addNew).
> >> >
> >> > The call is an ajax call that updates the table containing the row.
> >> >
> >> > How can I prevent the stale link exception, how does Tapestry
> >> 4.1.1threats
> >> > stale links ?
> >> >
> >> > Thanks in advance,
> >> > kiuma
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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