<?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>Wed, 28 Jul 2010 09:10:47 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Dynamic Table with Xajax]]></title>
			<link>http://community.xajaxproject.org/topic/8436/dynamic-table-with-xajax/new/posts/</link>
			<description><![CDATA[Hello Team,

I am trying to visualize a databasetable with a HTML-Table. This table should be updated every 10 secounds. So every refresh should happen the following:

1) Comparing the currently displayed table with the MySQL-Table
2) If there is a new record in the database a new row is added to the HTML-Table via XAJAX
3) If there is a currently displayed row deleted in the databasetable this row is deleted from the HTML-Table via XAJAX
4) If there is a currently displayed row changed in the databasetable this row is updated in the HTML-Table via XAJAX

I already discoverd how to add a row to a HTML table:

[code]  
function addrow($id, $text1, $text2) {
  $objResponse = new xajaxResponse();        
  $objResponse->create('table', 'tr', 'r'.$id);        
  $objResponse->create('r'.$id, 'td', 'c'.$id.'a');
  $objResponse->create('r'.$id, 'td', 'c'.$id.'b');         
  $objResponse->assign('c'.$id.'a', 'innerHTML', $text1);
  $objResponse->assign('c'.$id.'b', 'innerHTML', $text2);              
  return $objResponse;         
}  
[/code]

and how to delete a row from a HTML table:

[code]
function delrow($id) {
  $objResponse = new xajaxResponse();
  $objResponse->remove('r'.$id);  
  return $objResponse;         
}    
[/code]

But how could I loop trough the existing TR-Elements to check if the table has changed since the last refresh? Or how can I check if the element with the id=77689 already exists before adding it as a new row?

Hope you can give me some inspirations... 

Btw: I do not want to write the whole table every refresh...

Thanks
Dominik]]></description>
			<author><![CDATA[dummy@example.com (hdjw)]]></author>
			<pubDate>Wed, 28 Jul 2010 09:10:47 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8436/dynamic-table-with-xajax/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Comet plugin problems]]></title>
			<link>http://community.xajaxproject.org/topic/7864/comet-plugin-problems/new/posts/</link>
			<description><![CDATA[Hi,
I'm trying the Comet plugin and I'm having a lot of problems.
First of all, I try the example of the progress bar and it doesn't works, here's what firebug returns:

<script>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style
.width\">S5px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S5%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S10px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S10%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S15px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S15%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S20px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S20%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S25px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S25%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S30px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S30%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S35px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S35%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S40px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S40%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S45px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S45%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S50px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S50%</cmd></xjx>");</script><script
>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"progress\" prop=\"style.width
\">S55px</cmd><cmd cmd=\"as\" id=\"streaming\" prop=\"innerHTML\">S55%</cmd><cmd cmd=\"al\">Sfinished
 process at 55%.</cmd></xjx>");</script>

but nothing is seen.
It also happens when trying to get (flush()) some DataBase values: here's the returned by firebug:

<script>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"streaming2\" prop=\"innerHTML
\">Shola</cmd></xjx>");</script><script>top.document.callback("<?xml version=\"1.0\" ?><xjx><cmd cmd
=\"as\" id=\"streaming2\" prop=\"innerHTML\">Sque tal</cmd></xjx>");</script><script>top.document.callback
("<?xml version=\"1.0\" ?><xjx><cmd cmd=\"as\" id=\"streaming2\" prop=\"innerHTML\">Sgracies</cmd></xjx
>");</script>

But when I use a non comet xajax response everything is ok. Here's the firebug code:

<?xml version="1.0" encoding="ISO-8859-1" ?><xjx><cmd cmd="ap" id="xajax" prop="innerHTML"><![CDATA[Shola
<br>]]&gt;</cmd><cmd cmd="ap" id="xajax" prop="innerHTML"><![CDATA[Sque tal<br>]]&gt;</cmd><cmd cmd="ap" id
="xajax" prop="innerHTML"><![CDATA[Sgracies<br>]]&gt;</cmd></xjx>element.innerHTML += data;element.innerHTML
 += data;element.innerHTML += data;

I give you the complete .php file:

<?
$core = './xajax/xajax_core';
require_once $core . '/xajax.inc.php';

include("conexion.php");
session_start();
$xajax = new xajax();
require_once $core . '/xajaxPlugin.inc.php';
require_once $core . '/xajaxPluginManager.inc.php';
require_once './xajax/xajax_plugins/response/comet/comet.inc.php';
$xajax->setCharEncoding('ISO-8859-1');
$xajax->configure('decodeUTF8Input',true);

function ControllerPut($form){
    conectar("tienda");
    //echo $form["mensaje"];
    $query="INSERT into chat (id,mensaje) values ('','".$form["mensaje"]."')";
    $result=mysql_query($query);
}

function ControllerGet () {
  $objResponse = new xajaxCometResponse();
  
  conectar("tienda");
  $_SESSION["id"]=0;
  //while(true){
      $query="SELECT * from chat WHERE id >".$_SESSION["id"]."";
      $result=mysql_query($query);
      while($row=mysql_fetch_object($result)){
        $objResponse->assign("streaming2","innerHTML",$row->mensaje);
        $objResponse->flush();
        $_SESSION["id"]=$row->id;
        if($row->mensaje=="exit"){
            return $objResponse;
        }
      }
  //}
  return $objResponse;
}

function Get () {
  $objResponse = new xajaxResponse();
  
  conectar("tienda");
  $_SESSION["id"]=0;
  //while(true){
      $query="SELECT * from chat WHERE id >".$_SESSION["id"]."";
      $result=mysql_query($query);
      while($row=mysql_fetch_object($result)){
        $objResponse->append("xajax","innerHTML",$row->mensaje."<br>");
        $_SESSION["id"]=$row->id;
        if($row->mensaje=="exit"){
            return $objResponse;
        }
      }
  //}
  return $objResponse;
}

function testComet () {
$objResponse = new xajaxCometResponse(0.3);

for ($i=1;$i<=10;++$i) {
$objResponse->assign("progress","style.width",($i*5)."px");
$objResponse->assign("streaming","innerHTML",($i*5).'%');
$objResponse->flush();
}
$objResponse->assign("progress","style.width",($i*5)."px");
$objResponse->assign("streaming","innerHTML",($i*5).'%');
$objResponse->alert("finished process at ".($i*5)."%.");
return $objResponse;
}
$xajax->registerFunction("testComet");
$xajax->registerFunction("Get");
$xajax->registerFunction("ControllerPut");
$xajax->registerFunction("ControllerGet");
$xajax->processRequest();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[url]http://www.w3.org/TR/html4/loose.dtd[/url]" >
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8; no-cache">
<title>Chat Comet</title>

<?php $xajax->printJavascript("./xajax/");?>
<style>
#streaming2{
    width: 400px;
    height: 400px;
    border: 1px solid #000;
    overflow: auto;
}
#xajax{
    width: 400px;
    height: 400px;
    border: 1px solid #000;
    overflow: auto;
}
#box{
    width: 400px;
    height: 75px;
    border:1px solid #000;
}
</style>

</head>

<body>
<div id="progress" style="width:1px;background:red;border:1x solid darkred">
         <div id="streaming"></div>   
      </div>

<div id="streaming2"></div><div id="xajax"></div>
<div id="box">
<form id="formulario" name="formulario">
<input type="text" name="mensaje"/><input type="submit" onclick="xajax_ControllerPut(xajax.getFormValues('formulario'));return false;"/><input type="submit" value="actualizar_comet" onclick="xajax_ControllerGet();return false;"/><input type="submit" value="actualizar" onclick="xajax_Get();return false;"/><input type="submit" value="test" onclick="xajax_testComet();return false;"/>
</form>
</div>

</body>
</html>



Thank's for your help]]></description>
			<author><![CDATA[dummy@example.com (psousa)]]></author>
			<pubDate>Wed, 14 Jul 2010 10:48:27 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/7864/comet-plugin-problems/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[The manual]]></title>
			<link>http://community.xajaxproject.org/topic/8441/the-manual/new/posts/</link>
			<description><![CDATA[How can I get to the perfect manual。

Thank you！]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Wed, 07 Jul 2010 17:57:07 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8441/the-manual/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[problem with tutorial "learn xajax in 10 minutes"]]></title>
			<link>http://community.xajaxproject.org/topic/8392/problem-with-tutorial-learn-xajax-in-10-minutes/new/posts/</link>
			<description><![CDATA[Hi, thanks for this code, i'm sure it works great, but i'm stuck on the first tutorial. I'd really appreciate it if you had a zip file at the end of the tutorial with all of the files working properly for someone like me who may have misunderstood.

first of all, i'm confused about this line

<button onclick="xajax_myFunction('It worked!');"/></pre>

is that well formated html? shouldn't it be something more like this

<input type="button" onclick="xajax_myFunction('It worked!');" value="click me"/>

regardless, i still get the same result, i was able to turn on debugging, so can someone please tell me what is wrong with my code below?

////****PHP**********////

<?php require ('xajax_core/xajax.inc.php');
$xajax = new xajax(); 
$xajax->processRequest(); 
$xajax->configure('debug',true);
$xajax->registerFunction("myFunction");
function myFunction($arg){
    // do some stuff based on $arg like query data from a database and
    // put it into a variable like $newContent
    $newContent = "Value of $arg: ".$arg;
    
    // Instantiate the xajaxResponse object
    $objResponse = new xajaxResponse();
    
    // add a command to the response to assign the innerHTML attribute of
    // the element with id="SomeElementId" to whatever the new content is
    $objResponse->assign("SomeElementId","innerHTML", $newContent);
    
    //return the  xajaxResponse object
    return $objResponse;
}?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>XaJaX Testing</title>
<?php $xajax->printJavascript(); ?>
</head>

<body>
<div id="SomeElementId"></div>
<button onclick="xajax_myFunction('It worked!');"/></pre>
</body>
</html>

////****PHP*END*****////

////****DEBUG*******////

xajax debug output

Thu May 06 2010 17:28:00 GMT-0700 (PDT)
DONE [72ms]
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
WARNING: Invalid function request received; no request processor found with this name.
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
RECEIVED [status: 200, size: 152 bytes, time: 71ms]:
<?xml version="1.0" encoding="utf-8" ?>
<xjx>
<cmd cmd="dbg">SInvalid function request received; no request processor found with this name.</cmd>
</xjx>
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
SENT [84 bytes]
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
SENDING REQUEST
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
CALLING: 
xjxfun: myFunction
URI: 
http://localhost:8888/_xajax/
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
POST: xjxfun=myFunction
&xjxr=1273192080295
&xjxargs[]=S<![CDATA[It worked!]]&gt;
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
PREPARING REQUEST
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
PROCESSING PARAMETERS [1]
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
INITIALIZING REQUEST
Thu May 06 2010 17:28:00 GMT-0700 (PDT)
STARTING XAJAX REQUEST

////****DEBUG*END**////]]></description>
			<author><![CDATA[dummy@example.com (meme)]]></author>
			<pubDate>Sat, 03 Jul 2010 01:23:05 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8392/problem-with-tutorial-learn-xajax-in-10-minutes/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Limit on return from xajax call]]></title>
			<link>http://community.xajaxproject.org/topic/8420/limit-on-return-from-xajax-call/new/posts/</link>
			<description><![CDATA[The situation is that I'm returning variable sized (but usually large) arrays from an xajax call depending on the parameters I pass.  It works for all  but the largest of the possible responses, i.e. it's working with the second largest with 6000+ entries, but not with the largest of 13000+ entries.  I'm assuming that I've hit either a timeout issue or there is a limit to how much I can return.  I've tried playing with a callback object to reset the timeout but either I don't know what I'm doing or this isn't the problem. Any ideas of which of my possible problems I'm trying to solve would be helpful.

The code is pretty basic and I'd include it but when I try I get a    "* was opened within itself, this is not allowed" error from the forum.

With or without the callback I get the same results.

If I can get Alaska thrown out of the union, this would also solve my problem.

p.s.  I was originally doing a simple xajax_getStateBorders call but that didn't work either.]]></description>
			<author><![CDATA[dummy@example.com (pdchapin)]]></author>
			<pubDate>Wed, 23 Jun 2010 20:02:37 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8420/limit-on-return-from-xajax-call/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Errors]]></title>
			<link>http://community.xajaxproject.org/topic/8432/errors/new/posts/</link>
			<description><![CDATA[There are several issues!

1. The function does not transmit the values of form fields

function formJava() 
	{
	 return '
	 <script language="javascript" type="text/javascript">
	  function subFormAdd()
	  {
	   infoPload();
	   xajax_add(xajax.getFormValues(\'fmPageAdd\'));
	  }
	</script>';
	}

function call looks: echo $obj->formJava();

EROR:
500 Internal Server Error xajax_core.js (строка 395)

Works with xajax 0.2
*******************************************************************

2. How to do xaxaj 0.5 ( $xajax->registerFunction(array("add", &$obj, "add")); ) will look like?

HHHHEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!!!!!!!!!!!!]]></description>
			<author><![CDATA[dummy@example.com (crazy_spanchbob)]]></author>
			<pubDate>Fri, 18 Jun 2010 21:50:51 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8432/errors/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Jquery and Xajax, somebody help?]]></title>
			<link>http://community.xajaxproject.org/topic/8433/jquery-and-xajax-somebody-help/new/posts/</link>
			<description><![CDATA[I am trying to use them both.
Suppose there is a clickable element on my page. On only one (important here) click, it will load something dynamic into the DOM of the current page,  and when the full content loaded, Jquery will do some special effect automatically to this newly loaded content  from xajax.

The problem is, I click it, the dynamic content will be loaded into the current DOM, at first time, Jquery will do nothing because before the full load of this dynamic content, Jquery doesn't has such a target to act on.  Jquery has to be waited for click at the second time to act as wished, because right at this time, the position of the newly generated content has rooted in the DOM tree, Jquery now has it as target to act  with its special effect.

So, when xajax has loaded the dynamic content into the DOM tree successfully, I need it tell me immediatly and the successful load will fire the action of Jquery.

Somebody, give a tip.]]></description>
			<author><![CDATA[dummy@example.com (thenboo)]]></author>
			<pubDate>Fri, 18 Jun 2010 15:53:35 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8433/jquery-and-xajax-somebody-help/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[xajax_authUser is not defined]]></title>
			<link>http://community.xajaxproject.org/topic/8426/xajaxauthuser-is-not-defined/new/posts/</link>
			<description><![CDATA[I know English bad! so Sorry!

There is a code:

function authFormSend(){
	var temp_userData;
	temp_userData = xajax.getFormValues('fmAuth');
	xajax_authUser(temp_userData);
}

string "xajax_authUser(temp_userData);" writes error 

xajax_authUser is not defined/Assumed the existence of the object

HELP!!!]]></description>
			<author><![CDATA[dummy@example.com (crazy_spanchbob)]]></author>
			<pubDate>Wed, 16 Jun 2010 08:57:39 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8426/xajaxauthuser-is-not-defined/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Insert Element into existing]]></title>
			<link>http://community.xajaxproject.org/topic/8425/insert-element-into-existing/new/posts/</link>
			<description><![CDATA[Hello,

I have a form on my website which can be used to insert data into the database. Every line in the db is 
showed as a complex of divs and tables. When I insert a new item into the database, i want to add it to the
mentioned dataview after inserting.
The dataview looks like this:
[code]
<div id="contentFl">
<!-- ITEM -->
<div class="fl-itemtable-wrapper">
    <table border="0" class="fl-itemtable" >
           .....
        </table>
</div>
<!--  END OF ITEM -->
</div>
[/code]
What I want to do now is to add the inserted row as first (!) Element into the div#contentFl.
How can i achieve this as there is no insertInto-Funktion?

Thanks alot.]]></description>
			<author><![CDATA[dummy@example.com (moritz)]]></author>
			<pubDate>Tue, 15 Jun 2010 14:24:02 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8425/insert-element-into-existing/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[xajax to call FedEx Rate Function]]></title>
			<link>http://community.xajaxproject.org/topic/8421/xajax-to-call-fedex-rate-function/new/posts/</link>
			<description><![CDATA[Hello all,

I'm a total newbie when it comes to xajax but I am trying to get a FedEx Rate function to work properly through xajax. The FedEx Rate function works perfectly in PHP (inputting values into a test page on the backend, and then running the function to return a value on page load) however I needed to create a dynamic link between Javascript and this PHP function.

I can get all the examples for xajax to work without any issues and I can confirm the "getFedExRate" function works perfectly elsewhere.

Below is the code:
[code]
<?php  require ('xajax_core/xajax.inc.php');

$xajax = new xajax();

$xajax->configure('javascript URI', ''); //Where the javascript lives

$xajax->configure('debug',true);

$xajax->registerFunction("getFedExRate");

$xajax->processRequest();

    function getFedExRate($service,$lbs,$ds,$dz,$os,$oz) {
        $fedexAccountNum = 123456789;
        $fedexMeterNum = 1234567;
        if( empty($service) || empty($lbs) || empty($ds) || empty($dz) || empty($os) || empty($oz) ) return 0;
        switch (strtoupper($service))
        {
        case "PRIORITYOVERNIGHT": $fedexService['PRIORITYOVERNIGHT'] = 'FedEx Priority Overnight'; break;
        case "STANDARDOVERNIGHT": $fedexService['STANDARDOVERNIGHT'] = 'FedEx Standard Overnight'; break;
        case "FIRSTOVERNIGHT": $fedexService['FIRSTOVERNIGHT'] = 'FedEx First Overnight'; break;
        case "FEDEX2DAY": $fedexService['FEDEX2DAY'] = 'FedEx 2 Day'; break;
        case "FEDEXEXPRESSSAVER": $fedexService['FEDEXEXPRESSSAVER'] = 'FedEx Express Saver'; break;
        case "INTERNATIONALPRIORITY": $fedexService['INTERNATIONALPRIORITY'] = 'FedEx International Priority'; break;
        case "INTERNATIONALECONOMY": $fedexService['INTERNATIONALECONOMY'] = 'FedEx International Economy'; break;
        case "INTERNATIONALFIRST": $fedexService['INTERNATIONALFIRST'] = 'FedEx International First'; break;
        case "FEDEX1DAYFREIGHT": $fedexService['FEDEX1DAYFREIGHT'] = 'FedEx Overnight Freight'; break;
        case "FEDEX2DAYFREIGHT": $fedexService['FEDEX2DAYFREIGHT'] = 'FedEx 2 day Freight'; break;
        case "FEDEX3DAYFREIGHT": $fedexService['FEDEX3DAYFREIGHT'] = 'FedEx 3 day Freight'; break;
        case "FEDEXGROUND": $fedexService['FEDEXGROUND'] = 'FedEx Ground'; break;
        case "GROUNDHOMEDELIVERY": $fedexService['GROUNDHOMEDELIVERY'] = 'FedEx Home Delivery'; break;
        default: return false;
        }
        require("fedex.php");
        if( stristr($service,"GROUND") ) $serviceCode = "FDXG"; else $serviceCode = "FDXE";
        $fedex = new Fedex;
        $fedex->setServer("https://gateway.fedex.com/GatewayDC");
        $fedex->setAccountNumber($fedexAccountNum);
        $fedex->setMeterNumber($fedexMeterNum);
        $fedex->setCarrierCode($serviceCode);
        $fedex->setDropoffType("REGULARPICKUP");
        $fedex->setService($service, $serviceName);
        $fedex->setPackaging("YOURPACKAGING");
        $fedex->setWeightUnits("LBS");
        $fedex->setWeight($lbs);
        $fedex->setOriginStateOrProvinceCode($os);
        $fedex->setOriginPostalCode($oz);
        $fedex->setOriginCountryCode("US");
        $fedex->setDestStateOrProvinceCode($ds);
        $fedex->setDestPostalCode($dz);
        $fedex->setDestCountryCode("US");
        $fedex->setPayorType("SENDER");
        $response = $fedex->getPrice();

        if( isset($response->price) )
            $retVal = (float)$response->price->rate;
        else
            $retVal = "Error ".$response->error->number.": ".$response->error->description;
        
    // Instantiate the xajaxResponse object
    $objResponse = new xajaxResponse();

    // add a command to the response to assign the innerHTML attribute of
    // the element with id="SomeElementId" to whatever the new content is
    $objResponse->assign("SomeElementId","value", $retVal);
    
    //return the  xajaxResponse object
    return $objResponse;
    }
    
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>xajax Get FedEx Rate</title> 
        <?php $xajax->printJavascript(''); ?> 
    </head> 
    <body> 
        Total Shipping Cost: <input type="text" name="SomeElementId" id="SomeElementId" value="0" size="3"  />
        <input type="button" value="Calculate" onclick="xajax_getFedExRate('FEDEXGROUND', 25, 'WA', 98133, 'WA', 98052);return false;" />
    </body> 
</html>
[/code]

When I click the "Calculate" button I get the following in the Debug popup:

[quote]
xajax debug output
Fri Jun 11 2010 11:19:32 GMT-0700 (Pacific Daylight Time)

ERROR: ResponseReceived: Invalid response XML: The response contains an unexpected tag or text: {data}.

Fri Jun 11 2010 11:19:32 GMT-0700 (Pacific Daylight Time)

RECEIVED [status: 200, size: 112 bytes, time: 598ms]:
 
<?xml version="1.0" encoding="utf-8" ?>
<xjx>
<cmd cmd="as" id="SomeElementId" prop="value">N9.34</cmd>
</xjx>

Fri Jun 11 2010 11:19:31 GMT-0700 (Pacific Daylight Time)

SENT [137 bytes]

Fri Jun 11 2010 11:19:31 GMT-0700 (Pacific Daylight Time)

SENDING REQUEST

Fri Jun 11 2010 11:19:31 GMT-0700 (Pacific Daylight Time)

CALLING: 
xjxfun: getFedExRate
URI: 
-edited-

Fri Jun 11 2010 11:19:31 GMT-0700 (Pacific Daylight Time)

POST: xjxfun=getFedExRate
&xjxr=1276280371668
&xjxargs[]=SFEDEXGROUND
&xjxargs[]=N25
&xjxargs[]=SWA
&xjxargs[]=N98133
&xjxargs[]=SWA
&xjxargs[]=N98052

Fri Jun 11 2010 11:19:31 GMT-0700 (Pacific Daylight Time)

PREPARING REQUEST

Fri Jun 11 2010 11:19:31 GMT-0700 (Pacific Daylight Time)

PROCESSING PARAMETERS [6]

Fri Jun 11 2010 11:19:31 GMT-0700 (Pacific Daylight Time)

INITIALIZING REQUEST

Fri Jun 11 2010 11:19:31 GMT-0700 (Pacific Daylight Time)

STARTING XAJAX REQUEST
[/quote]

Does anyone see anything that might be causing my problem?

I really appreciate it!]]></description>
			<author><![CDATA[dummy@example.com (marioc)]]></author>
			<pubDate>Mon, 14 Jun 2010 17:09:04 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8421/xajax-to-call-fedex-rate-function/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[How to don't show a div when a input value is empty]]></title>
			<link>http://community.xajaxproject.org/topic/8418/how-to-dont-show-a-div-when-a-input-value-is-empty/new/posts/</link>
			<description><![CDATA[Hello, I'm new with XAJAX and I don't write very well in English (sorry).

I'm trying to do an autosuggest system with XAJAX. I can show now results in a list into a div, with 'onkeyup' event, but I can't make invisible the div, when the field is empty.

I paste the code:

[code]
HTML Code:
<input type="text" name="busc_alumno" id="busc_alumno" value="Escribe el nombre ..." onkeyup="xajax_buscarAlumno(this.value)" />

XAJAX Code:
function buscarAlumno($inputText) {
    // se instancia el objeto para recibir la respuesta
    $respuesta = new xajaxResponse();
    
    if(isset($inputText) && $inputText != "Escribe el nombre ...") {        
        $mysql = new MySQL('localhost','root','','lt_diplomas');
        // $mysql = new MySQL(DB_SERVIDOR, DB_USUARIO, DB_CLAVE, DB_BBDD);
        $sql = "select * from diploma_pdf where alumno_nombre like '%".trim($inputText)."%' order by alumno_nombre";
        $consulta = $mysql->consulta($sql);    
        $total = $mysql->num_rows($consulta);
        
//      $respuesta -> alert($total);       
//      $respuesta -> alert($sql);
           
        if ($total > 0) {
//            echo "<br>";            
//            $respuesta -> alert('entramos');
                  
            $listadoAlumnos = "<ul id='listadoAlumnos'>";        
            
            while($resultados = $mysql->fetch_array($consulta)) {
                $listadoAlumnos .= "<li><a href='#' onclick='xajax_selectAlumno(\"".$resultados['idDiploma']."\",\"".utf8_decode($resultados['alumno_nombre'])."\")'>".utf8_decode($resultados['alumno_nombre'])."</li>";
            }          
            
            $listadoAlumnos .= "</ul>";                        
            
        }else{       
            $listadoAlumnos = "No hay coincidencias encontradas.";
            //$respuesta -> alert('na\' que hacer');
            
        }
//        
            $respuesta -> assign("alumnoResult","style.display","block");            
//          $respuesta -> alert('llegamos aquí');
            $respuesta -> assign("alumnoResult","innerHTML",$listadoAlumnos);
            
            return $respuesta;
    }    
}

JS Code:
// Borra contenido por defecto del campo de búsqueda de alumnos en form alta diploma

        $("#busc_alumno").click(function(){
            var busqueda = $("#busc_alumno").val();
            if (busqueda == "" || busqueda == "Escribe el nombre ...") {
                $("#busc_alumno").val("");                
                event.preventDefault();
            }
            
        });
        
        $("#busc_alumno").blur(function(){
            var busqueda = $.trim($("#busc_alumno").val());
            if (busqueda == "" || busqueda == "Escribe el nombre ...") {
                $("#busc_alumno").val("Escribe el nombre ...");
                //alert("1" + busqueda + "1");                
                event.preventDefault();
            }                    
        });
[/code]

I put here the JS code, in case of this is the problem.

Thank you and excuse me for my English.]]></description>
			<author><![CDATA[dummy@example.com (jesusjj)]]></author>
			<pubDate>Thu, 10 Jun 2010 14:46:19 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8418/how-to-dont-show-a-div-when-a-input-value-is-empty/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[xajax loading a full page]]></title>
			<link>http://community.xajaxproject.org/topic/8413/xajax-loading-a-full-page/new/posts/</link>
			<description><![CDATA[I am trying to figure out how to load a few page live. Normally I have a single page with a page master that deals with what page is to be loaded. However to activate the page master you need to refresh.

I would like to figure out how to design the same system, but instead reload the page live. However this involves a lot of coding.

I was wondering if there is a way I can pull say a page file into a function and send it out.

Normally I would just do an include('news.php'); I am not sure if this would work in a function tho.

Does anyone have a simple function that could fill an entire content div and have my files organized nice.


All my links would be like xajax_pagemaster('news');

then it would call a pagemaster function get news and display the full news page. That page might live in news.php.

Normally I would just do a switch have a case 'news' and then include('news.php');

Any help?]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Thu, 03 Jun 2010 17:57:31 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8413/xajax-loading-a-full-page/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[XAJAX and SESSION question..]]></title>
			<link>http://community.xajaxproject.org/topic/8412/xajax-and-session-question/new/posts/</link>
			<description><![CDATA[Hi... i am developing an aplication that will be in charge of the calibration of turbines.. based on web tools.. altough is a website it is more for the look. It has some daemons in C running so its actually not a website per se.

Anyway i need some log control.. something simple not that fancy... I did a function in xajax that receives the password and the username and checks against a table in the database.. nothing to fancy.. here is the function

function login($user,$pass){
	
	if($user == NULL || $pass == NULL)
	{
		return;
	}		
	
	require_once('conexion.php');	
	
	$query = "SELECT password FROM taller.access WHERE usuario = '$user';";
	$result = pg_query($con, $query);
	$resul = pg_fetch_result($result,0);
	
	if($resul == NULL)
	{ 
		 $respuesta = new xajaxResponse(); //Creamos el objeto xajax  
   	 $inputDestino = "resultado";//indicamos el ID del tag HTML de destino. en este caso el DIV que contiene el selector
   	 $propiedadInputDestino = "innerHTML"; //indicamos la propiedad que deseamos que se modifique. Colocaremos el selector dentro del DIV 
   	 $valorAAsignar = "";    //indicamos el nuevo valor que este tendrá. Cadena HTML
	 
		 $valorAAsignar = "1";	 			
		 $respuesta->assign($inputDestino ,$propiedadInputDestino, $valorAAsignar);  
   	 return $respuesta; 	       
   } 
	
	if($resul == $pass)
	{
		 
		 $query = "SELECT type FROM taller.access WHERE usuario = '$user';";		 
		 $result = pg_query($con, $query);
		 $type = pg_fetch_result($result,0,0);
		 
		 $action = "LOG IN";
       $query = "SELECT taller.recordlog('".$user."','".$action."',$type);";
       $result = pg_query($con, $query);
       
    	 $query = "SELECT type FROM taller.access WHERE usuario = '$user';"; 
		 $result = pg_query($con, $query);
		 $resul = pg_fetch_result($result,0);
		 
		 $_SESSION['user'] = $user ;                <----- HERE
						
		 if($resul == 1)			 
		 {
		 
an sooo.... (i omitted the irrelevant part...)

Note that i saved the username in a session variable so i can access it later.. anyway.. when the user logs out,, i record to a table the log out time  the user and so..

The function I use for the log out is this:

function reloadreset(){
	
	require_once('conexion.php');
	
	$key = $_SESSION['user'];
	echo "user = ".$key;	
	$query = "SELECT usuario, accion FROM taller.logrecord WHERE id = '$key';";
	$result = pg_query($con, $query); 
	$user = pg_fetch_result($result,0);
	$accion = pg_fetch_result($result,1); 
	
	if($accion == "LOG IN" ){	 
	$action = "LOG OUT"; 
	$query = "SELECT taller.recordlog('".$user."','".$action."');";
   $result = pg_query($con, $query); 
	}	 
   $respuesta = new xajaxResponse(); //Creamos el objeto xajax  
   $inputDestino = "resultado";//indicamos el ID del tag HTML de destino. en este caso el DIV que contiene el selector
   $propiedadInputDestino = "innerHTML"; //indicamos la propiedad que deseamos que se modifique. Colocaremos el selector dentro del DIV 
   $valorAAsignar = "0";    //indicamos el nuevo valor que este tendr?. Cadena HTML
	  
	$valorAAsignar ="0";	 			
	$respuesta->assign($inputDestino ,$propiedadInputDestino, $valorAAsignar);  
   return $respuesta; 
	}
	
But when i check that.. the value stored in the session variable is gone... 

How can i read Session variables in different XAJAX functions..

I am pretty sure this is a lame question but... please help me!!]]></description>
			<author><![CDATA[dummy@example.com (Mino)]]></author>
			<pubDate>Wed, 02 Jun 2010 22:27:13 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8412/xajax-and-session-question/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[continiously check database?]]></title>
			<link>http://community.xajaxproject.org/topic/8410/continiously-check-database/new/posts/</link>
			<description><![CDATA[Hi,

I'm new to ajax and got directed to xajax by some people on a PHP forum. I have read through various examples, but all those examples do ajax request when a user clicks something or changes something and that triggers a function. What i want is for ajax to continuously check MySql database tables and if a statement on a query becomes true it should output data automaticly.

I am creating a game and what i specifically need is this. When a player is at a certain X,Y position ajax should continuously check if there are other players on his position (or in a certain range around him) and if so they will get listed inside a div.

Is this possible? Where should i look for? Are there xajax examples for this as i want to avoid javascript as much as possible :D.

Thanks!]]></description>
			<author><![CDATA[dummy@example.com (edrobinson)]]></author>
			<pubDate>Wed, 02 Jun 2010 13:09:02 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8410/continiously-check-database/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Need help interpreting debug output]]></title>
			<link>http://community.xajaxproject.org/topic/8407/need-help-interpreting-debug-output/new/posts/</link>
			<description><![CDATA[Question

I have Xajax running inside of joomla quite well.  I have a form that I reference twice.  Once for a new input process, and then I pass values to that same form if I am editing data that was input during the new input process. 

There is a difference in the process flow.   For new records the form is called directly.  For the edit process, a list of records if first created.  Once you click on a link of that record, the record is pulled and the same form displays the data.

However I get a different debug message when I try to post that form depending on how the for is called.

Direct input form call.  The URI is different and correct.

[code]

Mon May 24 13:52:52 MDT 2010
SENT [63 bytes]
Mon May 24 13:52:52 MDT 2010
SENDING REQUEST
Mon May 24 13:52:52 MDT 2010
CALLING: 
xjxfun: FacilityAdd
URI: 
http://10.111.111.159/joomla/index.php?option=com_qatool&view=detail&cid[0]=-1&Itemid=54&user_id=D999999&pwd=password&pat_id=4123412&acc_num=412341[23&stdy_date=4/22/2010

[/code]

Indirect edit call.  The URI is incorrect.

[code]

Mon May 24 13:50:06 MDT 2010
SENT [65 bytes]
Mon May 24 13:50:06 MDT 2010
SENDING REQUEST
Mon May 24 13:50:06 MDT 2010
CALLING: 
xjxfun: SetAssignTo
URI: 
http://10.111.111.159/joomla/index.php?option=com_qatool&view=list&type=all&Itemid=54&sort=a

[/code]

So the question in this case is, is XAJAX responsible for the URI, or is that being loaded in a different application.  Is the URI a parameter I need to pass to XAJAX?

Any assistance is appreciated.]]></description>
			<author><![CDATA[dummy@example.com (q_no)]]></author>
			<pubDate>Fri, 28 May 2010 15:07:04 +0000</pubDate>
			<guid>http://community.xajaxproject.org/topic/8407/need-help-interpreting-debug-output/new/posts/</guid>
		</item>
	</channel>
</rss>
