<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[xajax Forums]]></title>
		<link>http://community.xajaxproject.org/</link>
		<description><![CDATA[The most recent topics at xajax Forums.]]></description>
		<lastBuildDate>Fri, 12 Mar 2010 15:18:07 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[avoid double invocation of a page]]></title>
			<link>http://community.xajaxproject.org/topic/8327/avoid-double-invocation-of-a-page/new/posts/</link>
			<description><![CDATA[Hi all, it's the first time I post here, today I went trough an issue that take me some effort.
I wrote a php page (let say index.php) that fulfill different kind o actions depending on the value of 'action' parameter (i.e. index.php?action=new does something different than index.php?action=edit). This page use xajax capabilities to list items the user can search. My main trouble is that my xajax_listItems() method that is invoked as soon as the page is loaded cause the index.php page to be invoked again. As you may figure when I invoke index.php?action=new I don't want that action to be performed again becouse new objects will be created in the db.

The only answer I found is to detect which method is used by the request:
[code]
if ($_SERVER['REQUEST_METHOD']=='GET'){...} else {...}
[/code]
in facts i noticed that while I'm invoking index.php with get method xajax will use post.

I hope that someone will find this post usefull. Maybe someone can suggest a better answer.]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Fri, 12 Mar 2010 15:18:07 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8327/avoid-double-invocation-of-a-page/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Xajax Vs whatever-Zend-has]]></title>
			<link>http://community.xajaxproject.org/topic/8331/xajax-vs-whateverzendhas/new/posts/</link>
			<description><![CDATA[So, this is kind of a rant really and maybe someone here can tell me I'm wrong...

But I've been using Xajax and JQuery just fine now for a few years.

Here at my work, apparently we want to convert all our sites into the Zend Framework. 

Personally, I come from a C/C++ background and I'm not a fan of Frameworks in general... I've been trying to like ZF but, damn, talk about convoluted and loss of control.

So then I start reading on how to do AJAX with it... and good lord. Am I missing something or is ZF just not AJAX friendly? 

If anyone else is with me in this boot, I'd love to find some ammo on the internet to NOT switch over to Zend Framework. 

For one, losing XAJAX is enough of a reason not to switch for me...]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Fri, 12 Mar 2010 14:35:41 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8331/xajax-vs-whateverzendhas/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[redirect only works one time]]></title>
			<link>http://community.xajaxproject.org/topic/8326/redirect-only-works-one-time/new/posts/</link>
			<description><![CDATA[Hi everybody,

I'm facing a strange problem here (tested on FF3.5x,FF3.6, Firebug enabled):
In my Order-Detais-Screen I use to create pdf-files (delivery form, invoice, so on) with a xajax-function. The function opens up a new window with some params to create the pdf, thereafter I redirect to my Detail-Screen again to see status changes etc. This works fine - for one time. When I use the same function again (e.g. first to create a delivery form, then an invoice), it won't redirect me. Everything else works.

Do not really know how to solve this. I already made sure that I'm using a https:// url in my redirect call...

Firebug shows me the following resonses (in this case there was no redirect):

<?xml version="1.0" encoding="utf-8" ?><xjx><cmd cmd="js">Snew Effect.Highlight('comment4',{startcolor:'#FFFEBA', endcolor:'#E9F5FF'});</cmd><cmd cmd="js"><![CDATA[Stry {myPDF = window.open('myorders.php?content=0&step=4&action=show&type=4&notepaper=1&date=11.03.2010','PDF','');myPDF.focus();} catch(ex) {alert(ex);}]]&gt;</cmd><cmd cmd="js"><![CDATA[Swindow.location = "[url]https://www.mydomain.com/myorders.php?content=0&step=3&dircount=0&dirtype=4&setstatus=1&open=docs#docs[/url]";]]&gt;</cmd></xjx>

What else could I do?

Cheers,
Manu]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Thu, 11 Mar 2010 18:21:23 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8326/redirect-only-works-one-time/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[empty response with synchronous request]]></title>
			<link>http://community.xajaxproject.org/topic/8330/empty-response-with-synchronous-request/new/posts/</link>
			<description><![CDATA[First I want to give my compliments here to the xajax project. I'm using it for a while now, and I highly appriate it. 

But today I stumbled across a problem. I made my ajax request synchronous so I could let my javascript wait for it's response. But I noticed that there was no response in Firebug anymore. The tab XML showed: "XML Parsing Error: no element found Location: moz-nullprincipal:{5f93e1c8-2e48-470c-ac55-0e3a318fff1e} Line Number 1, Column 1:". When I switched back to asynchronous, the response was back again. 

I hope one of you knows what's causing this and how to solve it, because the response sometimes was very helpfull to me.]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Thu, 11 Mar 2010 18:19:56 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8330/empty-response-with-synchronous-request/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[page reloads due to a xajax call?]]></title>
			<link>http://community.xajaxproject.org/topic/8324/page-reloads-due-to-a-xajax-call/new/posts/</link>
			<description><![CDATA[Hello,

not really a problem (at least I hope so):

I added a page logging to one of my sites, so just after connecting to a database, I insert a line to my mysql-db with the pagename, my IP, .... I did because I was searching for an error.

On one of the pages, I have a xajax-Function, which checks if certain fields within a form are filled or not, and ist sets the class to this input field. As it is possible, that a field has already a value or not, I added a <script> section right at the end of my page, in which the xajax function is called for each of the controlled fields with the field-id and the field-value as parameter. This all works fine.

But whenever I call this page, in my logging I get 6 similar inserts. And what I found out, is that it is one time for the real page call, and 5 times for the called xajax_functions. If I delete one of the xajax-calls, then there's one insert less.

It seems that the xajax_function recalls the whole page? Why is this? How to do it better?

I try to give some source (cut to the important things - and with only two fields)

[code]
<?php
include("connect.inc.php");
connect();
$q = "INSERT INTO control (Zeit, Seite, Adresse, Agent, Query, Kunde, User) VALUES (NOW(), '{$_SERVER["PHP_SELF"]}', '{$_SERVER["REMOTE_ADDR"]}', '{$_SERVER["HTTP_USER_AGENT"]}', '{$_SERVER["QUERY_STRING"]}', '{$_SESSION["KUNDE"]}', {$_SESSION["USER"]})";
$r = mysql_query($q);

require ("../xajax/xajax.inc.php");
function PruefRahmen( $feld, $wert ) {
    $objResponse = new xajaxResponse();
    if (strlen(trim($wert)) == 0) {
        $objResponse->addAssign($feld, 'className', utf8_encode('inputmonokleinR'));
    } else {
        $objResponse->addAssign($feld, 'className', utf8_encode('inputmonoklein'));
    }
    return $objResponse;
}

$xajax = new xajax(); 
//$xajax->debugOn();
$xajax->registerFunction("PruefRahmen");
$xajax->processRequests();
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php $xajax->printJavascript('../xajax'); ?>
</head>

<body>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" name="auf_neu" id="auf_neu">
<input type="text" name="vab_plz" id="vab_plz" size="8" maxlength="8" class="inputmonokleinR" value="" onKeyUp="xajax_PruefRahmen('vab_plz', this.value);">
<input type="text" name="vab_ort" id="vab_ort" size="30" maxlength="30" class="inputmonokleinR" value="" onKeyUp="xajax_PruefRahmen('vab_ort', this.value);">

<input type="reset" name="abbruch" value="abbrechen" onClick="history.back();">
<input type="submit" name="fertig" value="Weiter" onClick="this.value='Weiter ...'; this.disabled=true; this.form.submit();">
</form>
//--->Untill here only one insert happend
<script type="text/javascript">
    xajax_PruefRahmen('vab_plz', document.auf_neu.vab_plz.value);
    xajax_PruefRahmen('vab_ort', document.auf_neu.vab_ort.value);
</script>
//--->Now there are three INSERTS
</body>
</html>
[/code]



Fabs]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Wed, 10 Mar 2010 13:55:42 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8324/page-reloads-due-to-a-xajax-call/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Social Pool Betting Site]]></title>
			<link>http://community.xajaxproject.org/topic/8325/social-pool-betting-site/new/posts/</link>
			<description><![CDATA[This site uses xajax very heavily. It's a social pool betting site, makes contests and polls more fun. I created a pool already:

<a href='http://www.poolcorner.com/pool/march-2010-price-of-gold.html'><img src='http://www.poolcorner.com/imgs/remote/join_this_pool.gif' width=177 height=40 border=0 /></a>]]></description>
			<author><![CDATA[dummy@example.com (nguyendneyugn)]]></author>
			<pubDate>Tue, 09 Mar 2010 23:01:54 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8325/social-pool-betting-site/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Captcha]]></title>
			<link>http://community.xajaxproject.org/topic/6941/captcha/new/posts/</link>
			<description><![CDATA[hi...  how can i make a captcha using Xajax...?

thanks in advance...]]></description>
			<author><![CDATA[dummy@example.com (ExSystem)]]></author>
			<pubDate>Tue, 09 Mar 2010 08:40:27 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/6941/captcha/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Sending variables from client to server]]></title>
			<link>http://community.xajaxproject.org/topic/8320/sending-variables-from-client-to-server/new/posts/</link>
			<description><![CDATA[Hi all,

I created an index.xajax.php file to process all xajax requests from the client and it's working as expected, but I just got stuck on how to send a variable upon xajax request (from client to server) so the php script could read this variable and decide which script to include BEFORE registering and defining the user-function called (it will be done on the script included).

As a workaround, I put this variable as a GET parameter (xajax is working with POST) on the requestURI ('index.xajax.php?var=value'), but I supose there's a better way for doing it.

It would be no problem to pass it as a xajax variable, but, as I said, I need to read this variable before calling $xajax->processRequest(). Is there a way to parse the $_POST['xjxargs'] beside $xajax->processRequest()?

Thanks in advance,

Filipe

BTW: yes, I did search the forum for this =)]]></description>
			<author><![CDATA[dummy@example.com (filipek)]]></author>
			<pubDate>Tue, 09 Mar 2010 05:45:33 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8320/sending-variables-from-client-to-server/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Possible Google Chrome Bug]]></title>
			<link>http://community.xajaxproject.org/topic/8323/possible-google-chrome-bug/new/posts/</link>
			<description><![CDATA[I am getting the following error when ***certain*** buttons are calling xajax getFormValues methods:

Uncaught TypeError: Object #<an HTMLInputElement> has no method 'substring' - xajax_core.js:94

The offending line is: return;if(prefix!=child.name.substring(0,prefix.length))

This is in xajax 0.5 beta 4, so I will try with the latest greatest.  it is a little suspect to me since I have many buttons on my page, all using the getFormValues() method, but only this one is failing (to my knowledge).  These buttons all work on Firefox and IE - only Chrome has the problem.  I have seen something similar posted in other places regarding the prototype.js scripts.

Any insight would be appreciated.]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Mon, 08 Mar 2010 18:20:39 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8323/possible-google-chrome-bug/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[no utf8 charset, php 5.2.13 breaks xajaxResponse]]></title>
			<link>http://community.xajaxproject.org/topic/8322/no-utf8-charset-php-5213-breaks-xajaxresponse/new/posts/</link>
			<description><![CDATA[Hi all,
updated today php to version 5.2.13, 
xajax 0.5 final
and now i have error
[Fri Mar 05 16:28:32 2010] [error] [client 127.0.0.1] PHP Warning:  htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in xajax\\xajax_core\\xajaxResponse.inc.php on line 1709

in that line i have
  $bSpecialChars = (htmlspecialchars($sData, ENT_COMPAT, 'UTF-8') != $sData);

and in debug log it show

Fri Mar 05 2010 16:50:20 GMT+0200

ERROR: No response processor is available to process the response from the server.
Content-Type: text/html.
Check for error messages from the server.

Fri Mar 05 2010 16:50:20 GMT+0200

ERROR: The server returned the following HTTP status: 500
RECEIVED:

and now site wich used xajax not working, anyone can help me with this problem?
Thak you


P.S. and sorry for repost, cause first time im posted in thread with the same problem but in v.0.2 of xajax, and didnot saw this.]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Mon, 08 Mar 2010 17:23:26 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8322/no-utf8-charset-php-5213-breaks-xajaxresponse/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[I just had lunch!]]></title>
			<link>http://community.xajaxproject.org/topic/8321/i-just-had-lunch/new/posts/</link>
			<description><![CDATA[I know I know, long time no see :) But I want to share my latest project with you, since it uses xajax and might be interesting for a lot of people.

As a busy worker in an office it's sometimes really hard to find something new to eat at lunchtime. This app is supposed to give some inspiration:

[url]http://ijusthadlunch.com/[/url]

Please add some nice locations, wherever you live :)

Feedback is highly appreciated, especially since it's currently in beta phase!

Thanks :)]]></description>
			<author><![CDATA[dummy@example.com (q_no)]]></author>
			<pubDate>Mon, 08 Mar 2010 14:17:06 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8321/i-just-had-lunch/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Scriptaculous Autocompleter.Local]]></title>
			<link>http://community.xajaxproject.org/topic/3897/scriptaculous-autocompleterlocal/new/posts/</link>
			<description><![CDATA[Hi everyone,

I know, you have seen this topic in every variation here, but sadly all those didn't help me. I hope you can stand another one and help me out ;)

I'm trying to make a (surprise) google suggest style search.
I wrote the search/autocomplete logic in php and call it via xajax at an onKeyUp event of the search input field.

Now I want to use the autocompleter gui from scriptaculous to handle all the frontend stuff, but I can't see how to seperate the scriptaculous autocompletion logic from the display stuff.
In php I basically get an array of search results and pass them back to a javascript function:

$xajax->call('updateSuggestions', $suggestions);

where updateSuggestions is a javascript function which I planned should update the scriptaculous autocompleter contents and $suggestions are the suggestions I got from the database. (Yes, I am using xajax 0.5 beta 2).

Do you have any hint if I am on the right track, or if I can accomplish all this more easily? How do I update the scriptaculous tokens? And how do I tell the autocompleter to show the suggestion list after an update? 

I hope you get my problem and are able to help me :-)
I really want to use scriptaculous, because I am already using it for the lightbox ... so it is loaded anyway and another framework like the yahoo stuff would be too much overhead in my opinion.

Thanks for your time,
Shukuyen.]]></description>
			<author><![CDATA[dummy@example.com (dannic)]]></author>
			<pubDate>Fri, 05 Mar 2010 16:00:44 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/3897/scriptaculous-autocompleterlocal/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[no utf8 charset, php 5.2.6 breaks xajaxResponse]]></title>
			<link>http://community.xajaxproject.org/topic/7136/no-utf8-charset-php-526-breaks-xajaxresponse/new/posts/</link>
			<description><![CDATA[Hi,

if you set 
define('XAJAX_DEFAULT_CHAR_ENCODING', 'iso8859-1');

then you get php errors/notices (with 5.2.x it starts) "invalid multibyte sequence" in xajaxResponse.inc.php as it is uses:
htmlspecialchars($sData, ENT_COMPAT, 'UTF-8');

shouldn't that be:
htmlspecialchars($sData, ENT_COMPAT, XAJAX_DEFAULT_CHAR_ENCODING);

This is still in xajax-0.5-rc2 so. And there are two places where the function is used that way:


Maybe it can be fixed in the final release of xajax-0.5

Greetings J]]></description>
			<author><![CDATA[dummy@example.com (eliotik)]]></author>
			<pubDate>Fri, 05 Mar 2010 14:29:02 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/7136/no-utf8-charset-php-526-breaks-xajaxresponse/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Strstr and Strpos using Xajax]]></title>
			<link>http://community.xajaxproject.org/topic/8319/strstr-and-strpos-using-xajax/new/posts/</link>
			<description><![CDATA[Hey guys,

I don't know if this issue has already been discussed, but i have some problems using strstr and strpos.
Im working an a project that extracs content from files. And as i already stated strstr and strpos, just does not
do anything. Id prefer not to write my own semi strstr, strpos functions.

Im using Xajax based on the Typo3 Extention, im using the xajax Javascript Library version 0.2.5 not sure if its 0.5 or 0.2.
Eather way is there some one with a simular problem + solution, or has a workaround laying around.

Thnx for the help in advance,
Kind regards,

Sebastiaan van Parijs]]></description>
			<author><![CDATA[dummy@example.com (svanparijs)]]></author>
			<pubDate>Fri, 05 Mar 2010 12:24:29 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8319/strstr-and-strpos-using-xajax/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[xajax and __destruct]]></title>
			<link>http://community.xajaxproject.org/topic/8308/xajax-and-destruct/new/posts/</link>
			<description><![CDATA[Hi folks,

I have a strange problem. After some funny tests with xajax 0.5_standard I want it to integrate in my OO project. (php 5.2.2)

I have a class like this:

class c_html_site {

  function __construct() {
      ... doing here xajax things , everything ok

      .... begin html output bla bla
  }

  function someHtml() {
     ... some html output
  }


  function __destruct() {
     echo "</body></html>";
  }
}

$a = new c_html_site();
$a -> someHtml();

Without xajax my project works like designed, the constructor begins the html site, then all other output and when php is closed, the destructor will be called and you have a normal html site.

Integrating xajax, the process hangs when I press an xajaxe'd button.
 After analyzing the problem I found out, that the reason for the hang is the echo statement of the destructor.
After removing the echo, resp. move the statements into the someHtml method, everything is fine, the process is back and is changing some <divs> or what you expected.

So don't missunderstand: I have no problem with registering methods or wrong javascript output.

The problem occurs in any destruct method of my classes with print or echo statements.
Strange: Even so when the class with an destructor thats doing some output has nothing to do with xajax (no $xajax->method, no registered methods with xajax), the site hangs after starting the xajax javascript by pressing an prepared button.

I was trying to google the problem , but with no success.

To reproduce the problem, simple add an echo "test" or an print "test" to one of your destructors. 

As soon as I remove output from the destructor, all is fine.
I any case the source of the site looks in both cases identically.

Maybe I'm wrong, but I thought theres no problem to make outpout in destructors.

Any help?]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Wed, 03 Mar 2010 20:20:51 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8308/xajax-and-destruct/new/posts/</guid>
		</item>
	</channel>
</rss>
