On Sun, 2002-02-24 at 13:20, BA wrote:
> hello and thanks for reading this.
> i wonder the following:
> if i have a page object with two buttons on it.
> one button is 'add' and the other button is 'subtract'
> i press one of the buttons.
> what happens to the page?
> 1. nothing. pressing a button just calls the proper method.
> 2. something. the page behaves like a webform and it live ends and the
> action of the form is done.
> what i want to create is a simple calculator with webkit.
> pressing the buttons calls code in my page and it does not cause the loading
> of another page or another instance of the same page.
Well, if you want it to happen entirely on the client side you'd do it
itself, and put some code in your servlet's awake() method, like:
req = self.request()
# do calculation
self._result = calculation
self._result = None
self.write('Answer: %s <br>\n' % self._result)
<input type="hidden" name="calculate" value="yes, do">
<!-- other form elements -->
> did i make sense?
> i as a mswindows+visual basic background. in vb or delphi or many other
> products, i create a form, populate it buttons and then write code. i am
> looking for this model for web development. the webware page object seems to
> come close, am i right?
> Webware-discuss mailing list