Hi,
I have a piece of code that look very similar to the example code in http://www.smartclient.com/smartgwt/...ry_treebinding
It has a menu and I set the menu to have a ItemClickHandler by setItemClickHandler(). There is, however, a difference -- the menu items in my code are populated dynamically -- when I push to the menu, it would issue a fetch with a certain Criteria (I could see the RPC flied by).
Here are some snippet of the code.
Would the filterData() destory an ItemClickHandler that was previously set to a Menu?
Version: SmartClient Version: v10.0p_2015-06-28/PowerEdition Deployment (built 2015-06-28)
Browser: Tried on Firefox (26.0) and IE (9.0.8112.16421)
I have a piece of code that look very similar to the example code in http://www.smartclient.com/smartgwt/...ry_treebinding
It has a menu and I set the menu to have a ItemClickHandler by setItemClickHandler(). There is, however, a difference -- the menu items in my code are populated dynamically -- when I push to the menu, it would issue a fetch with a certain Criteria (I could see the RPC flied by).
Here are some snippet of the code.
Would the filterData() destory an ItemClickHandler that was previously set to a Menu?
Code:
private ItemClickHandler dexiClickHandler = new ItemClickHandler() { @Override public void onItemClick(ItemClickEvent event) { MenuItem item = event.getItem(); SC.say("Item clicked" + item.getAttributeAsString("id")); } }; ... Criteria criteria = new Criteria(); criteria.addCriteria("wbId", wbId); DataSource dataSource = DataSource.get("naraDexiDS"); recentDepSubMenu.setInitialCriteria(criteria); recentDepSubMenu.setCriteria(criteria); recentDepSubMenu.setDataSource(dataSource); recentDepSubMenu.addItemClickHandler(dexiClickHandler); /* * The next two lines are key -- even though a fetchData() may have been * issued when the menu is first drawn, a subsequent user-interaction * of pushing to the menu will trigger another filterData() that honors * the Criteria */ recentDepSubMenu.setAutoFetchData(true); // issue a fetch/filter upon first drawing recentDepSubMenu.setAutoFetchTextMatchStyle(TextMatchStyle.EXACT);
Browser: Tried on Firefox (26.0) and IE (9.0.8112.16421)
Comment