Thanks Satyam..this info is of great great
help….one last question..based on the replyCode I am trying to paginate
or stop the user from pagination….i tried putting DataTable.handleDataSourcePagination(state,dt)……but
this doesnot seem to work…can u please suggest something for this….
From: ydn-javascript@yahoogroups.com
[mailto:ydn-javascript@yahoogroups.com] On
Behalf Of Satyam
Sent: Thursday, May 22, 2008 11:22
PM
To: ydn-javascript@yahoogroups.com
Subject: Re: [ydn-javascript] Re:
Problem with refresh page and paginator
Now I see that part of the article got outdated. Do
you actually need to
issue the call to the Connection Manager yourself? The DataSource is quite
capable of doing so, as I've shown in the article. Then, as shown in the
article, you override DataSource method doBeforeCallback
myDataSource.
oParsedResponse) {
if (oRawResponse.
alert(oRawResponse.
}
return oParsedResponse;
};
What is outdated is that since 2.5, oRawResponse is already parsed and is a
plain JavaScript object so you no longer need that eval there. See:
http://developer.
You can also use:
myDataSource.
if (oRawResponse.
alert(oRawResponse.
}
return oRawResponse;
};
In either one, if the reply has not good data, it will show the No Records
sign after you have acknoledged the alert(). You can also change this:
myDataSource.
oParsedResponse) {
if (oRawResponse.
alert(oRawResponse.
oParsedResponse.
}
return oParsedResponse;
};
Satyam
----- Original Message -----
From: "rashmeep2000" <RPrasad2@ketera.
To: <ydn-javascript@
Sent: Thursday, May 22, 2008 7:02 PM
Subject: [ydn-javascript] Re: Problem with refresh page and paginator
> Satyam,
> In server side i ahve populated, replyCode:218 and replyText:"finally
> i can see error messages"
>
> in client side, i am accessing it as,
> YAHOO.util.Connect.
> success : function (o) {
> DataTable.handleDat
> },
> failure: function (o) {
> alert(o.replyCode)
> },
>
> scope : this
> }, params);
>
> but in case of failure i want my message to be shown, but it says
> undefined. I want to show my custom message which i populate in my
> server side, which i am not able to do...Please help.......let me
> know if i am making any mistake...
>
> --- In ydn-javascript@
>>
>> The idea of sending status plus data in a JSON message was
> presented in:
>>
>> client side: http://yuiblog.
>>
>> server side (php): http://www.satyam.
>>
>> That covers both ends of it in good detail.
>>
>> Satyam
>>
>>
>>
>> ----- Original Message -----
>> From: "rashmeep2000" <RPrasad2@..
>> To: <ydn-javascript@
>> Sent: Thursday, May 22, 2008 11:27 AM
>> Subject: [ydn-javascript] Re: Problem with refresh page and
> paginator
>>
>>
>> > Hi Satyam,
>> > SOrry i am not able to get how to do this..can u please give some
>> > sample code on both server and client side..i tried doing but not
>> > able to get it rite....
>> >
>> > Luke,
>> > I also tried what u said but it seems to be giving js error, not
> able
>> > to understand y...can u pls..wat can be done...
>> >
>> > thanks.
>> >
>> > --- In ydn-javascript@
>> >>
>> >> The problem is that you have to be carefull which non-200
status
>> > codes you
>> >> use. Some have side effects either on the browser or the
>> > intermediate
>> >> proxies, others can be generated automatically by the
> communication
>> > and/or
>> >> web server and your application might think they came from
the
>> > application.
>> >>
>> >> It is better to keep HTTP-related status codes to report HTTP
>> > errors
>> >> (usually generated by your web server or at any point by the
>> > communication
>> >> infrastructure) and use your own application-
>> > data wihin
>> >> the HTTP transport. Otherwise, some communication code which
> just
>> > happens
>> >> to have the same number as one of your custom codes, might be
>> > generated by,
>> >> say, an intermediate proxy, and you might think it comes from
> your
>> >> application. Or a browser too smart for its own good might
>> > overreact upon a
>> >> missunderstood application code which matched some HTTP code.
>> >>
>> >> Admitedly, most status codes are unused, you should be quite
safe
>> > with the
>> >> 90% of the codes still unassigned, but you can't count on
that.
>> > Even some
>> >> firewall or any other anti-virus/anti-
>> > might
>> >> think the HTTP message with a custom status code bogus and
> discard
>> > it.
>> >>
>> >> Satyam
>> >>
>> >>
>> >>
>> >> ----- Original Message -----
>> >> From: "y_lsmith" <lsmith@>
>> >> To: <ydn-javascript@
>> >> Sent: Wednesday, May 21, 2008 8:18 PM
>> >> Subject: [ydn-javascript] Re: Problem with refresh page and
>> > paginator
>> >>
>> >>
>> >> > If the server is responding with a non-200 status or the
>> > DataSource
>> >> > parse indicates an error, you can also direct these
responses
> to a
>> >> > different response handler in the DataSource's
sendRequest
>> > callback.
>> >> >
>> >> > var myFailedRequestHand
>> > oPayload) {
>> >> > /* do something different */
>> >> > };
>> >> >
>> >> > myDataSource.
>> >> > success : myDataTable.
>> >> > failure : myFailedRequestHand
>> >> > scope : myDataTable
>> >> > });
>> >> >
>> >> > Luke
>> >> >
>> >> > --- In ydn-javascript@
> wrote:
>> >> >>
>> >> >> Sorry the URLs should have pointed to:
>> >> >>
>> >> >> http://satyam.
>> >> >>
>> >> >> Satyam
>> >> >>
>> >> >> ----- Original Message -----
>> >> >> From: "traderashish" <traderashish@
>> >> >> To: "Satyam" <satyam@>
>> >> >> Sent: Wednesday, May 21, 2008 10:09 AM
>> >> >> Subject: Re: Problem with refresh page and paginator
>> >> >>
>> >> >>
>> >> >> >
>> >> >> > url for the examples points to local host.
>> >> >> >
>> >> >> > --- In ydn-javascript@
>> > wrote:
>> >> >> >>
>> >> >> >> That's exactly where meta-data comes in
handy and why it is
>> >> > better to use
>> >> >> >> some rich message format like JSON or XML
which can carry
>> > meta-data
>> >> >> >> besides
>> >> >> >> the plain data.
>> >> >> >>
>> >> >> >> What you do is you put server status
information in a
> branch
>> > in your
>> >> >> >> return
>> >> >> >> message and the data in another. Before
2.5, you had to
>> > override
>> >> >> >> doBeforeParseData to extract that meta
information. Now,
> the
>> >> > DataSource
>> >> >> >> takes a metaFields definition and extracts
them for you
> (see
>> > the
>> >> >> >> DataTable
>> >> >> >> docs towards the end). The DataTable
already has some use
>> > for some
>> >> >> >> properties from the meta-data, specially
when doing server-
>> > side
>> >> >> >> pagination,
>> >> >> >> but you are free to use other property
names for whatever
> else
>> >> > you want.
>> >> >> >>
>> >> >> >> I wrote an article
> (http://localhost/
>> >> > which uses
>> >> >> >> PHP
>> >> >> >> set_error_handler function to trap PHP
errors of whatever
>> > nature,
>> >> > and
>> >> >> >> pack
>> >> >> >> them into the reply message:
>> >> >> >> http://localhost/
>> >> >> >>
>> >> >> >> Satyam
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> ----- Original Message -----
>> >> >> >> From: "rashmeep2000"
<RPrasad2@>
>> >> >> >> To: <ydn-javascript@
>> >> >> >> Sent: Tuesday, May 20, 2008 7:45 PM
>> >> >> >> Subject: [ydn-javascript] Problem with
refresh page and
>> > paginator
>> >> >> >>
>> >> >> >>
>> >> >> >> > hi all,
>> >> >> >> > after inlin edit,when user paginates,
i am doing,
>> >> >> >> >
>> >> >> >> > myDataSource.
>> >> >> >> > myDataTable.
>> >> >> >> > i do backend validation, if thre are
any validation
> errors,
>> > i throw
>> >> >> >> > those errors(i throw an exception)..
>> >> >> >> > 1.to identify somehow that an
exception was thrown
>> >> >> >> > 2.display those error messages to user
>> >> >> >> > 3.stop user from pagination.
>> >> >> >> >
>> >> >> >> > i tried writing my own handler in
paginationEventHand
>> > but i
>> >> > am not
>> >> >> >> > able to know if any exception was
thrown from backend
> (even
>> >> > though it
>> >> >> >> > was thrown)...can somebody please tell
me how this can be
>> > achieved.
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > ------------
>> >> >> >> >
>> >> >> >> > Yahoo! Groups Links
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >>
>> >> >> >>
>> >> >> >> ------------
> ---
>> > -----
>> >> >> > ------------
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> No virus found in this incoming message.
>> >> >> >> Checked by AVG.
>> >> >> >> Version: 8.0.100 / Virus Database:
269.23.21/1456 - Release
>> > Date:
>> >> >> >> 20/05/2008
>> >> >> >> 6:45
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> > ------------
> ---
>> > ------------
>> >> >>
>> >> >>
>> >> >>
>> >> >> No virus found in this incoming message.
>> >> >> Checked by AVG.
>> >> >> Version: 8.0.100 / Virus Database: 269.23.21/1456 -
Release
> Date:
>> >> > 20/05/2008
>> >> >> 6:45
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > ------------
>> >> >
>> >> > Yahoo! Groups Links
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >> ------------
> ---
>> > ------------
>> >>
>> >>
>> >>
>> >> No virus found in this incoming message.
>> >> Checked by AVG.
>> >> Version: 8.0.100 / Virus Database: 269.23.21/1456 - Release
Date:
>> > 20/05/2008
>> >> 6:45
>> >>
>> >
>> >
>> >
>> > ------------
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>>
>>
>> ------------
> ------------
>>
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG.
>> Version: 8.0.100 / Virus Database: 269.24.0/1459 - Release Date:
> 21/05/2008
>> 17:34
>>
>
>
>
> ------------
>
> Yahoo! Groups Links
>
>
>
------------
No virus found in this incoming message.
Checked by AVG.
Version: 8.0.100 / Virus Database: 269.24.0/1459 - Release Date: 21/05/2008
17:34