Newbie questions about Pliant

Newbie questions about Pliant

Using page buttons within a function

I'm developing a web application that is complex enough
that I need to break it into functions. Some of these
functions accept an HtmlPage argument, and want to use
a button within the function.

How do I do this properly?
Message posted by maybe Gord Eagle on 2002/12/15 01:06:33
The code that I'd expect to work (but fails) is:

title "Button test"
method p doit
  arg_rw HtmlPage p
  for (var Int i) 1 10
    p para
      p button "Here"
        p text "Got " + string:i
doit

I want clicking on each button to return a different value. Right
now, it just has an error, complaining that p cannot be serialised.

Thanks,
Gord.
Message posted by hubert.tonneau on 2002/12/15 09:30:56
Just change:

method p doit
  arg_rw HtmlPage p

to:

method page doit
  arg_rw HtmlPage page

the reason is that in a .page, 'page' is implicit, not 'p'