Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TreeGrid hideField compile error

    Hi guys,

    I currently have a treegrid with a number of columns. Depending on what view the user is on I want to hide/display certain of the columns in the tree. So I figured the best way to achieve this functionality would be to create a tree with all the fields and then loop over the columns to hide the ones that aren't needed for a certain view.
    e.g.
    [code]
    //array with all colums that I want to hide in the tree
    private String[] allViewCols = {"Name", "Type", "ParentArtifactId","ArtifactActive","ArtifactId"
    };

    ....

    myTree.setFields(fieldName, fieldType, fieldArtId, fieldArtAct, fieldArtPar, fieldDiscipline, fieldDiscAct, fieldResourceDev,
    fieldResourceTest);
    HideAllColumns(myTree);

    ....

    //loop over all fields in array and hide them
    public void HideAllColumns(TreeGrid myTree) {
    for (int i = 0; i < allViewCols.length; i++) {
    wbsTree.hideField(allViewCols[i]);
    }
    }
    [\code]

    Everything compiles fine but as soon as the hosted browser is launched this error occurs:

    [CODE]
    [ERROR] Unable to load module entry point class com.wolwa.emp.client.login.SmartLoginManager (see associated exception for details)
    com.google.gwt.core.client.JavaScriptException: (TypeError): _7 has no properties
    fileName: http://localhost:8888/com.wolwa.emp.LoginManager/sc/modules/ISC_Grids.js
    lineNumber: 2030
    stack: ()@http://localhost:8888/com.wolwa.emp.LoginManager/sc/modules/ISC_Grids.js:2030
    ()@http://localhost:8888/com.wolwa.emp.LoginManager/sc/modules/ISC_Grids.js:2031
    ("Type")@http://localhost:8888/com.wolwa.emp.LoginManager/sc/modules/ISC_Grids.js:868
    ("Type")@jar:file:/home/keisari/.m2/com/smartgwt/smartgwt/1.0b2-SNAPSHOT/smartgwt-1.0b2-SNAPSHOT.jar!/com/smartgwt/client/widgets/grid/ListGrid.java:4953
    gwtOnLoad([object Window],"com.wolwa.emp.LoginManager","1.5")@:0
    gwtOnLoad((function () {alert("Failed to load module com.wolwa.emp.LoginManager\".\nPlease see the log in the development shell for details.");}),"com.wolwa.emp.LoginManager","http://localhost:8888/com.wolwa.emp.LoginManager/")@http://localhost:8888/com.wolwa.emp.LoginManager/hosted.html?com_wolwa_emp_LoginManager:20
    maybeStartModule()@http://localhost:8888/com.wolwa.emp.LoginManager/com.wolwa.emp.LoginManager.nocache.js:100
    ()@http://localhost:8888/com.wolwa.emp.LoginManager/com.wolwa.emp.LoginManager.nocache.js:393
    @http://localhost:8888/com.wolwa.emp.LoginManager/hosted.html?com_wolwa_emp_LoginManager:39

    at com.smartgwt.client.widgets.grid.ListGrid.hideField(Native Method)
    at com.wolwa.emp.client.login.SmartWBSWidget.HideAllColumns(SmartWBSWidget.java:540)
    at com.wolwa.emp.client.login.SmartWBSWidget.<init>(SmartWBSWidget.java:299)
    at com.wolwa.emp.client.login.SmartSessionManagerWidget.Init(SmartSessionManagerWidget.java:73)
    at com.wolwa.emp.client.login.SmartSessionManagerWidget.<init>(SmartSessionManagerWidget.java:56)
    at com.wolwa.emp.client.login.SmartLoginManager.onModuleLoad(SmartLoginManager.java:41)
    [\CODE]

    If I just hide each field manually, e.g. without the loop everything works fine so I'm pretty stumped to what the problem is. Also hiding each column manually e.g.

    [CODE]
    myTree.hideField(allViewCols[2]);
    myTree.hideField(allViewCols[4]);
    myTree.hideField(allViewCols[5]);
    [\CODE]

    Runs extremely slow. So I don't know if this is the correct approach at all.

    I'm on Ubuntu and pulling all dependencies from the maven repo.


    Hope you guys can shed some light on this problem.

    Thanks, and keep up the awesome work.

    PS. The code tag doesn't seem to work
    Last edited by keisari; 12 Jan 2009, 10:12.

    #2
    Try calling setHidden() on the fields instead (using the latest build from SVN)

    The code tag works, but mind the syntax (straight bracket, unlike HTML angle brackets).

    Comment

    Working...
    X