1. #1
    Ext GWT Premium Member
    Join Date
    Jul 2009
    Posts
    104
    Vote Rating
    0
    VadimV1144 is on a distinguished road

      0  

    Question Templates and GXT components help

    Templates and GXT components help


    Hi,

    Is it possible to display a CheckBox inside a template?
    I am trying to display a list of options (checkbox with a label) as a ListView, but when I use the modified code in the ListView example, I get "(null handler)".

    Here is the view definition:
    Code:
            
    view = new ListView<Util.EnumModel>() {
                @Override
                protected Util.EnumModel prepareData(Util.EnumModel model) {
                    CheckBox checkbox = new CheckBox();
                    String name = model.<String>get(Util.EnumModel.ENUM_DISPLAY_NAME_ID);
                    checkbox.setName(name);
                    checkbox.setBoxLabel(name);
                    checkbox.setWidth(100);
                    model.set("name", name);
                    model.set("checkbox", checkbox);
                    return model;
                }
            };
    Here is the template definition:
    Code:
        private native String getRestaurantPhotoTemplate() /*-{
        return ['<tpl for=".">',
            '<div class="filter-wrap" id="{name}" style="border: 1px solid white">',
            '<div class="filter">{checkbox}</div>',
            '<span class="x-editable"></span></div>',
            '</tpl>',
            '<div class="x-clear"></div>'].join("");
        }-*/;
    PS
    Is there something I can read on the templates besides the jdocs?

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,691
    Vote Rating
    107
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    A template is string based and not widget based. Dont create w checkbox widget. Create the html string that represents an html checkbox.

  3. #3
    Ext GWT Premium Member
    Join Date
    Jul 2009
    Posts
    104
    Vote Rating
    0
    VadimV1144 is on a distinguished road

      0  

    Default


    ok, thank you.

    What about some general XTemplate documentation? Can you point me to some docs (aside from exaples and jdocs)?

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,691
    Vote Rating
    107
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    There is no other documentation yet. We are working on that

  5. #5
    Ext GWT Premium Member
    Join Date
    Jul 2009
    Posts
    104
    Vote Rating
    0
    VadimV1144 is on a distinguished road

      0  

    Default


    thanks