[fpc-devel] fcl-web webdata ExtJS "total" field question

Michael Van Canneyt michael at freepascal.org
Fri Aug 20 10:57:16 CEST 2010

On Fri, 20 Aug 2010, ABorka wrote:

> ...snip...
>>>> I will add an 'AfterFormatResult' or so event; Likewise I will add a
>>>> AfterRow event, so it is possible to append extra data to a row. I think
>>>> we should do this for both XML and JSON, so the row/response elements
>>>> can easily be accessed. The question is now, a) do I make this a
>>>> TNotifyEvent, and make a Property Response/CurrentRow which can be used
>>>> or b) do I pass Response/CurrentRow to a new event handler type for
>>>> these events ?
>>>> Doing a) means I can introduce it at a higher level, but b) seems more
>>>> clean.
>>>> Michael.
>>> Sounds good. For me personally, it does not matter either way, just
>>> need to make this work :) . If we can intercept/access these
>>> row/response elements in an easy way, I'm happy.
>> I implemented b), see revision 15859.
>> I also now add a 'rows' property to the error response object, so the
>> ExtJS exception handling will work with 'remote'.
>> I'm still doubting to implement an OnErrorResponse event. It may be useful
>> for logging purposes, or to change the reported error, since there is no
>> way
>> to intercept that currently. What do you think ?
>> Michael.
> I will check it in the morning to see if I can change/update the "total" 
> field, definitely.
> Some kind of built-in error response possibility would be nice too. Right now 
> I'm hard coding things like
> Response.Content := '{ "success" : false, "message" : "' + MyErrMsg + '"}';
> when there was an exception in my code or incorrect user entry was passed 
> from the client, etc.

Exceptions are usually caught and transformed to the correct response.
I coded an event that allows to influence this process.


More information about the fpc-devel mailing list