« CBL Partial Updater | Main | CBL RememberMe »

CBL Partial Updater (20050922) Released!

I just released a new version of CBL Partial Updater.

In this release, I added support for spinners. By adding a spinner imae object to the HTML and specifying it in a JavaScript function call, a spinner will be displayed while AJAX requests are being processed.

Comments

thanks for releasing this. i like how simple it makes things

Hi

Does this work in xhtml stricted i get a javascript message box every time i use an event, with my pages source appearing on the javascript alert message box its a straight forward ajax insert into the database?

I suspect you are seeing an ``invalid response'' error message with the actual response (which is so long that the error message got out of screen).
One common case of seeing this message is that your application is responding to all the POST messages by redirections. You should not send location headers to AJAX requests. You can check if this is the case by looking at your server log files.

the probelm is with the parser, it was the headers causing the message box display but if you have display text with >> or > it causes an error you can see once the browser has done the request it escapes at that position so if you write your code as
echo '>" onClick="etc">';
it escapes on the >> text i looked at the html parser file and it obvoiusly looks for entities how to over come this i am not sure.

I just uploaded a new version of CBL PartialUpdater on SourceForge.

Older versions did not work correctly if there was a single-quote (') in HTML attributes.

I'm not sure this is your case or not, but it may be worth a try.

Hi,

Would it be possible for you to take a look at a templating system I have and give me advice on integrating it with CBL Partial Updater. In the same way you have integrated it with smarty templating system. Thx.

Do you mind me afterwards blogging the generalized points on how to integrating the updater to existing template systems?

If that's possible, I am happy to provide assistance. If you wish to contact me, please use this blog or send mail via SourceForge.

Kazuho,
That would be great if you generalize the integration of the updater to existing template systems and document it. It would be of great value to everyone and have more people using the updater im sure.

I have a site that I have templated using a version of the templating system used for phpbb. I would be interested in using your updater for that site. Could I sent the template to you. My email address is r_bradwell@bidudo.com

regards
Richard.

P.S. You are doing a great job of the updater!

Is it possible to submit and update multiple forms on the same page with one click?

You can update any number of HTML items (including multiple forms) at once, but cannot submit multiple forms at once.

Can you show a sample code for updating multiple forms at once? Thanks.

To update multiple HTML items at once, pass there IDs as an array to the updater.

ex:
<div id="area_1">...</div>
<div id="area_2">...</div>

CBL_PartialUpdater::display($smarty, 'index.tpl', array('area_1', 'area_2'));
# or use below if not using smarty
CBL_PartialUpdater::ob_end(array('area_1', 'area_2'));

inside

inside the div "table" listing the live searched mysql data such as id and title, how can i use CBL_PartialUpdater again to display "description" by press "title"'s content into another div ?
thx !

Include a onClick event handler in each "title"'s content, that modify's the query params of the AJAX request.

Let the server generate HTML including the appropriate "description" by the query param.

my script is as below, but it doesn't work...is there something wrong...

foreach ( $msgarray as $msg ) {
a href="msg.php?id=" onClick='CBL_PartialUpdater.update("msg.php/ajax", id,{ spinnerId:"spinner", spinnerImg:"images/spinner.gif" });return false; >msg->title

I don't see any problems in the code you posted.

Maybe there's a bug elsewhere.

can i send you the script for debug !

by the way, below is a error message will happen in one of my server, what is it stand for ?!
フォカスをコントロールに移動できません。コントロールは表示されていない、使用できない状態、またはフォーカスを受け入れない種類です。

thx

actually, the correct param setting is
a href="msg.php?id=?php$id?" onClick='CBL_PartialUpdater.update("msg.php/ajax", thix),return false;' >msg->title

or

a href="javascript:void(0);" onClick='CBL_PartialUpdater.update("msg.php/ajax", ?$id?),return false;' >msg->title

i don't really know how to pass the value from a hyper link to server...pls help...

Please send your code to kazuhooku __at__ gmail.com, and I'll take a look into it.

I'm currently trying to implement your system into an AJAX style tabbed system similar to this site here:
http://www.crackajax.net/tabs.php

What i'm trying to do is get it so that it will dynamically still insert/update/delete database records similar to how you have it, except within one of those Tabbed pages.

I've gotten semi close, but to the point where I get no errors or anything... it just doesn't do anything at all. You click submit and it just simply doesn't work.

I'm working it into a PHP5 document, and can provide some source perhaps and a link to the site even that i'm doing this on if you think you can possibly assist?

Thanks much for your time.

Hi, I download and try to use CBL partial update and its great, but is incompatible with the lasted version of prototype (1.4.x).
Thanks!!!!

I'm getting this same error:
When I try to post something, the "loading image" shows up and then, 'I get a javascript message box, with my pages source appearing on the javascript alert message box'

and also this part of the code:
CBL_PartialUpdater::ob_end('dcomentarios');

gives me an error, telling me I cannot use it on my code, even when I add the ob_start() on the beggining.

I'm not using Smarty and I'm using the example to post comments with mysql/php $_POST (not the livesearch).

Can you help me?
And congrats to you.
If I get this working, I'll be extremely gratefull to you. :)

ok, I solved this 2 problems by changinf this:
CBL_PartialUpdater::ob_end('dcomentarios');
to this:
CBL_PartialUpdater::ob_end_flush('dcomentarios');

But the form submissions aren't inserted into the mysql database and the div dcomentarios is not refreshed. :(

First of all, thanks for this AJAX library. It's been a while since I'm using it and I really like it. However, it seems that the response time is considerably slower than other libraries. I am wondering what is the reason and if that could be solved in any way. Also I would like to know what is the latest version of prototype that this library would work with. Any help in this matter would be greatly appreciated.

Oh! There is one more thing that I'd like to know. I would like to use CBL_PartialUpdater.liveUpdate to have the contents of one container updated but I couldn't figure out how to do that. A short example of how to do that would be really helpful. Although I see it's been a long time since the last post on this blog, I hope someone will answer :)

Regards

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)