[ http://issues.apache.org/jira/browse/BEEHIVE-760?page=comments#action_66221 ] Carlin Rogers commented on BEEHIVE-760: ---------------------------------------
Here's some additional information... The problem is that the TreeHelpers.processTreeRequest() has not yet been called when the Controller's Action method calls TreeHelpers.findSelected(). The value for selected node on the server has not been updated when the Action is processed. The routine, TreeHelpers.processTreeRequest() is called from the Tree tag in the JSP and changes the selected node value. Therefor the call from the action to get the selected node returns the value before the request is completely processed. This seems to be by design and is even noted in the DRT, TreeGetSelected. See netui/test/webapps/drt/coreWeb/tree/getSelected/Controller.jpf and the note in the corresponding JSP, netui/test/webapps/drt/coreWeb/tree/getSelected/index.jsp > selected tree item getting set after the selectionAction is run > --------------------------------------------------------------- > > Key: BEEHIVE-760 > URL: http://issues.apache.org/jira/browse/BEEHIVE-760 > Project: Beehive > Type: Bug > Components: NetUI > Versions: V1Alpha, V1Beta > Reporter: Krista Baker > Assignee: Carlin Rogers > Fix For: TBD > Attachments: Controller.jpf, index.jsp > > TreeRootElement getSelectedNode() and TreeHelpers > findSelectedNode(TreeElement root) are both a selection item behind the > currently selected item. > Example tree: > Item0 > Item0.0 > JPF code snippet: > TreeRootElement myTree; > TreeHelpers myHelper; > @Jpf.Action(forwards = { > @Jpf.Forward(name = "success", > navigateTo=Jpf.NavigateTo.currentPage) > }) > protected Forward selectionAction() > { > TreeElement selected = myHelper.findSelected(myTree); > System.out.println("SELECTED: " + selected.getName()); > return new Forward("success"); > } > Repro steps with above snippets: > 1) If I click on Item0, the println is null and an error/warning is given > 2) If I then click on Item0.0, the following will be printed: > SELECTED: 0 > 3) If I click on Item0.0 again, the following will be printed: > SELECTED: 0.0 > Continue clicking and you will notice that the printed out selectedItem from > the selection action is always one selection behind what was actually clicked. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
