PDA

View Full Version : Ch. 30 Building Data Driven Applications


rickm
12-28-2004, 10:05 AM
Hi,
I'm working on a similar example as the data driven example. I've got about 10 lines of text and when I click a line I want additional data to appear below the line I clicked. My text keeps appearing below all the lines instead of the selected on...not sure what I'm doing wrong...my views are similar to the ones in Ch. 30.
I'm wondering if anyone else has some examples in this area that I can look at to see what I might be doing wrong...
Here's the code:

<window width="450" id="wDynamo" title="ATG Dynamo Stats" visible='false' closeable="true">
<view name="myTable">
<simplelayout axis="y"/>
<view name="vDynamo" datapath="dynSummary:/XML/site" >
<simplelayout axis="y"/>
<view onclick="showDynAppServer.setVisible(!showDynAppServer.visi ble);">
<simplelayout axis="x" />
<dText datapath="@code" />
<dText datapath="@sessions" />
<dText datapath="@sales" >
<method name="applyData" args="d" >
this.setText('$' + d);
switch(d) {
case 'Sales':
this.setText("&lt;u&gt;" + d + "&lt;/u&gt;");
this.setAttribute('fontsize',12);
break;
}
</method>
</dText>
<dText datapath="@orders" />
</view>
<view id="showDynAppServer" visible="false">
<dtext datapath="app/@id" >
</view>
</view>
</view>
</window>


Regards,
Rick

rickm
12-28-2004, 01:35 PM
I think the problem was that I was using ID instead of name...in which case it would probably use the last view I set to the id...I changed it to name and it works now.