[Laszlo-user] XPath/datapath question

Henry Minsky henry.minsky at gmail.com
Thu Jul 12 15:31:24 PDT 2007


I haven't looked at how the grid component works. I'm kind of scared of it
actually . I just have a heuristic I use when
certain things don't work properly, wrap an extra view around them. It's a
little more than black magic, but really it depends on specifically how the
grid component is talking to it's (replicated) child views, and I don't know
how that works :-(






On 7/12/07, Yang <a1pwak602 at sneakemail.com> wrote:
>
> Awesome. Why does that work, but not replicating the columns directly?
>
> Also, I couldn't seem to get a similar trick to work for the second case.
>
> On 7/12/07, Henry Minsky henry.minsky-at-......... |laszlo|
> <...> wrote:
> > Maybe something like this, with an intermediate view for each item?
> >
> > <canvas width="100%" height="80%" debug="true">
> >   <debug  fontsize="12"/>
> >
> >  <dataset name="maindata">
> >    <maindata>
> >      <item cell1="alpha" cell2="beta"    cell3="gamma" />
> >      <item cell1="delta" cell2="epsilon" cell3="zeta" />
> >    </maindata>
> >  </dataset>
> >   <grid datapath="maindata:/maindata">
> >    <view datapath="item[1]/@*">
> >      <gridtext/>
> >    </view>
> >  </grid>
> >
> >
> > </canvas>
> >
> >
> > On 7/12/07, Yang <a1pwak602 at sneakemail.com> wrote:
> > > I'd like to do something like the following:
> > >
> > >   <dataset name="maindata">
> > >     <maindata>
> > >       <item cell1="alpha" cell2="beta"    cell3="gamma" />
> > >       <item cell1="delta" cell2="epsilon" cell3="zeta" />
> > >     </maindata>
> > >   </dataset>
> > >   <grid datapath="maindata:/maindata">
> > >     <gridtext datapath="item[1]/@*"/>
> > >   </grid>
> > >
> > > However, this doesn't work. $* returns a set of name-value pairs as a
> > > dictionary object, not an array of values. Is there any way to get
> > > this to work?
> > >
> > > Similarly, the following doesn't work.
> > >
> > >   <dataset name="maindata">
> > >     <maindata>
> > >       <item>
> > >         <cell1>alpha</cell1>
> > >         <cell2>beta</cell2>
> > >         <cell3>gamma</cell3>
> > >       </item>
> > >       <item>
> > >         <cell1>delta</cell1>
> > >         <cell2>epsilon</cell2>
> > >         <cell3>zeta</cell3>
> > >       </item>
> > >     </maindata>
> > >   </dataset>
> > >   <grid datapath="maindata:/maindata">
> > >     <gridtext datapath="item[1]/*/text()"/>
> > >   </grid>
> > >
> > > Thanks for any pointers.
> > >
> >
> >
> >
> > --
> > Henry Minsky
> > Software Architect
> > hminsky at laszlosystems.com
> >
> >
>



-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20070712/d328b27b/attachment-0001.html


More information about the Laszlo-user mailing list