Hey, William.
You can find some documentation on the function in
http://www.laszlosystems.com/lps-3.3/docs/reference/datapointer.html
about halfway down the page.
IIRC, the way you use it is, say you have two datapointers, DP1 and
DP2. So, in a script somewhere, you'd have:
DP1.setFromPointer("DP2");
...which would set DP1 to the same dataset/location/etc as DP2.
Hope this is helpful. I can provide examples if you need them; I
think it's also used in some stuff in svn.openlaszlo.org/labs and a
few other places.
- Josh
On 10/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> No, but I'll look into it. Is there any documentation or examples you
> can point me at so I can see how it's used?
>
>
>
> Quoting J Crowley <[EMAIL PROTECTED]>:
>
> > Sorry, I might be misreading/misinterpreting your question, but have
> > you tried setFromPointer()?
> >
> > - Josh
> >
> > On 10/2/06, William Krick <[EMAIL PROTECTED]> wrote:
> >> In my example code below, there's an "onselect" method for the first
> >> combobox.
> >>
> >> While the code works, I need it to be more generic so that I can apply the
> >> same logic to the rest of the comboboxes.
> >>
> >> Basically, from inside a combobox, I need to build a new datapath based on
> >> where I currently am, and then use that to set the datapath on the next
> >> combobox...
> >>
> >>
> >> var dp = this.getAttribute('datapath') + "[EMAIL PROTECTED]'" + this.value
> >> + "']" ;
> >> next_combobox.setDatapath( dp );
> >>
> >>
> >> Of course, that doesn't work.
> >>
> >> I'm sure there's some XPath magic involved but I can't find a good example.
> >>
> >>
> >> Any ideas?
> >>
> >>
> >>
> >>
> >>
> >> <canvas width="600" height="400">
> >>
> >> <class name="textlistitemx" extends="textlistitem">
> >> <method event="ondata">
> >> <!-- if I'm the first (or only) item in the list, -->
> >> <!-- make my parent select me -->
> >> <![CDATA[
> >> if( !this['clonenumber'] || this.clonenumber == 0 )
> >> this.parent.select(this);
> >> ]]>
> >> </method>
> >> </class>
> >>
> >>
> >> <dataset name="ds_symbols">
> >> <symbols>
> >> <year value="2007">
> >> <make value="AUDI">
> >> <model value="Q7 QUATTRO">
> >> <body value="UTL4X4 4 Dr">
> >> <vin value="WA1AV74L&7" symbol="23" />
> >> <vin value="WA1AV94L&7" symbol="24" />
> >> <vin value="WA1BV74L&7" symbol="24" />
> >> <vin value="WA1BV94L&7" symbol="25" />
> >> </body>
> >> </model>
> >> </make>
> >> <make value="CADILLAC">
> >> <model value="ESCALADE">
> >> <body value="UTL4X2 4 Dr">
> >> <vin value="1GY&C638&7" symbol="23" />
> >> </body>
> >> </model>
> >> <model value="ESCALADE AWD">
> >> <body value="UTL4X4 4 Dr">
> >> <vin value="1GY&K638&7" symbol="23" />
> >> </body>
> >> </model>
> >> <model value="ESCALADE ESV AWD">
> >> <body value="UTL4X4 4 Dr">
> >> <vin value="3GY&K668&7" symbol="23" />
> >> </body>
> >> </model>
> >> <model value="ESCALADE EXT AWD">
> >> <body value="SUT4X4 4 Dr">
> >> <vin value="3GY&K628&7" symbol="25" />
> >> </body>
> >> </model>
> >> </make>
> >> </year>
> >> </symbols>
> >> </dataset>
> >>
> >>
> >> <simplelayout axis="y"/>
> >>
> >> <combobox editable="false" name="cbyear" datapath="ds_symbols:/symbols">
> >> <method event="onselect">
> >> var dp = "ds_symbols:/symbols/[EMAIL PROTECTED]'" + this.value + "']";
> >> parent.cbmake.setDatapath( dp );
> >> </method>
> >> <textlistitemx datapath="year"
> >> text="$path{'@value'}" value="$path{'@value'}" />
> >> </combobox>
> >>
> >> <combobox editable="false" name="cbmake" datapath="">
> >> <method event="onselect">
> >> // ???
> >> </method>
> >> <textlistitemx datapath="make"
> >> text="$path{'@value'}" value="$path{'@value'}" />
> >> </combobox>
> >>
> >> <combobox editable="false" name="cbmodel" datapath="">
> >> <method event="onselect">
> >> // ???
> >> </method>
> >> <textlistitemx datapath="model"
> >> text="$path{'@value'}" value="$path{'@value'}" />
> >> </combobox>
> >>
> >> <combobox editable="false" name="cbbody" datapath="">
> >> <method event="onselect">
> >> // ???
> >> </method>
> >> <textlistitemx datapath="body"
> >> text="$path{'@value'}" value="$path{'@value'}" />
> >> </combobox>
> >>
> >> <combobox editable="false" name="cbvin" datapath="">
> >> <method event="onselect">
> >> // ???
> >> </method>
> >> <textlistitemx datapath="vin"
> >> text="$path{'@value'}" value="$path{'@value'}" />
> >> </combobox>
> >>
> >>
> >> </canvas>
> >>
> >>
> >> _______________________________________________
> >> 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
>
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user