Hi Nick,
I'm having a problem with widget updates, I wonder if you can help?
I have a widget that drives a modal pop-up made with bootstrap. The widget has an event that does something like this:
message :info, 'some text'
render :state => :new
"message" is a method that adds a nested "message" widget within a
"messages" widget. The "message" widget displays a flash-like message. The "messages" widget tree is on the page in two
places - the main page and in the modal pop-up. The messages appear in
both places.
It works as expected with the code as above in the event. However, if I
don't do the "render", the new message only appears on the main page but
not in the modal.
I don't understand why I need the render. I only added it to see if it
would make the message appear in the modal (which it did), but I didn't
need to do anything extra for it to appear on the page. So, why the difference?
Furthermore, if I do anything else after the render then the message
doesn't appear in the modal even with the render in place. I mean
anything, even a simple variable assignment "x=nil' breaks it.
I do need to write something after the render call, so I'd like to understand what's going on here.
Cheers,
John