This (the lack of automatic layouts) is one of the Frequent Encountered Problems: http://wiki.openlaszlo.org/Gotchas

The other topic that came up yesterday, about clickable, is another one. I'll add it to the list when I get a chance, unless someone else beats me to it.

On Dec 6, 2005, at 8:22 PM, Adam Wolff wrote:
This is actually working as you would hope, you're just missing a
layout. Try this (notice the extra layout inside dataView)

 <view name="rowOfData" datapath="myData:/myXML[1]/person[1]">
    <simplelayout axis="x" />
    <view name="other pretty stuff"/>
    <view name="dataView">
        <simplelayout axis="x" />
        <text datapath="firstName/text()" />
        <text datapath="lastName/text()" />
        <text datapath="@show" />
    </view>
  </view>

On Dec 6, James Howe wrote:

I'm working on an application which is using a datapath.  In simple
cases I understand how they work, how they replicate objects for each
node, etc.  But I have a slightly more complicated way that I want to
access them and I'm not sure of the syntax.  For example, here is a
simple example from the chapter on data binding (Chapter 33):

<canvas height="80" width="500">
  <dataset name="myData">
    <myXML>
      <person show="simpsons">
        <firstName>Homer</firstName>
        <lastName>Simpson</lastName>
      </person>
      <person show="simpsons">
        <firstName>Marge</firstName>
        <lastName>Simpson</lastName>
      </person>
      <person show="simpsons">
        <firstName>Montgomery</firstName>
        <lastName>Burns</lastName>
      </person>
    </myXML>
  </dataset>

  <view name="rowOfData" datapath="myData:/myXML[1]/person[1]">
    <simplelayout axis="x" />
    <text datapath="firstName/text()" />
    <text datapath="lastName/text()" />
    <text datapath="@show" />
  </view>
</canvas>


Running this generates a single row with data about Homer. Now, suppose
I wanted to display more than the row of data.  Suppose I wanted to
decorate it somehow using a more complicated view structure.  Suppose
the view part looked more like this:

<canvas height="80" width="500">
  ...
  <view name="rowOfData" datapath="myData:/myXML[1]/person[1]">
    <simplelayout axis="x" />
    <view name="other pretty stuff"/>
    <view name="dataView">
    <text datapath="firstName/text()" />
    <text datapath="lastName/text()" />
    <text datapath="@show" />
    </view>
  </view>
</canvas>

How do I access the datapath information in the <text> tags? If I use the code above, I get no data, presumably because the datapaths in the
text elements don't have anything to hook up to because their parent
view has no datapath? There's probably a simple solution to this, but
I'm not sure how I would go about hooking up the text fields to a
datapath associated with a view higher up in the view hierarchy. Or is
there a better way to solve this problem?

Thanks!

_______________________________________________
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

Reply via email to