durusmail: quixote-users: How to add/remove widgets dynamically?
How to add/remove widgets dynamically?
2003-07-22
How to add/remove widgets dynamically?
Joao Pedro Pedroso
2003-07-22
Hello,

I have tried to use quixote for some simple applications, till now
without success...

What I would like to do is to create a form -- e.g., a selection box
with user names.  Then, add three buttons: Add/Change/Remove

If the user presses:
* Add -> I would like to add a String widget for inserting a new name;
* Change -> the same, with the previous name a the initial 'value';
* Delete -> delete the selected name

I am trying to manage this in the 'process()' member of class derived
from 'Form', adding the new widgets there.  I did not have success,
even though I tried many different possibilities...  After adding new
'submit' buttons in 'process', the next call to this function leads to
empty strings on the 'submit_button', and then redirects to
__init__...

Is there any straight-forward way of doing this with quixote?
I also thought of using hidden fields, as in normal cgi's, but I don't
know how to use them for sending information to a different 'Form'
class.

Any help would be much appreciated.
Thanks,

Pedro
--
Joao Pedro PEDROSO               jpp@ncc.up.pt
Faculdade de Ciencias da Universidade do Porto
   Departamento de Ciencia de Computadores
R. Campo Alegre 823, 4150-180 Porto,  Portugal
Tel: (+351)226.078.830  Fax: (+351)226.003.654

reply