You are a patient man Jim.

Dave

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Jim Preston
Sent: Tuesday, August 08, 2000 6:04 PM
To: [EMAIL PROTECTED]
Subject: Re: in JSP: Call a method of a Bean when button is clicked


Is there a solar storm or something that's causing all these
Java-from-JavaScript questions all at once?

Marcel, you haven't been reading the list very carefully the last few days,
have you? I've addressed this question in slightly different forms no less
than three times in the last week. The OnClick handler is JavaScript, living
on the browser, being called by the browser when the user clicks the button.
The "<% . . . %>" is a JSP scriptlet tag that gets executed ON THE SERVER
when the page is being served. The call to ReserveBean1.reserveChairs()
happens ON THE SERVER when the page is being served. The result of that call
gets put into the text that's being sent out to the browser. Later, in a
completely different environment, when the user clicks the button, the
browser executes the JavaScript for the OnClick handler, which is going to
be the string value of whatever your reserveChairs method returned and
almost certainly isn't going to be meaningful in JavaScript. Do a "view
source" on that page from the browser and you'll see.

Ok, I'm done with this subject. If no one else takes up the mantle, people
who don't get it will be on their own.

--Jim Preston


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Marcel van Kooy
Sent: Tuesday, August 08, 2000 5:22 AM
To: [EMAIL PROTECTED]
Subject: in JSP: Call a method of a Bean when button is clicked


Hi all,

Can please somebody help me with the following problem?

I want to call a method of a JavaBean when a button is clicked. What is
the syntax of this?
The following code I made is not working:

TD VALIGN=TOP WIDTH=102><INPUT TYPE=Button  ID="DBStyleReserveerButton"
NAME="ReserveerButton" value="Reserveer"  Class="ArialBlackButtons11"
tabIndex="0"></TD>
<DEFANGED_SCRIPT FOR="ReserveerButton" EVENT="DEFANGED_OnClick" <%
ReserveBean1.reserveChairs() %>;</script>

Best regards,
Marcel van Kooy

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

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

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

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

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

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to