onChangePost Bug? Re: Refreshing the Model when using WebTabs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

onChangePost Bug? Re: Refreshing the Model when using WebTabs

Rob Rothwell
On Sun, Jun 15, 2008 at 5:56 AM, Janko Mivšek <[hidden email]> wrote:
Pretty known problem. On Aida the simplest solution is just to send #onChangePost to each of your form fields, something like:

 (e addInputFieldAspect: #name for: self person) onChangePost

Wonderful!  This [almost] worked great...!  It seems to work as advertised for WebInputField, WebDateInputField, WebTextArea, and WebMenu.  I haven't yet implemented WebRadioButton.  However, a WebCheckBox will now remember that it has been "checked," but not "unchecked" when rendered as follows:

buildEditComponentForObject: anObject on: pageElement
    pageElement cell addText: self label.
      pageElement newCell add: (WebCheckBox new aspect: self aspect for: anObject) onChangePost.

If you check an unchecked box and switch tabs and back again, it is still checked now.  But if you uncheck it and switch tabs and back again, it back to being checked.  The "unchecked" is not posted.

Maybe a bug?

On a more philosophical note, this introduces another reason why I still consider myself a Smalltalk "novice"--I was still looking for the "answer" in relation to the TABS and not the ELEMENT itself, which is the "tell the object how to do it," versus the "ask the object to do it" way.

I think my application will be fun to share soon for anyone having generic data entry needs, but I'm afraid my code is probably pretty ugly given the state of my thinking as illustrated by this simple example!


This will ensure that every field entry or change will be immediately saved to your domain model. But be careful, people can get confused if 'Save' button is remained on the form: did they save changes or not? So in that case it is better not use Save button at all. It seems that such technics is more and more common on the web and in my opinion is more natural as well.

I agree with the lack of a "Save" button.  We have a web-based reporting tool comprising of multiple applications, and as soon as you post a change in one application, the state is available in the other applications on the next refresh.

Thank you!

Rob

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida