Le mardi 7 septembre 2010 15:40:45, ZuLuuuuuu a écrit :
> Hello,
>
> In a widget, if I have a form with input elements, after I show a
> lightbox via #lightbox: message, the contents of the input elements
> are reset. By reset I mean their value becomes empty if I have not set
> any value via #value: at the beginning, and if I have set them to some
> value at the beginning and modify them when the page is shown it
> becomes the initial value after I show a lightbox. How can I avoid
> this behaviour?
This is because when you show the lightbox, it adds a delegator to the widget
, so it is marked dirty.
The simplest hack is probably to add an hidden widget which will be
responsible for showing theee lightbox.
hiddenWidget [
^hiddenWidget ifNil: [hiddenWidget := self widgetFor: [:e |]]
]
contents [
^[:e |
e build: self hiddenWidget.
e a action: [self showLightbox: MyWidget new]]
]
showLightbox: aWidget [
self hiddenWidget lightbox: aWidget
]
In some apps, I even add such a widget in the application directly, then all
lightboxes are displayed through this widget.
Cheers,
Nico
--
Nicolas Petton
http://www.objectfusion.frObjectfusion S.A.R.L.
Applications web - Design