Hmmm... that's unfortunate. I will have to then send my object Primary Key attribut as a parameter then re-fetch it when the form comes back.
Luckily cayenne caches all of my db objects, otherwise this solution would be a real pain. I'll give it a shot and see how it goes. Cheers, Filip On 4/26/05, Patrick Casey <[EMAIL PROTECTED]> wrote: > > .net solved a similar problem with stale action links by encoding every bit > of data in the outgoing form in a hidden field (serialized into a pretty > compressed size), so they could always safely "rewind" the form when it came > back (they use a different term if I recall). They basically rewind by > deserializing their hidden "state" field, rather than by rewinding from > session attributes, which lets them come closer to true statelessness. > > Dunno if it'd be practical here, but it's definitely an alternate > approach. > > --- Pat > > -----Original Message----- > From: Jamie [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 26, 2005 9:27 AM > To: Tapestry users > Subject: Re: Stale ActionLink problem... > > Here's what Howard had to say about it a while back: > > "To be honest, I don't use ActionLink. It predates DirectLink and I > thought it would be the *way* ... but because of all the issues > concerning de-synchronized client and server state, it doesn't work for > me in practice. I've discussed removing it entirely, but some folks > still like it for initial prototyping, even though they remove it from a > production application." > > Jamie > > Filip Balas wrote: > > Thanks for the feedback. > > > > Jamie: > > ActionLinks are deprecated? > > That would be aweful!! The beauty of actionlinks > > is I don't have to serialize my objects and send > > them as part of the page. Another problem is that > > all of my objects are connected to a database via > > cayenne, I'm not sure how serialization affects > > all of that. Also, in another app my objects are > > rather large so serializing them into directlinks > > would make my webpage very large. I sincerely > > hope you are mistaken about this. > > > > mb: > > The T-Deli 'For' component should be taking care > > of the fact that my form is connected to a list of > > database objects. Here is some of the code I'm > > using: > > > > PAGE FILE: > > > > <property-specification name="newTitleString" type="java.lang.String"/> > > <property-specification name="titleDept" > > type="com.imvprojects.phoneList.data.Title_OR_Dept"/> > > > > <component id="newTitle" type="TextField"> > > <binding name="value" expression="newTitleString"/> > > </component> > > > > <component id="createNewTitleButton" type="Submit"> > > <binding name="listener" expression="listeners.createNewTitleDept"/> > > </component> > > > > <component id="titlesList" type="base:For"> > > <binding name="source" expression="getTitleDeptList()"/> > > <binding name="value" expression="titleDept"/> > > </component> > > > > <component id="title_or_dept" type="TextField"> > > <binding name="value" expression="titleDept._description"/> > > </component> > > > > <component id="saveChanges" type="ActionLink"> > > <binding name="listener" expression="listeners.saveTitleDept"/> > > </component> > > > > JAVA: > > public abstract class ManageTitles extends AuthenticatedPage { > > public abstract String getNewTitleString(); > > public abstract void setNewTitleString(String title); > > > > public abstract Title_OR_Dept getTitleDept(); > > public abstract void setTitleDept(Title_OR_Dept td); > > > > public List getTitleDeptList() > > { > > List allTitles = > > Title_OR_Dept.get_all_titles_and_departments(getVisitDataContext()); > > Collections.sort(allTitles); > > return allTitles; > > } > > > > public void createNewTitleDept(IRequestCycle cycle) > > { > > Title_OR_Dept newTitleDept = > Title_OR_Dept.create(getVisitDataContext()); > > newTitleDept.set_description(getNewTitleString()); > > getVisitDataContext().commitChanges(); > > } > > > > public void saveTitleDept(IRequestCycle cycle) > > { > > getVisitDataContext().commitChanges(); > > } > > } > > > > Here's what happens: > > The page render fine initially. > > > > I can add as many Titles/Departments as I like and the page > > will render just fine with the 'new title/department' creation part > > at the top followed by a list of existing 'titles/deparments' that > > are in editable text fields followed by a 'save' link. > > > > However, click any of the 'save' links, I recieve the exception. > > > > Thanks for your help, > > Filip > > > > > > > > On 4/26/05, Mind Bridge <[EMAIL PROTECTED]> wrote: > > > >>Hi, > >> > >>Just a suggestion given that there is no code mentioned: > >> > >>This exception usually means that the form is slightly different than > >>what was rendered originally. Do you happen to be using a Conditional > >>component somewhere in the form? Could you use the 'If" one instead? > >> > >>-mb > >> > >> > >>Filip Balas wrote: > >> > >> > >>>I am using the T-Deli 'For' component to > >>>dynamically create a list of editable items. > >>>Now the form renders fine, I can add items > >>>to it but when I try and click on any of the > >>>actionlinks which I generated to remove or > >>>save changes to the item in question, I recieve > >>>the following error: > >>> > >>>You have clicked on a stale link. > >>>Action id 1 does not match component ManageTitles/deleteTitle. > >>>This is most likely the result of using your browser's back button, > >>>but can also be an application error. > >>>You may continue by returning to the application's home page > >>></phonelist/app?service=home>. > >>> > >>> > >>>Now I've looked at TiA, googled the net and tried > >>>to find something on the mailing list but other people > >>>are having a different problem than mine. I am not having > >>>problems with the form not rendering due to inconsistencies > >>>between the number of form elements between requests > >>>(this is the problem everyone is talking about). My problem > >>>seems to be that Tapestry is having trouble figuring out > >>>which link belongs to which listener... > >>> > >>>Does anyone know where I could start looking for a solution > >>>to this? > >>> > >>>Filip > >>> > >>>--------------------------------------------------------------------- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >>> > >>> > >>> > >> > >>-- > >>No virus found in this outgoing message. > >>Checked by AVG Anti-Virus. > >>Version: 7.0.308 / Virus Database: 266.10.3 - Release Date: 4/25/2005 > >> > >> > >>--------------------------------------------------------------------- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Cell : 403.461.7895 Work: 403.770.1534 MSN: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
