Hi, A weirdness we had in our system was that the accessor called by a Magritte description raised an Error. This code is called in a callback of a button:
[ aComponent call: (MatchInvestmentPage new
instruction: self; yourself). aComponent reset ]
on: Error do: [ :err | aComponent inform: err messageText.
aComponent answer ] It tries to handle the error raised by "aComponent reset". The MatchInvestmentPage component changes the state of the model of aComponent (a magritte container component). The "aComponent reset" causes a magritte MADescription (displaying a fairly simple amount field) to call an accessor on the model, which raises the error.
We now removed this error handler and check for the error condition elsewhere. A broader question here is whether magritte descriptions should handle exceptions when reading from the model (Object >> readUsing: which calls #read: on).
Our understanding is that reading via accessors (MAAccessor descendants) should not handle exceptions and a fallback (outer) handler should handle it, because this is really unexpected. Is this right? Does anyone know what the best way is to handle this situation?
Does it make sense to handle exceptions at the description level and display a message to the user (on the field itself)? Not sure that it does, but perhaps someone have better ideas here. Thanks Otto PS. Does anyone have suggestions on nicer dialogs (the inform: call here) that perhaps uses JQuery or another mechanism? On Wed, May 21, 2014 at 10:45 AM, Otto Behrens <[hidden email]> wrote:
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Free forum by Nabble | Edit this page |