STRUTS
----- Original Message -----
From: "Rick Snide" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 09, 2002 12:14 PM
Subject: Setting bean properties on a link with onclick


> I have a page "vendors.jsp" where (using a bean) I display a list of
vendors to choose from.  This list of vendors is a list of hyperlinks that
the user can click.  I want the user to click the link and then see the
parts that are associated with that vendor (vendorparts.jsp).  My thought
was to use the HREF=vendorparts.jsp and also use the onclick method to set
the vendor number selected in the bean for the vendorparts.jsp to know whose
parts to display.
>
> my list of links (created by my bean) has items like this for the user to
choose:
> <A  HREF=vendorparts.jsp ONCLICK="submit_onclick('0001234')">Janes
Plumbing</A>
> <A  HREF=vendorparts.jsp ONCLICK="submit_onclick('0005678')">Joes
Plumbing</A>
>
> My problem is that I don't have a good way to set the bean value
(setVendor) before the page in the link is called.  I want to accomplish it
with "xml style" setting the bean properties rather than mixing in alot of
"pure java".
>
> 1.  If  I try to use a "normal" java method, the submit_onclick method can
not be found.
> 2.  If I try to use a function instead, I apparently can not pass a value
to the function.
> 3.  I don't want to pass parms such as HREF=vendorparts.jsp?vendor=0001234
to prevent the user from looking at someone else's parts.
>
> Is there a better way to do this?
>
> Thanks in advance - and sorry for being so wordy.
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to