Welcome Guest, Not a member yet? Register   Sign In

this is the debug of xajax, When I use one of my model'function's I receive this error. Help me please.

Xajax debug output

Mon Jul 16 2007 14:54:59 GMT+0200: Received: <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Notice</p> <p>Message: Undefined property: Ajaxtest::$officina_app_model</p> <p>Filename: controllers/ajaxtest.php</p> <p>Line Number: 32</p> </div>
Mon Jul 16 2007 14:54:59 GMT+0200: Calling test_function uri=http://localhost/CodeIgniter/index.php/ajaxtest (post:xajax=test_function&xajaxr=1184590499631&xajaxargs[]=3)
Mon Jul 16 2007 14:54:59 GMT+0200: Initializing Request Object..
Mon Jul 16 2007 14:54:59 GMT+0200: Starting xajax...

Please don't use ALL CAPS. Now let's see if we can figure this out.

The problem is on line 32 of your Ajaxtest controller, in the test_function() method. You're attempting to access a property called "afficina_app_model", but it's not loaded. Is the model loaded properly?

Can you please post the code of that method so we can see what you're attempting to do?

I resolved All.

In the controller I have:

function Ajaxtest()

//load the helper url

//to load my model
$this->load->model("mymodel"); // Moved up 2 lines

//load xajax library


//to record my xajax function

//execute process requests

//carico la libreria per la creazione di template

In the function xajax:

function test_function($Scaffale)

$statoRipiani = $this->mymodel->getStatoRipiani();
$objResponse = new xajaxResponse();
$objResponse->addAssign("SomeElementId","innerHTML", "Scaffale passato:".$this->getTabRipiani());

return $objResponse->getXML();

In above xajax function I call $this->mymodel->getStatoRipiani() that it has this code:

function getTabRipiani()
$tabRipiani = '<table align = "center">';

$StatoRipiani = $this->mymodel->getStatoRipiani();

for($i = 0; $i < count($StatoRipiani); $i++)
$tabRipiani .= "<tr>
if($StatoRipiani[$i] == 2)
$tabRipiani .= "<img src=\"".base_url()."system/application/immagini/scaffali_ripiani/Ripiani/pieno_ripiano.png\" width=\"100%\" height=\"20\" align =\"top left\"/>";
else if($StatoRipiani[$i] == 1)
$tabRipiani .= "<img src=\"".base_url()."system/application/immagini/scaffali_ripiani/Ripiani/mezzo_ripiano.png\" width=\"100%\" height=\"20\" align =\"top left\"/> ";
$tabRipiani .= "<img src=\"".base_url()."system/application/immagini/scaffali_ripiani/Ripiani/vuoto_ripiano.png\" width=\"100%\" height=\"20\" align =\"top left\"/> ";

$tabRipiani .= " </td>

$tabRipiani .= "</table>";

return $tabRipiani;


in above function I use base_url() function. This funtion belongs in codeigniter helper url.

<strong>The helper or another library of codeigniter must be called first you call $this->xajax->processRequests();</strong> becouse xajax not know what is base_url() function.

I hope you have understand becouse I don't speak very well english.

thank you all for your posts.

Try to put [ code ] tags around your code samples to make it easier to read. You can use "Code" button when editing your post.

Glad you got it fixed. It appears the model wasn't being loaded soon enough.

you're a genius coolfactor Smile))))

Theme © iAndrew 2016 - Forum software by © MyBB