Announcement

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

    IPickTreeItem : the content (DataSource) is only loaded on first click

    Hello,

    I would like to display a tree menu containing submenus, for that I use an IPickTreeItem.
    https://www.smartclient.com/smartgwt...kTreeItem.html

    I have an issue with this class because it seems that it only load the content on first click.

    Environment : SmartGWT 12 & GWT 2.8.2

    When I click on the list for the first time the content is partially displayed :
    Click image for larger version

Name:	first click.png
Views:	108
Size:	44.2 KB
ID:	259945


    The content is fully loaded when I loose the focus of the menu and after clicking back a second time :
    Click image for larger version

Name:	second click.png
Views:	86
Size:	107.6 KB
ID:	259946


    Here is the code :
    private final IPickTreeItem subjectSelect = new IPickTreeItem();

    SujetsTableXmlDS instance = SujetsTableXmlDS.getInstance();

    instance.fetchData(null, new DSCallback() {
    @Override
    public void execute(DSResponse response, Object rawData, DSRequest request) {
    logger.log(Level.INFO, "execute(DSResponse " + response + ", Object " + rawData + ", DSRequest " + request + ")");
    }
    });

    this.subjectSelect.setTitle("Sujet");
    this.subjectSelect.setWidth(210);
    this.subjectSelect.setTitleAlign(Alignment.LEFT);
    this.subjectSelect.setTextBoxStyle("ClientAreaStaticFieldLabel");
    this.subjectSelect.setTitleStyle("ClientAreaFieldTitle");
    this.subjectSelect.setDisplayField(SujetsTable.COL_LABEL);
    this.subjectSelect.setValueField(SujetsTable.COL_NOMCOMPLET);
    this.subjectSelect.setDataSource(instance);
    this.subjectSelect.setCanSelectParentItems(false);
    this.subjectSelect.setLoadDataOnDemand(false);

    hLayout1.addMember(this.getForm(this.subjectSelect, 48, 0, 2, true));

    From what I know for sure is that the DataSource is fully retrieved before the IPickTreeItem is displayed.

    I replaced IPickTreeItem with a simple Menu class instead of IPickTreeItem with the exact same DataSource and all the content was avalaible when I first clicked on it.

    Changing setLoadDataOnDemand to true does not resolve the problem plus every children of the list will be considered as submenus : Click image for larger version

Name:	setLoadDataOnDemand true.png
Views:	170
Size:	47.9 KB
ID:	259944
    https://www.smartclient.com/smartgwt....lang.Boolean-

    Any help will be appreciated

    Kind regards

    #2
    You haven't provided enough information to reproduce the problem. Make sure to test with the latest patched build as well (see smartclient.com/builds) - always do this before posting.

    Comment

    Working...
    X