Hi Luca,

In general in Elisa, one UI screen == one controller.
If you need a controller to accept named parameters, these should be
passed to and handled by its initialize method.
A simple example would look like this:

    class MyController(PigmentController):

        def initialize(self, parameter):
            dfr = super(MyController, self).initialize()
            self.parameter = parameter
            return dfr

When you need to instantiate this controller passing it a parameter, you
can either do this:

    browser.history.append_controller(path, title, parameter=value)

or this:

    browser.history.append_controller(path, title, {'parameter': value})

This of course works with any number of arguments.

An introduction to keyword arguments in Python can be found at
http://www.python.org/doc/2.5.2/tut/node6.html#SECTION006720000000000000000.

I hope this helps,

Olivier


Vaudano Luca wrote:
> Hi elisians,
> 
> I want to make a plugin with different screens: a first screen with a
> form and a submit button and a second screen with the result of the
> previous submit.
> How can I pass the parameters of the first screen to the second one?
> Do I have to use two controller?
> Do I have to use a mechanism similar to activate method in the
> /elisa/plugin/poblosec/widgets/search_results.py file?
> How works this line: deferred =
> browser.history.append_controller(path, item.label, **args) ? in
> particular the third argument?
> 
> Any advice or reference is appreciated.
> Thanks in advance,
> cheers
> Luca

Reply via email to