Just an idea -- check out rerunxpath in http://www.openlaszlo.org/
lps4/docs/reference/LzDatapath.html
On May 21, 2007, at 8:56 PM, Paulo Scardine wrote:
I'm a little lost here...
I made a login form containing a dataset and a datapointer (laszlo
4.0.x on Ubuntu):
<canvas>
<dataset name="login_query" src="http://localhost/login_query.php"
request="true" type="http" />
<view>
<simplelayout axis="y" />
<edittext id="edtLogin" text="login"/>
<edittext id="edtPass" text="password" password="true"/>
<button x="25" width="165" id="btnLogin" text="Send">
<handler name="onclick">
var d=canvas.datasets.login_query;
var p=new LzParam();
p.addValue("login", edtLogin.getText(), true);
p.addValue("password", edtPass.getText(), true);
Debug.write("Login: " + edtLogin.getText() + ", Password: " +
edtPass.getText() );
d.setQueryType('POST');
d.setQueryString(p);
d.doRequest();
</handler>
</button>
<datapointer id="dp_login" xpath="login_query:/">
<method name="ondata">
if (this.xpathQuery('result/text()') == 'OK') {
Debug.write("Operation succeeded");
} else {
Debug.write("Operation failed");
}
</method>
</datapointer>
</view>
</canvas>
The login_query.php application returns <result>OK</result> or
<result>ERROR</result>.
Why "ondata" is not triggered when d.doRequest() is called?
If I inspect the value with debugger it's changing!
lzx> dp_login.xpathQuery('result/text()')
'OK'
lzx> dp_login.xpathQuery('result/text()')
'ERROR'
What is wrong? This is driving me crazy for two days.
Thanks in advance,
--
Paulo
Benjamin Shine
Software Engineer, Open Laszlo / Laszlo Systems
[EMAIL PROTECTED]