Hi here is a test code:

=======
EmbeddedGrid.tml:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
      xmlns:p="tapestry:parameter">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>embeddedgrid</title>
    </head>
    <body>
       <t:grid source="numbers" row="numLoop"/>   


    </body>
   </html>


=======

EmbeddedGrid.java

public class EmbeddedGrid {


    @Persist
    @Property
    private ArrayList<Number> numbers;

    @Property
    private Number numLoop;

    @Parameter(required=true)
    private int max;

    @SetupRender
    public void setupRendering() {
         numbers = new ArrayList<Number>(); 
         for(int i=0;i<max;i++) {
             numbers.add(new Number(i));
         }
    }



    public class Number {
        int id;
        int randNum;

        public Number(int id) {
            id = id;
            randNum=(new Random()).nextInt();
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getRandNum() {
            return randNum;
        }

        public void setRandNum(int randNum) {
            this.randNum = randNum;
        }
    }







}


=======

TestEmbeddedGrid.tml

<html t:type="layout" title="gridTest Index"
      t:sidebarTitle="Current Time"
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
      xmlns:p="tapestry:parameter">

    <t:loop source="numberGrids" value="loopgridMember">
        <t:embeddedGrid max="loopgridMember"/>

    </t:loop>


</html>

=======
TestEmbeddedGrid.java
public class TestEmbeddedGrid {

    @Property
    @Persist
    private ArrayList<Integer> numberGrids;

    @Property
    private Integer loopGridMember;


    @SetupRender
    public void onSetupRendering() {
        numberGrids=new ArrayList<Integer>();
        //draw 15 grids
        int amountRandNum = 15;//+((new Random()).nextInt())%30;
        //dynamic row content of each grid
        for(int i = 0 ; i < amountRandNum ; i++) {
            numberGrids.add(50+new Random().nextInt()%100);
        }
    }
}


=======
-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Grids-embedded-in-custom-component-interfer-with-each-other-tp5376183p5376353.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to