<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[xajax Forums]]></title>
	<link rel="self" href="http://community.xajaxproject.org/feed/atom/"/>
	<updated>2010-03-09T19:23:14Z</updated>
	<generator>PunBB</generator>
	<id>http://community.xajaxproject.org/</id>
		<entry>
			<title type="html"><![CDATA[page reloads due to a xajax call?]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8324/page-reloads-due-to-a-xajax-call/new/posts/"/>
			<summary type="html"><![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]]></summary>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/1587/</uri>
			</author>
			<updated>2010-03-09T19:23:14Z</updated>
			<id>http://community.xajaxproject.org/topic/8324/page-reloads-due-to-a-xajax-call/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Captcha]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/6941/captcha/new/posts/"/>
			<summary type="html"><![CDATA[hi...  how can i make a captcha using Xajax...?

thanks in advance...]]></summary>
			<author>
				<name><![CDATA[ExSystem]]></name>
				<uri>http://community.xajaxproject.org/user/2636/</uri>
			</author>
			<updated>2010-03-09T08:40:27Z</updated>
			<id>http://community.xajaxproject.org/topic/6941/captcha/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Sending variables from client to server]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8320/sending-variables-from-client-to-server/new/posts/"/>
			<summary type="html"><![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 =)]]></summary>
			<author>
				<name><![CDATA[filipek]]></name>
				<uri>http://community.xajaxproject.org/user/4347/</uri>
			</author>
			<updated>2010-03-09T05:45:33Z</updated>
			<id>http://community.xajaxproject.org/topic/8320/sending-variables-from-client-to-server/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Possible Google Chrome Bug]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8323/possible-google-chrome-bug/new/posts/"/>
			<summary type="html"><![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.]]></summary>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/2269/</uri>
			</author>
			<updated>2010-03-08T18:20:39Z</updated>
			<id>http://community.xajaxproject.org/topic/8323/possible-google-chrome-bug/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[no utf8 charset, php 5.2.13 breaks xajaxResponse]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8322/no-utf8-charset-php-5213-breaks-xajaxresponse/new/posts/"/>
			<summary type="html"><![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.]]></summary>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/4348/</uri>
			</author>
			<updated>2010-03-08T17:23:26Z</updated>
			<id>http://community.xajaxproject.org/topic/8322/no-utf8-charset-php-5213-breaks-xajaxresponse/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[I just had lunch!]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8321/i-just-had-lunch/new/posts/"/>
			<summary type="html"><![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 :)]]></summary>
			<author>
				<name><![CDATA[q_no]]></name>
				<uri>http://community.xajaxproject.org/user/569/</uri>
			</author>
			<updated>2010-03-08T14:17:06Z</updated>
			<id>http://community.xajaxproject.org/topic/8321/i-just-had-lunch/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Scriptaculous Autocompleter.Local]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/3897/scriptaculous-autocompleterlocal/new/posts/"/>
			<summary type="html"><![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.]]></summary>
			<author>
				<name><![CDATA[dannic]]></name>
				<uri>http://community.xajaxproject.org/user/1636/</uri>
			</author>
			<updated>2010-03-05T16:00:44Z</updated>
			<id>http://community.xajaxproject.org/topic/3897/scriptaculous-autocompleterlocal/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[no utf8 charset, php 5.2.6 breaks xajaxResponse]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/7136/no-utf8-charset-php-526-breaks-xajaxresponse/new/posts/"/>
			<summary type="html"><![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]]></summary>
			<author>
				<name><![CDATA[eliotik]]></name>
				<uri>http://community.xajaxproject.org/user/2125/</uri>
			</author>
			<updated>2010-03-05T14:29:02Z</updated>
			<id>http://community.xajaxproject.org/topic/7136/no-utf8-charset-php-526-breaks-xajaxresponse/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Strstr and Strpos using Xajax]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8319/strstr-and-strpos-using-xajax/new/posts/"/>
			<summary type="html"><![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]]></summary>
			<author>
				<name><![CDATA[svanparijs]]></name>
				<uri>http://community.xajaxproject.org/user/4346/</uri>
			</author>
			<updated>2010-03-05T12:24:29Z</updated>
			<id>http://community.xajaxproject.org/topic/8319/strstr-and-strpos-using-xajax/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[xajax and __destruct]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8308/xajax-and-destruct/new/posts/"/>
			<summary type="html"><![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?]]></summary>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/4329/</uri>
			</author>
			<updated>2010-03-03T20:20:51Z</updated>
			<id>http://community.xajaxproject.org/topic/8308/xajax-and-destruct/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[xajax5.0 developer notes..]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8318/xajax50-developer-notes/new/posts/"/>
			<summary type="html"><![CDATA[Hi friends ,
i am new developer in php. i am started to learn xajax .
i have installed xajax 0.5 standard. 
pls any one having xajax manual .]]></summary>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/4344/</uri>
			</author>
			<updated>2010-02-28T17:34:26Z</updated>
			<id>http://community.xajaxproject.org/topic/8318/xajax50-developer-notes/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Time on the page]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8317/time-on-the-page/new/posts/"/>
			<summary type="html"><![CDATA[Hello!
I want to show the server time on the page. But I do not know how to update the time every minute (or second). Please help.]]></summary>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/4341/</uri>
			</author>
			<updated>2010-02-26T15:43:11Z</updated>
			<id>http://community.xajaxproject.org/topic/8317/time-on-the-page/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Help with MultiBox | phatfusion]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8316/help-with-multibox-phatfusion/new/posts/"/>
			<summary type="html"><![CDATA[I am using Multibox ( [url]http://www.phatfusion.net/plugins/multibox/[/url] ) to open new windows but I am not able to make it work in xajax for some reason.

It works outside of xajax but for the life of me I am not seeing how to make this one work.

Any one have a idea on this one?

I have tried to add in a handler and add in script but so far it is not working.

Can someone give me a hand with this?]]></summary>
			<author>
				<name><![CDATA[seraphielx]]></name>
				<uri>http://community.xajaxproject.org/user/2011/</uri>
			</author>
			<updated>2010-02-25T21:51:49Z</updated>
			<id>http://community.xajaxproject.org/topic/8316/help-with-multibox-phatfusion/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[xajax 0.6]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8201/xajax-06/new/posts/"/>
			<summary type="html"><![CDATA[Oh I think I am going to die... - my patience has value below 0 - I can not wait any more for new release... ;)

But serious - it is very intriguing how much web application can seed up thanks to JSON instead XML in response data.

Best regards to Xajax Team,
Artur]]></summary>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/2417/</uri>
			</author>
			<updated>2010-02-24T17:07:31Z</updated>
			<id>http://community.xajaxproject.org/topic/8201/xajax-06/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[xajax and php 5.3.1]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/topic/8295/xajax-and-php-531/new/posts/"/>
			<summary type="html"><![CDATA[My member registration/administration application has worked without problems for over a year. Last week I did some small changes and it still worked in all parts.

This week it stopped working properly when my host upgraded to latest version of php.

As I se it the server side is doing the job but only the very first part of the response is sent back to my form.

Any idea what to look for?
What should I check for when using the new php version?
Can I validate the php code on the server side in some tool?

/Staffan

February 26
I just got a message that there was a response to my issue:

The main problem was that php 5.3.1 impose new coding rules that made my php code stop working.
Just one thing I think Xajax could fix:

Not possible to read status of unchecked Checkboxes.
Fix: Add text fields and JavaScript to mimic status of checkboxes and
access the corresponding text field.

Other thing that needed fixing: 

Does not work any longer to use:
XML-element: $entry->getAttributeNode('param') -> nodeValue;  
when the attribute is missing. 
Fix: Changed to $entry->getAttribute('param') ; 

Must no longer try to access $_Session values that are not set. 
Fix: Check with if (session_is_registered('param'));

Variables now must be initialized before used in expressions.
Fix: Only use initialized varaibles in expressions.

With these changes things seem to work!!]]></summary>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/4310/</uri>
			</author>
			<updated>2010-02-23T23:15:23Z</updated>
			<id>http://community.xajaxproject.org/topic/8295/xajax-and-php-531/new/posts/</id>
		</entry>
</feed>
