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]
