[Zope] Re: Two buttons one method -

Florent Guillaume fg@nuxeo.com
13 May 2002 19:53:17 +0200


Hi,

- Why are you sending this to me? I'm not the one who has a problem.

- Please don't send HTML mails.

- Please keep the subject so that we can find the thread you're
responding to.

- Your first method isn't always applicable, it's not always possible to
split the form in two.

- Your second method doesn't work.

Florent

On Mon, 2002-05-13 at 19:00, Gary Speer wrote:
> Don't understand why you didn't get a helpful response.
> 
> Sounds like you are trying to pass a variable.  I'm a bit new at Zope so there may be more elegant means.  
> You can define the value of the variable in the request.  Wrap the button in a form with hidden elements that have your variable name and value.  The method will obtain the variables by acquisition.  
> 
> <form method="post" action=<dtml-var mymethod>>
> <input type="hidden" name="passedvariable" value="onevalue">
> <input type="submit" name="button1" value="SendWithFirstValue">
> </form>
> 
> ...
> 
> <form method="post" action=<dtml-var mymethod>>
> <input type="hidden" name="passedvariable" value="anothervalue">
> <input type="submit" name="button2" value="SendWithSecondValue">
> </form>
> 
> in the method, passedvariable will have the respective string.
> 
> Another is to define a global variable
> 
> <dtml-define passedvariable="global onevalue">
> <a href="mymethod" img="firstbutton.gif"></a>
> 
> ...
> 
> <dtml-let passedvariable="secondvalue">
> <a href="mymethod" img="secondbutton.gif"></a>
> 
> Hope these trigger some ideas...
> Gary
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com