[aida] Problems with onChangePostAndUpdate

Herbert König herbertkoenig at gmx.net
Mon Jun 15 22:22:02 CEST 2009


Hi Janko,

JM> I would start inspecting this problem by extending the existing calendar
JM> demo in Aida (WebDemoApp>>viewCalendar). Then we'll have sthe ame base
JM> to inspect it together.

ok let me do it in steps and write it down while I do it.
.... an hour with lots of head scratching ....
Well no, this gave me a headache as I couldn't reproduce it until I
noticed I had to change the month in the calendar by a click on the <.


So finally the steps:

1- Make the calendar into a component:
viewCalendarComponent
        | e |
        e := WebElement new.
        e addDateInputFieldAspect: #date for: self observee.
        e addBreak.
        ^e

and use it:

viewCalendar
        | e |
        e := WebElement new.
        e addTextH1: #en->'Date input with Javascript Calendar example'.
        e addBreak.
        e add: self viewCalendarComponent .
        self pageFrameWith: e title: 'Calendar example'

Everything keeps working.

2- stick the WebDateInputField into a local variable so we can send it
messages later on.
viewCalendarComponent
        | e startDate |
        e := WebElement new.
        startDate :=  WebDateInputField new aspect: #date for: self observee.
        e add: startDate. 
        e addBreak; newRow.
        ^e

All ok.

3- Now make the calendar update the component.
viewCalendarComponent
        | e startDate |
        e := WebElement new.
        startDate := WebDateInputField new aspect: #date for: self observee.
        e add: startDate.
        e addBreak; newRow.
        e registerId.
        startDate onChangePostAndUpdate: e id.
        ^e

In this case everything seems fine unless you change the month by
using < or >.

Then case the calendar just doesn't vanish and you have to refresh the
page.

BTW it first worked when sending ..andUpdate e instead of ..andUpdate e id.

Now I can't reproduce that.
        
Cheers,

Herbert                            mailto:herbertkoenig at gmx.net



More information about the Aida mailing list