[Laszlo-user] Selecting a node in a list to populate a form

Bryan Barkley bbarkley at gmail.com
Mon Mar 13 11:05:28 EST 2006


I believe the datapath attribute must be an xpath expression into a dataset,
not a reference to a datapointer. In your onselect you may want to try
something along the lines of
canvas.userDetailsWindow.datapath.setFromPointer(getSelection()).

  - Bryan

On 3/11/06, Matt Raible <mraible at gmail.com> wrote:
>
> I have a grid that I'm using to display a bunch of users:
>
>     <dataset name="userDset"/>
>     <datapointer id="userDp"/>
>
>             <grid datapath="userDset:/"
> width="${immediateparent.width}" height="${immediateparent.height}"
>                 onselect="userDp = getSelection();
> canvas.userdetailsWindow.setVisible(true)">
>                 <gridtext datapath="id/text()" width="100"
> editable="false">Id</gridtext>
>                 <gridtext datapath="firstName/text()" width="100"
> editable="false">First Name</gridtext>
>                 <gridtext datapath="lastName/text()" width="100"
> editable="false">Last Name</gridtext>
>                 <gridtext datapath="birthday/text()" width="80"
> editable="false">Birthday</gridtext>
>             </grid>
>
> When a user clicks on the row, I want to popup a form that contains
> editable fields.  I believe the following should properly indicate
> which record to edit:
>
> onselect="userDp = getSelection(); canvas.userdetailsWindow.setVisible
> (true)">
>
> However, I don't know what to set my form view's datapath to.  I've
> tried "userDp:/item" and userDp:/*, but it doesn't work:
>
>         <view name="userdetailsView" width="${immediateparent.width}"
> height="${immediateparent.height}"
>             layout="axis: y" datapath="userDp:/item">
>             <text name="id" visible="false" datapath="id/text()"/>
>             <text y="10">First Name:</text>
>             <edittext name="firstName" datapath="firstName/text()"
> x="80" y="10"/>
>             <text y="35">Last Name:</text>
>             <edittext name="lastName" datapath="lastName/text()" x="80"
> y="35"/>
>         </view>
>
> Any help is appreciated.
>
> Matt
>
> _______________________________________________
> Laszlo-user mailing list
> Laszlo-user at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20060313/b4383621/attachment.html


More information about the Laszlo-user mailing list