IPickTreeItem display values randomly disappear

  1. Smart GWT and GWT version:
    I am using smartgwt 2.5 and gwt 2.3
    Also I am testing on ie 8 and the picktree is embedded in a page. No link to an external css file on the page itself.

  2. Client side problem:
    I have a ipicktreeitem that works fine for a majority of the time but on random occassions the tree blanks out all the display values. It blanks out the values when I click on the menu button and it starts to display the tree. Once it blanks the tree display values, it remains that way indefinitely until you recycle the application. There is no glitch in terms of the placement or css style sheets but rather that the displayed values on the picktree disappear for no reason.

  3. Sample Code:
    The code that I used is as follows(please note the only way I could get it to do it was by playing with the tree manually):

public class TestClass {
private IPickTreeItem searchPickTree;

public void onModuleLoad() {
searchPickTree = new IPickTreeItem();
searchPickTree.setCanSelectParentItems(true);
searchPickTree.setTitle(“Selected Location”);
searchPickTree.setShowTitle(true);
searchPickTree.setWrapTitle(false);
searchPickTree.setDataSource(OrgTreeDS.getInstance());
searchPickTree.setDisplayField(“name”);
searchPickTree.setValueField(“orgId”);
searchPickTree.addChangedHandler(new ChangedHandler() {
public void onChanged(
ChangedEvent event) {
// added this below to see if it would fix the display issue
searchPickTree.redraw();
}
});
}
}

public class OrgTreeDS extends DataSource {

private static OrgTreeDS instance = null;   

public static OrgTreeDS getInstance() {   
    if (instance == null) {   
        instance = new OrgTreeDS("orgTreeDS");   
    }   
    return instance;   
}   

public OrgTreeDS(String id) {   

    setID(id);   
    setTitleField("Name");   
    setRecordXPath("/list/org");   
    DataSourceTextField nameField = new DataSourceTextField("name", "name", 128);   

    DataSourceTextField idField = new DataSourceTextField( "orgId", "orgId" );   
    idField.setPrimaryKey(true);   
    idField.setRequired(true);   

    DataSourceTextField parentField = new DataSourceTextField( "parentId", "parentId" );   
    parentField.setRequired(true);
    parentField.setForeignKey(id + ".orgId");
    parentField.setRootValue("o0");


    setFields( nameField, idField, parentField );   

    setDataURL("/org.xml");
    setClientOnly(true);   
}   

}

<?xml version=“1.0” encoding=“utf-8” ?>
<list>
<org>
<orgId>o23</orgId>
<name>Sample Corporation</name>
<parentId>o0</parentId>
</org>
<org>
<orgId>e10144</orgId>
<name>Sample Location 1</name>
<parentId>o23</parentId>
</org>
<org>
<orgId>e10143</orgId>
<name>Sample Location 2</name>
<parentId>o23</parentId>
</org>
<org>
<orgId>e10042</orgId>
<name>Sample Location 3</name>
<parentId>o23</parentId>
</org>
<org>
<orgId>e10051</orgId>
<name>Sample Location 4</name>
<parentId>o23</parentId>
</org>
<org>
<orgId>e10683</orgId>
<name>Sample Location 5</name>
<parentId>o23</parentId>
</org>
</list>

We’ve never seen another report of this, but if you can isolate this to a minimal, completely standalone test case (no other HTML or widgets) and you can provide reliable instructions to reproduce (it’s OK to say: repeat 10 times and it always happens at least once, but not OK to say only that you can usually reproduce it but don’t know how) then we can take a look.

IPickTree display values disappear

The code above is the stand alone code(except for the import statements which I excluded for brevity).

Unfortunately the nature of the bug is random as far as I can see, and I don’t know how to actually reproduce the behaviour. It seems linked to the mouse over or click on the picktree and happens once in about thirty mouse clicks or more, the exact number is not definitive. The only other thing I can do is show a screen shot.

I did open the isc.showConsole at one point and I could see the xml was loaded. I saw the complete xml and later it on in the console it said it was unstructured.

I just got a debug printout from the console after it wiped out the display values(my xml data is slightly different from the example above but the structure is the same). Note the field “name” in the debug from the object shows that it is set and has a value, yet the screen is blank. Also I just captured this from chrome. So I am wondering if its an issue with gwt 2.3 and smartgwt 2.5 interaction.

Global Log Priorities updated: Logging messages at priority ‘Debug’ and above for category ‘Log’.
23:40:22.228:TMR9:INFO:redraws:isc_SelectionTreeMenu_0_childrenSubMenu_1_body:Scheduling redraw (setData)
23:40:22.229:TMR9:INFO:redraws:isc_SelectionTreeMenu_0_childrenSubMenu_1_body:Immediate redraw of dirty widget (show() on parent while dirty)
23:40:22.248:RDQ6:DEBUG:redraws:clearRedrawQueue: 0 redraws (1 items), 0ms
23:40:22.490:TMR5:INFO:redraws:isc_SelectionTreeMenu_0_childrenSubMenu_1_body:Scheduling redraw (setData)
23:40:22.490:TMR5:INFO:redraws:isc_SelectionTreeMenu_0_childrenSubMenu_1_body:Immediate redraw of dirty widget (show() on parent while dirty)
23:40:22.512:RDQ3:DEBUG:redraws:clearRedrawQueue: 0 redraws (1 items), 0ms
23:40:22.720:TMR8:INFO:redraws:isc_SelectionTreeMenu_0_childrenSubMenu_1_body:Scheduling redraw (setData)
23:40:22.721:TMR8:INFO:redraws:isc_SelectionTreeMenu_0_childrenSubMenu_1_body:Immediate redraw of dirty widget (show() on parent while dirty)
23:40:22.740:RDQ4:DEBUG:redraws:clearRedrawQueue: 0 redraws (1 items), 0ms
23:41:07.878:MUP9:INFO:redraws:isc_SearchForm_0:Scheduling redraw (2 children) (isc_IPickTreeItem_1: redrawFormItem)
23:41:07.878:MUP9:INFO:redraws:isc_IPickTreeItem_1_button_label:Scheduling redraw (setContents)
23:41:07.879:MUP9:INFO:redraws:isc_IPickTreeItem_1_button:Scheduling redraw (no reason provided)
Class.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef)
Canvas.$q9(_1=>undef, _2=>undef)
Canvas.markForRedraw(_1=>undef)
StatefulCanvas.setTitle(_1=>undef)
TreeMenuButton.setSelectedItem(_1=>Obj{name:Veolia - Evansville 21290})
TreeMenuButton.$21j(_1=>Obj{name:Veolia - Evansville 21290})
SelectionTreeMenu.itemClick(_1=>Obj{name:Veolia - Evansville 21290}, 1)
Menu.selectMenuItem(_1=>Obj{name:Veolia - Evansville 21290}, _2=>1)
Menu.rowClick(_1=>Obj{name:Veolia - Evansville 21290}, _2=>4, _3=>1)
[a]GridBody.rowClick(record=>Obj{name:Veolia - Evansville 21290}, rowNum=>4, colNum=>1)
GridRenderer.$29y(_1=>4, _2=>0)
GridRenderer.click(Obj, undef)
Canvas.handleClick(_1=>Obj, _2=>undef)
[c]EventHandler.bubbleEvent(_1=>[GridBody ID:isc_SelectionTreeMenu_0_childrenSubMenu_0_body], _2=>“click”, _3=>undef, _4=>undef)
[c]EventHandler.handleClick(_1=>[GridBody ID:isc_SelectionTreeMenu_0_childrenSubMenu_0_body], _2=>undef)
[c]EventHandler.$k5(_1=>[object MouseEvent], _2=>undef)
[c]EventHandler.handleMouseUp(_1=>[object MouseEvent], _2=>undef)
[c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object MouseEvent])
anonymous(event=>[object MouseEvent])

23:41:07.894:RDQ0:INFO:redraws:isc_IPickTreeItem_1_button:Immediate redraw of dirty widget (CanvasItem getting new size)
23:41:07.913:RDQ0:DEBUG:redraws:clearRedrawQueue: 2 redraws (3 items), 22ms
23:41:08.391:INFO:redraws:isc_HrAdminClient_4_0_body:Scheduling redraw (50 children) (setData)
23:41:09.382:RDQ9:INFO:redraws:isc_HrAdminClient_4_0_body_vscroll_thumb_label:Scheduling redraw (resize)
23:41:09.388:RDQ9:DEBUG:redraws:clearRedrawQueue: 1 redraws (1 items), 993ms

BlankIPickTree.jpg

This last mention (that the XML response is sometimes blank) suggests that your server intermittently sends blank responses (and the component is rendering them faithfully).

Even if the code could run standalone, you should still actually run it standalone in an unmodified SDK in a clean project. This eliminates all your customizations, including those you forgot about or assumed could not have an effect :slight_smile:

First let me preface all that I have said that this product is great and that I very much like it. Also given this nature of an issue that I am seeing is not necessarily systemic of component itself. But hopefully to make you aware that there maybe an issue somehow buried in it and to just keep an eye out.

I would also say don’t worry too much over this because there are probably more important things to fix than this.

If it will help please the read this paragraph in it’s entirety as it contains some observations: I can tell you the xml response that I am getting is not blank. The debug from the isomorphic console shows that it is not blank either,“Menu.selectMenuItem(_1=>Obj{name:Veolia - Evansville 21290}, _2=>1)” <– note the “name:” so the value is there. Only the actual display is blank as was shown in screenshot. It’s almost as if the data was shifted to the left out of the clipped region. Because you can see the arrow is also hugging the left side instead of to the right on the menu. Almost like the calendar picker with year selection was doing, skewing the year selection. If what was actually returning was a blank or null, I probably would have expected the output on the screen to shorten the actual menu size down to one character on a redraw. Instead though it’s keeping the size of the menu the same as if text was there. I suspect that it may shifting the contents because I also noticed the empty menu(message is gone and box is now small empty rectangle) becomes skewed as well, i.e. it’s not next to the menu but it is skewed by a centimeter. It may be that the text is first being absolutely positioned at one point on the screen then the underlying graphic is being positioned in another part of the screen. When it’s displaying the underlying graphic box it somehow realized that it was supposed to shift the menu box to the right but it left the text on the left side and when it merges the display you see the menu with blank spots on it except for the arrow.

I do aggree that their maybe some other javascript that maybe playing havoc here or some inline style sheet that is somehow blanking it out is possible. Though I dont know because it seems that gwt 2.3 just came out and 2.5 smartgwt and hopefully its not causing some interaction problem.

More likely what I will have to do is replace it with some other idiom, i.e. a list tree grid and button. In fact most of the other components that I have seen have worked flawlessly within some caveats. I suspect that since list grid seems almost bullet proof so far. A list grid tree might work in place of this. Or I could isolate the entire module into a separate iframe(page), thereby eliminating any css, javascript files, and extraneous html from the equation( a body with one lone div to embed the module ).

Your theory about DOM being shifted around isn’t very plausible, but you can check it in Firebug by looking at the rendered DOM when the menu comes up blank.

Likewise there’s no plausible way GWT 2.3 could create an interaction that causes this problem, but you could check by downgrading.

Again, if you can find a reliable way of reproducing the problem with minimal code in an unchanged SDK, we can take a look. Instructions to “just click around” aren’t really good enough because we have learned time and again that when we try to reproduce a problem using such instructions, it doesn’t work - the user is typically doing something very specific and special.

  1. SmartGWT : 3.0 GWT: 2.4

  2. Firefox 10

I am having the same trouble with the IPickTreeItem values dissapearing from view. It seems it hapens after displaying a different menu component of my application (a context menu with right-button).
If I click displaying a menu and then return to the IPickTreeItem, some items (not the first level ones but the second level second ones).
Hope this can help to fix the problem.