You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kent Boogaart <ke...@internode.on.net> on 2005/07/07 06:50:17 UTC

Question re html:select on the client

Hello,

I have an html:select populated from a collection. Alongside the select box
I have links to add, edit and delete items. I'm just wondering what the best
way is to handle passing the ID of the selected item to the edit and delete
actions.

For example, if the user selects the option with value 12, I'd like to
forward to something like "/editAction?id=12". Is there some way to tell the
html:link tag to dynamically construct the querystring on the client?

Thanks,
Kent


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Question re html:select on the client

Posted by Nitesh Naveen <ni...@cordiant.net>.
You could use JavaScript to submit the form on clicking the link.
Have a hidden field to track which link is clicked.

For e.g.. Use this function in the link...

function clickLink(linkId)
{
	document.formName.hiddenElementName.value=linkId;
	document.formName.submit();
}

PS: you need to make sure there are no fields in your form with the name -
submit

HTH,
 
Nitesh
_____________________________

Disclaimer: 
Information contained and transmitted by this e-mail is confidential,
proprietary, and legally privileged data of Cordiant Technologies that is
intended for use only by the addressee. If you are not the intended
recipient, you are notified that any dissemination, distribution, or copying
of this e-mail is strictly prohibited and you are requested to delete this
e-mail immediately and notify the originator. Any views expressed by an
individual do not necessarily reflect the view of Cordiant Technologies. The
recipient should scan this email and any attachments for viruses as Cordiant
Technologies is not liable for the presence of viruses in this email.
Cordiant Technologies does not accept liability for any errors or omissions
as the internet communications cannot be guaranteed to be timely, secure,
error or virus-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete. 

To know more about Cordiant Technologies, please visit
http://www.cordiant.com

_____________________________


-----Original Message-----
From: Kent Boogaart [mailto:kentcb@internode.on.net] 
Sent: Thursday, July 07, 2005 10:20 AM
To: user@struts.apache.org
Subject: Question re html:select on the client


Hello,

I have an html:select populated from a collection. Alongside the select box
I have links to add, edit and delete items. I'm just wondering what the best
way is to handle passing the ID of the selected item to the edit and delete
actions.

For example, if the user selects the option with value 12, I'd like to
forward to something like "/editAction?id=12". Is there some way to tell the
html:link tag to dynamically construct the querystring on the client?

Thanks,
Kent


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org