RE: Link Edit/Delete
Hi, I am developing a page which shows multiple records. I am using multibox control to enable the user to select multiple records he/she wants to delete and providing links to each record , so user can click the link and go to the edit page for that record. I would like to call JavaScript method under the href property and pass id for the record as an argument. The JavaScript method will call the editable page for the record by calling the window.showModalDialogBox method. I have a problem passing the Id for the record the to JavaScript method (upItem). I appreciate your help. following is the code I have written. table logic:iterate id=objActivities name=groupActivityForm property=activities indexId=index tr style=background:#FF; td align=center valign=top html:multibox name=groupActivityForm property=activityIds bean:write name=objActivities property=actId/ /html:multibox /td td align=left valign=top class=tablelist style=margin-left:0.2in; bean:write name=objActivities property=actId/ /td td align=left valign=top class=tablelist style=margin-left:0.2in; html:link href=javascript:upItem(bean:write name=\'objActivities\' property=\'actId\'/) bean:write name=objActivities property=actName/ /html:link /td /tr /logic:iterate /table Thanks Sarveswara Rao -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Link Edit/Delete
Thanks Ted, Would you recommand for each JSP call to have an associated PreJspAction that forwards control to that JSP? Cheers, Antoine - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, January 06, 2002 5:41 AM Subject: Re: Link Edit/Delete Antoine Gibson wrote: Hello, I am trying to find a nice/easy way from a list (table) to edit or delete an element of the list. I looked at the LinkSubscriptionTag in the struts-example (I'm new to Struts) I am a bit confused. I have a list of users (userID, userFirstName, userLastName) I would like to edit/delete a user from that list: So I create: a LinkUserTag: responsible for creating a URI with a userID parameter an EditUserForm: an EditUserAction: responsible for updating/creating a user. What class is responsible for retrieving User Detail (address, job etc...) from the selected userID? Usually, it is a business tier class (that you write) which is called from an Action. What class is responsible for creating an instance of EditUserForm and populate it with the retrieved user detail? If the ActionForm is specified in the ActionMapping in the Struts config, then the ActionSerlvet will create it, and pass it along to the Action. The Action can the populate it, and forward control to a JSP. The JSP can then write the values from the form bean stored in the request. Thanks in advance. Antoine -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Link Edit/Delete
Antoine Gibson wrote: Hello, I am trying to find a nice/easy way from a list (table) to edit or delete an element of the list. I looked at the LinkSubscriptionTag in the struts-example (I'm new to Struts) I am a bit confused. I have a list of users (userID, userFirstName, userLastName) I would like to edit/delete a user from that list: So I create: a LinkUserTag: responsible for creating a URI with a userID parameter an EditUserForm: an EditUserAction: responsible for updating/creating a user. What class is responsible for retrieving User Detail (address, job etc...) from the selected userID? Usually, it is a business tier class (that you write) which is called from an Action. What class is responsible for creating an instance of EditUserForm and populate it with the retrieved user detail? If the ActionForm is specified in the ActionMapping in the Struts config, then the ActionSerlvet will create it, and pass it along to the Action. The Action can the populate it, and forward control to a JSP. The JSP can then write the values from the form bean stored in the request. Thanks in advance. Antoine -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]