sacal
05-04-2004, 11:01 AM
I have 2 very basic XML files (attached). The first one (improjman.xml) contains most of the information, while the second one (tb_status.xml), contains only a list of possible phases in a project. (started, on hold, delivered...)
I am displaying this info inside a grid, and one of the columns I want to display the current project status (from improjman.xml) as the default text in a combobox, and the dropdown options should come from the tb_status file.
I got the drop down to work fine, but the default text seems to be looping through all the records in improjman.xml and displaying the last one, for all lines in the grid.
How do I get the value of the “status” in the current record and place it in the default text of the current combobox being populated?
Here's my code:
_______________________________
<canvas width="1000" height="640" bgcolor="#FFFFFF" debug="false">
<dataset name="dst_projInfo" request="true" src="improjman.xml"/>
<dataset name="dst_status" request="true" src="tb_status.xml"/>
<goldstyle name="specialstyle" />
<style name="darkGrayStyle" basecolor="0x747474" bgcolor="0xEDEDED" textcolor="white" />
<style name="insideTabStyle" textcolor="0x333333" />
<!-- WINDOW -->
<window name="ONE" title=".:: IM's Project Management App ::." x="10" y="10"
width="900" height="600" resizable="true" >
<tabslider x="0" y="0" width="${parent.width}" height="${parent.height - 44}" spacing="0"
slideduration="300" style="$once{darkGrayStyle}">
<tabelement text=">> Project List" width="${parent.width}" text_x="20"
selected="true">
<simplelayout axis="y" spacing="10" />
<grid id="foo" datapath="dst_projInfo:/dataroot" style="$once{specialstyle}" >
<gridcolumn showheader="false" width="30">
<view bgcolor="#CCCCCC" width="${parent.width}"
placement="header"
height="${parent.immediateParent.height-1}"/>
<text datapath="position()"/>
</gridcolumn>
<gridtext editable="true" datapath="@ID" datatype="number" >Project ID
</gridtext>
<gridtext editable="true" datapath="projectName/text()" width="200">Project
</gridtext>
<gridcolumn width="100"> Start date
<text datapath="startDate/text()" />
</gridcolumn>
<gridcolumn width="200"> Status
<!-- COMBO_BOX -->
<text/>
<combobox x="5" y="5" width="150" shownitems="5" datapath="dst_projInfo:/dataroot/project/milestones/task/status"
defaulttext="$path{'text()'}" value="$path{'@status'}" >
<textlistitem datapath="dst_status:/dataroot/status/txt" text="$path{'text()'}"
value="$path{'@value'}"/>
</combobox>
</gridcolumn>
<gridcolumn sortable="false"> Delivered
<checkbox value="$path{'@home_default'}"
xoffset="${10-parent.width/2}">
<method event="onvalue">
this.datapath.updateData();
</method>
</checkbox>
</gridcolumn>
</grid>
</tabelement >
<tabelement text=">> RFPs" text_x="20" />
<tabelement text=">> Milestones" text_x="20" />
<tabelement text=">> Contacts" text_x="20" />
</tabslider>
</window>
</canvas>
_______________________________
Thanks!
I am displaying this info inside a grid, and one of the columns I want to display the current project status (from improjman.xml) as the default text in a combobox, and the dropdown options should come from the tb_status file.
I got the drop down to work fine, but the default text seems to be looping through all the records in improjman.xml and displaying the last one, for all lines in the grid.
How do I get the value of the “status” in the current record and place it in the default text of the current combobox being populated?
Here's my code:
_______________________________
<canvas width="1000" height="640" bgcolor="#FFFFFF" debug="false">
<dataset name="dst_projInfo" request="true" src="improjman.xml"/>
<dataset name="dst_status" request="true" src="tb_status.xml"/>
<goldstyle name="specialstyle" />
<style name="darkGrayStyle" basecolor="0x747474" bgcolor="0xEDEDED" textcolor="white" />
<style name="insideTabStyle" textcolor="0x333333" />
<!-- WINDOW -->
<window name="ONE" title=".:: IM's Project Management App ::." x="10" y="10"
width="900" height="600" resizable="true" >
<tabslider x="0" y="0" width="${parent.width}" height="${parent.height - 44}" spacing="0"
slideduration="300" style="$once{darkGrayStyle}">
<tabelement text=">> Project List" width="${parent.width}" text_x="20"
selected="true">
<simplelayout axis="y" spacing="10" />
<grid id="foo" datapath="dst_projInfo:/dataroot" style="$once{specialstyle}" >
<gridcolumn showheader="false" width="30">
<view bgcolor="#CCCCCC" width="${parent.width}"
placement="header"
height="${parent.immediateParent.height-1}"/>
<text datapath="position()"/>
</gridcolumn>
<gridtext editable="true" datapath="@ID" datatype="number" >Project ID
</gridtext>
<gridtext editable="true" datapath="projectName/text()" width="200">Project
</gridtext>
<gridcolumn width="100"> Start date
<text datapath="startDate/text()" />
</gridcolumn>
<gridcolumn width="200"> Status
<!-- COMBO_BOX -->
<text/>
<combobox x="5" y="5" width="150" shownitems="5" datapath="dst_projInfo:/dataroot/project/milestones/task/status"
defaulttext="$path{'text()'}" value="$path{'@status'}" >
<textlistitem datapath="dst_status:/dataroot/status/txt" text="$path{'text()'}"
value="$path{'@value'}"/>
</combobox>
</gridcolumn>
<gridcolumn sortable="false"> Delivered
<checkbox value="$path{'@home_default'}"
xoffset="${10-parent.width/2}">
<method event="onvalue">
this.datapath.updateData();
</method>
</checkbox>
</gridcolumn>
</grid>
</tabelement >
<tabelement text=">> RFPs" text_x="20" />
<tabelement text=">> Milestones" text_x="20" />
<tabelement text=">> Contacts" text_x="20" />
</tabslider>
</window>
</canvas>
_______________________________
Thanks!