[Gambas-user] gb.web.form: Preserve state of dialog window

Benoît Minisini gambas at ...1...
Sun Nov 13 18:32:29 CET 2016


Le 13/11/2016 à 17:02, Tobias Boege a écrit :
> On Sun, 13 Nov 2016, Benoît Minisini wrote:
>> Le 13/11/2016 à 16:11, Benoît Minisini a écrit :
>>>
>>> I found another bug: the static instance is not correctly kept between
>>> requests.
>>>
>>> At each request, all GUI object are re-created. But when one of them is
>>> an automatic static instance, it is recreated as a normal instance.
>>>
>>> Regards,
>>>
>>
>> Does it work now for you with revision #7969?
>>
>
> The window is persistent now. Thanks. But if I have a custom property like
> the Opened As Boolean in the example I attached previously, will it be
> preserved, too? That seems not to be the case currently (even if I make
> it a Read/Write property).
>
> Of course, I don't need that specific property anymore now, but will other
> properties added to a Webform class be restored? Since the Tag property is
> preserved, I can also use that for any additional data, I guess.
>
> Regards,
> Tobi
>

You must store the property in the session, and this is not automatic.

In the property write method, do that:

Me._SetProperty("<property name>", value)

Of course, this is not meant to be used outside of 'gb.web.form' at the 
moment!

The _SetProperty() method store the value and the name of the property 
in the session. And that value is automatically restored when objects 
are re-created when a new request is handled.

Regards,

-- 
Benoît Minisini




More information about the User mailing list