|
Not sure if I understand your problem here, but I
always define a dataset within a class, then just submit anything I need to it
using classroot, eg:
<class .....
<dataset name="getThreads"
request="false" type="http" src=""/'>foo.comsubmitThread.php"/> <method
name="getthethreads">
var d=classroot.getThreads; var
p=new LzParam(); var oid =
classroot.getAttribute(theid'); p.addValue("offer_id", oid,
true);
var typeofuser =
theusertype.getText(); p.addValue("userType", typeofuser,
true);
var f =
classroot.getThreads; f.setQueryString(p); f.doRequest();
</method>
<...>
</class>
hth
----- Original Message -----
Sent: Monday, October 02, 2006 9:52
AM
Subject: Re: [Laszlo-user] HTTP
request
That warnings goes with the
version of the code that uses the <submit> tag (I give the code in the
same email to avoid confusion). I
understand that if I defined outside a class a dataset, say DS, it could be
reach by var ds = canvas.datasets.DS.
Also, in the case of a script set, I do
not understant how the dataset could be accessed via MyClass.dataset.
In such a case, it would be static or class
member. But it is defined as other tag, so it should be instance
member. If not, it will be the same
for the text field and they should share the same value across various
instance. That would not allow us to
use 2 instances of the same form/window.
So, at the end, I'm completely confused about that dataset static
member of classes or not. How can the
<TEXT could be at instance level while the <DATASET would be static (at
class level) ??? Take that LZX as an
example :
<class closeable="true"
extends="window" name="PetCreate3" resizable="true" title="quick add a
pet"> <dataset
name="thedataset" request="false" type="http"
src=""/> <form>
<submit name="submitter" data=""/>
<view layout="axis: x;
spacing: 5" width="${parent.parent.width}"> <text
name="entryDatelabel" text="entryDate" y="1"/>
Internet [EMAIL PROTECTED]
02/10/2006 15:37
|
Please respond
to [EMAIL PROTECTED] |
|
|
To
| Jean-Baptiste
BRIAUD
|
|
cc
| laszlo-user
|
|
Subject
| Re: [Laszlo-user] HTTP
request |
|
It
should not matter where the dataset is defined. However, the assignment
you are using:
var ds = canvas.datasets.dataset
is attempting to
find the dataset as a dataset defined on the canvas. If your dataset is
defined within the class, you need to specifically reference the dataset
relative to the class.
Example:
var ds =
MyClass.thedataset;
Thanks, -bc
On
10/2/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
It is
interesting. There is a difference between my code and the example : the
dataset is define outside the class in the example.
Then, my question is : is it a good
design to define that dataset outside the window class ?
For example, if dataset is defined
outside the class, what will happen in case there are more than one instance
of that class ? 2
instances will share the same dataset, is it an issue ?
Thanks again, all of you, for your
help !
Internet [EMAIL PROTECTED]
02/10/2006 15:00
|
|
To
| Jean-Baptiste BRIAUD
|
|
cc
|
|
|
Subject
| Re: [Laszlo-user] HTTP
request |
|
While I do not have the example I created presently
available to me, I am confident that the example described in the following
link works:
http://www.laszlosystems.com/lps-3.3/docs/guide/data_app.html#d0e22758
In your code, is "var ds = canvas.datasets.dataset" referencing a valid
dataset that is defined?
Example:
<dataset name="dsSendData" request="false"
src="" type="http"/>
If so, you should be
using: var d=canvas.datasets.dsSendData;
I hope this helps, but if
not, will try to remember to send my own working code to demonstrate the
functionality once I get to my other
laptop.
Thanks, -bc
On
10/2/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]
> wrote:
Is doesn't work. The field dosen't even show. I care about using classes but
I do not care about submit. Is there other way of doiing that ?
I already try by a script like that
:
<button
text="Go !" x="50" y="190">
<method event="onclick">
<![CDATA[
var ds =
canvas.datasets.dataset; // Maybe there is better way to search for a dataset
??? Especially if they are in classes ???
var query = new
LzParam();
query.addValue( 'pouette',
"1", true );
query.addValue( XXXXX);
ds.setQueryString( query );
ds.doRequest();
]]>
</method>
</button>
None of my approaches had
worked ! Are classes concept mature enough in LZX ?
Have you tried placing the form elements as children of
the submitter? I'mnot sure if you can nest them if you want to use the
submitter to submit to the server. E.g.:
<form> <submit name="submitter"
data=""/> <text
name="entryDatelabel" text="entryDate" y="1"/>
<edittext resizable="true" name="entryDate" y="2"
width="${parent.width - (this.x + 50 )}" />
<text name="namelabel" text="name" y="1"/>
<edittext resizable="true" name="name" y="2" width="${parent.width -
(this.x + 50 )}" /> <text name="sexlabel"
text="sex" y="1"/> <edittext
resizable="true" name="sex" y="2" width="${parent.width - (this.x + 50 )}"
/> <button isdefault="true"
>Submit</button> </form>
HTH,
Adeola.
On 02/10/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]
> wrote:
HI the list,
I'd like to design windows with class so there can be several
instances. I don't
know if it the problem but I'm lost with a simple window that try to submit a
form with HTTP. That should be simple but I was not able to make it
work.
After hours
of various try I'm not able to reach my http server from a simple form
(example at the end). It might be a design issue, please help ! Any
advice is welcome as I'm in the dark...
I got warnings from the debug
windows on submit.lzx for example, but I think the issue is most probably in
my code, you know that ... :-)
I was able to reuse the example with the
echoer given in the documentation, so it is not a configuration issue. I'm
using the 3.3.3.
A big thanks in advance !
Here is the way I
call the form (this works) :
code:
<canvas debug="true"
title="petshop"> <splash/> <include
href=""/> <menubar> <menu
text="petshop"> <menuitem text="quick add a pet"/>
</menu> </menubar> </canvas>
and here is the form. This does not work, I
got nothing on server side. When I use the *same url* in the simple example
given in the doc it works. So, it is due to the class ? THis is the only
difference I can see. code:
<library>
<class closeable="true"
extends="window" name="PetCreate3" resizable="true" title="quick add a
pet"> <dataset name="thedataset" type="http"
src=""/> <form> <submit
name="submitter" data=""/> <view
layout="axis: x; spacing: 5" width="${parent.parent.width}">
<text name="entryDatelabel" text="entryDate"
y="1"/> <edittext resizable="true"
name="entryDate" y="2" width="${parent.width - (this.x + 50 )}"
/> </view> <view layout="axis:
x; spacing: 5" width="${parent.parent.width}">
<text name="namelabel" text="name" y="1"/>
<edittext resizable="true" name="name" y="2"
width="${parent.width - (this.x + 50 )}" />
</view> <view layout="axis: x; spacing: 5"
width="${parent.parent.width}"> <text
name="sexlabel" text="sex" y="1"/>
<edittext resizable="true" name="sex" y="2" width="${parent.width - (this.x
+ 50 )}" /> </view> <view
layout="axis: x; spacing: 5"> <button
isdefault="true"
>Submit</button>
</view> </form> </class> </library> This message and any attachments (the
"message") is intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with its
purpose, any dissemination or disclosure, either whole or partial, is
prohibited except formal approval. The internet can not guarantee the
integrity of this message.
BNP PARIBAS (and its subsidiaries) shall
(will) not therefore be liable for the message if modified.
---------------------------------------------
Ce message et
toutes les pieces jointes (ci-apres le
"message") sont etablis a
l'intention exclusive de ses destinataires et sont confidentiels. Si vous
recevez ce message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non
conforme a sa destination, toute diffusion ou toute publication, totale ou
partielle, est interdite, sauf autorisation expresse. L'internet ne
permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et
ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
_______________________________________________ Laszlo-user
mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
_______________________________________________ Laszlo-user
mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
-- Brandon
Castagna http://www.linite.com
_______________________________________________ Laszlo-user
mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
--
Brandon Castagna http://www.linite.com
_______________________________________________ Laszlo-user
mailing
list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
|