Sigma Php Ajax framework, Ajax Components, GUI Builder
May 23, 2012, 09:24:26 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Databinder problem  (Read 2397 times)
alikara
Jr. Member
**
Posts: 5


View Profile
« on: November 19, 2009, 01:48:17 AM »

Hi,

First of all I would like to thank you for creating so useful tool.

My problem is with databinder while sending parameter to php file which updates the database.
My code:

 var data=this.databinder1.getValue();
                data =_.serialize(data);

 linb.Ajax(Adres+'/modules/data/test/server.php',
             data,
             function(response){
                      linb.message(response);
                  },
             function(msg){
                      linb.message("onFail: " + msg);
                  },
             threadid,
             {method:'GET'}).start();

It works, when I post parameter directly in address like that:


 linb.Ajax(Adres+'/modules/data/test/server.php?customerid=1001',
             "",
             function(response){
                      linb.message(response);
                  },
             function(msg){
                      linb.message("onFail: " + msg);
                  },
             threadid,
             {method:'GET'}).start();

and I'm sure databinder do its job, because I wrote alert(data) in order to see inside databinder.

Consequently:
Databinder has all data correctly, but I cannot send data via databinder and receive them in php file. I'm using standard $_GET["customerid"] in php file.

Where is my fault?
Thanks
Ali

Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #1 on: November 19, 2009, 03:42:36 AM »

remove this line: data =_.serialize(data);

If you serialize it, you will send url like:

server.php?{"customerid":"1001"}

Logged
alikara
Jr. Member
**
Posts: 5


View Profile
« Reply #2 on: November 19, 2009, 05:42:08 AM »

Hi Linb,

Thank you for rapid answer.

I removed the line: data=_.serialize(data);
However It's still same. I suppose I'm missing something.

I'm sending index.js attached.
I'd appreciate it, if you look at the file and tell me what is wrong with my code.

Thanks.

P.S: As I said previously, server.php file is using standard $_GET[]. Does it cause any failure? or is there any special coding in Sigma Framework that I should apply?
« Last Edit: November 19, 2009, 09:31:10 AM by alikara » Logged
alikara
Jr. Member
**
Posts: 5


View Profile
« Reply #3 on: November 19, 2009, 09:46:41 AM »

Hi again,

It finally works!! I used IAjax instead of Ajax. Then it worked Smiley

I'm sure linb.Ajax also works fine, but I couldn't make it worked.
Anyway, thank you Linb.
Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #4 on: November 19, 2009, 04:37:06 PM »

I noticed you are using the old version, you can get the latest code from svn: http://linb.googlecode.com/svn/trunk/jsLinb2.2/
Logged
alikara
Jr. Member
**
Posts: 5


View Profile
« Reply #5 on: November 20, 2009, 11:50:20 AM »

Thanks for informing about the latest version.

However I couldn't carry my code to new version.
It gives databinder error like:

"TypeError: linb.dataBinder is undefined"

Then I tried creating my application from beginning in new platform. But I got the same databinder error, when I connected an inputbox to the databinder.

Is there any known bug with databinder in v2.2?
Or am I missing anything?

Thanks for your help, linb.
« Last Edit: November 20, 2009, 12:45:46 PM by alikara » Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #6 on: November 20, 2009, 05:51:46 PM »

It's a new bug, fixed now, please update code from svn.

If you find any other bugs in the latest version, just post here, I'll fix them ASAP.
« Last Edit: November 20, 2009, 05:54:30 PM by linb » Logged
alikara
Jr. Member
**
Posts: 5


View Profile
« Reply #7 on: November 21, 2009, 01:01:29 AM »

It works! Thanks linb.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!