Dynamically Processing Nodes
"Kirk Daries" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Guys,
Building a 'Grid' component into my project.
I've run into a bit of a problem.
The layout of a grid is defined in a xml file.
At runtime, the grid should render based on the layout/config in the
xml file.
E.g.
<DataGrid
Key="PromotionToNextGrade"
Name="Promotion To Next Grade"
Title="4.1. Promotions To The Next Grade">
<Platform ID="Oracle"
Sql="Select 'Hello World' from dual">
<GridRows>
<GridRow ID="RowOne" Label="Row One"/>
<GridRow ID="RowTwo" Label="Row Two">
<GridRow ID="RowTwoOne" Label="Row 2.1"/>
<GridRow ID="RowTwoTwo" Label="Row 2.2"/>
<GridRow ID="RowTwoThree" Label="Row 2.3"/>
<GridRow ID="RowTwoFour" Label="Row 2.4"/>
</GridRow>
<GridRow ID="RowThree" Label="Row Three"/>
<GridRow ID="RowFour" Label="Row Four"/>
</GridRows>
<GridColomns>
<GridColomn ID="ColOne" Label="Col One"/>
<GridColomn ID="ColTwo" Label="Col Two">
<GridColomn ID="ColTwoOne" Label="Col 2.1"/>
<GridColomn ID="ColTwoTwo" Label="Col 2.2"/>
<GridColomn ID="ColTwoThree" Label="Col 2.3"/>
</GridColomn>
<GridColomn ID="ColThree" Label="Col Three"/>
<GridColomn ID="ColFour" Label="Col Four"/>
</GridColomns>
</Platform>
</DataGrid>
Now, basic Grid functionality is easy.
However, I need to be able to build in Col spanning and Row spanning.
Here's a short example of what I require (Rowspanning).
<table border="1">
<tr>
<td colspan="3">Row 1</td>
<td><input type="Text" size="3"></td>
</tr>
<tr>
<td rowspan="3">Row 2</td>
<td colspan="2">Row 2.1</td>
<td><input type="Text" size="3"></td>
</tr>
<tr>
<td rowspan="2">Row 2.2</td>
<td>Row 2.2.1</td>
<td><input type="Text" size="3"></td>
</tr>
<tr>
<td>Row 2.2.2</td>
<td><input type="Text" size="3"></td>
</tr>
<tr>
<td colspan="3">Row 2.3</td>
<td><input type="Text" size="3"></td>
</tr>
</table>
Now, here's my iterator loop at this point in time.
<tr class="Dir::Iterate_Start.GridRows Dir::Iterate_Next.GridRows">
<td class="Dir::Get_Data.GridRows.Label" valign="top">[ROW
LABEL]</td>
</tr>
<tr class="Dir::Iterate_End.GridRows
Dir::Discard"><td>[DISCARD]</td></tr>
At the moment, I have Column and Row Objects.
A Column can be added other Columns. The same goes for Rows.
Now, once I process a row, I need to check if the current row contains
any children.
If it does, execute the same Iterator loop and process the child Rows.
Question is... how do I accomplish this...?
Urm....
Any one got any idea's?
Regards
KD
---------------------------------------------------------------
All views or opinions expressed in this electronic message
and its attachments are the view of the sender and do not
necessarily reflect the views and opinions of the
Provincial Government Western Cape (the PGWC).
No employee of the WCPG is entitled to conclude a
binding contract on behalf of the PGWC unless he/she
is an Accounting Officer of the PGWC, or his or her
authorised representative.
The information contained in this message and its attachments
may be confidential or privileged and is for the use of the
named recipient only, except where the sender specifically
states otherwise. If you are not the intended recipient you
may not copy or deliver this message to anyone.