Trying to create a dynamic layout. In the row with no explicit column, one is generated and the layout gets messed up:

define page root() {
    table{
    row{
            column{"A"}
            column{"B"}
    }
    row{ 
            placeholder layout_ph{GenerateLayout()}
        }
    }
}

define ajax GenerateLayout(){
    if (1==2){ //Just some condition
        column[id := singlecolumn, colspan:="2"]{"C & D"}
    }
    else{
        column[id:=columnone]{"C"}
        column[id:=columntwo]{"D"}
    }
}

Resulted HTML:

<table>
    <tbody>
        <tr>
            <td>A</td>
            <td>B</td>
        </tr>
        <tr>
            <td>
                <span id="layout_ph"><span id="GenerateLayout" class="scopediv GenerateLayout"></span></span>
            </td>
            <td id="columnone">C</td>
            <td id="columntwo">D</td></tr>
    </tbody>
</table>

As you can see, one extra column was added.

Submitted by Victor Hurdugaci on 29 March 2010 at 16:04

On 29 March 2010 at 16:35 Danny Groenewegen commented:

The auto-adding of rows and columns inside tables is going to be removed entirely in a future version of WebDSL.

Work around: use the html tags for tables instead of webdsl elements to avoid having columns added,
see http://webdsl.org/selectpage/Pages/XMLEmbedding.


On 29 March 2010 at 16:38 Victor Hurdugaci commented:

Nice work around! Thanks!


On 8 December 2010 at 13:59 Danny Groenewegen tagged 1.2.6

On 4 January 2011 at 12:47 Danny Groenewegen closed this issue.

Log in to post comments