ICEfaces
  1. ICEfaces
  2. ICE-10468

ace:tree - Add ability to get relavant node objects for different events

    Details

      Description

      Feature Request: A request was made to be able to get the expanded node when an expand Ajax event was fired. Currently the states are just stored in the NodeStateMap. It would be good to have more details/objects available for the tree ajax events.

        Issue Links

          Activity

          Hide
          Arturo Zambrano added a comment -

          r48498: added TreeEvent event object to use in all ace:tree ajax event, providing a reference to the underlying data object related to the node involved in the event as well as the event type

          Show
          Arturo Zambrano added a comment - r48498: added TreeEvent event object to use in all ace:tree ajax event, providing a reference to the underlying data object related to the node involved in the event as well as the event type
          Hide
          Arturo Zambrano added a comment - - edited

          An example of its usage within the Showcase demos would be like this:

          	public void treeEvent(AjaxBehaviorEvent event) {
          		if (event instanceof TreeEvent) {
          			TreeEvent treeEvent = (TreeEvent) event;
          			System.out.println("*** Tree event");
          			System.out.println("expand event? " + treeEvent.isExpandEvent());
          			System.out.println("contract event? " + treeEvent.isContractEvent());
          			System.out.println("select event? " + treeEvent.isSelectEvent());
          			System.out.println("deselect event? " + treeEvent.isDeselectEvent());
          			System.out.println("reorder event? " + treeEvent.isReorderEvent());
          			Object data = treeEvent.getObject();
          			if (data != null) {
          				LocationNodeImpl locationNode = (LocationNodeImpl) data;
          				System.out.println("NAME: " + locationNode.getName());
          				System.out.println("TYPE: " + locationNode.getType());
          			}
          		}
          	}
          
          Show
          Arturo Zambrano added a comment - - edited An example of its usage within the Showcase demos would be like this: public void treeEvent(AjaxBehaviorEvent event) { if (event instanceof TreeEvent) { TreeEvent treeEvent = (TreeEvent) event; System .out.println( "*** Tree event" ); System .out.println( "expand event? " + treeEvent.isExpandEvent()); System .out.println( "contract event? " + treeEvent.isContractEvent()); System .out.println( "select event? " + treeEvent.isSelectEvent()); System .out.println( "deselect event? " + treeEvent.isDeselectEvent()); System .out.println( "reorder event? " + treeEvent.isReorderEvent()); Object data = treeEvent.getObject(); if (data != null ) { LocationNodeImpl locationNode = (LocationNodeImpl) data; System .out.println( "NAME: " + locationNode.getName()); System .out.println( "TYPE: " + locationNode.getType()); } } }
          Hide
          Arturo Zambrano added a comment -

          r48503: fix to provide the node being dragged during reorder events

          Previously the code was trying to get the node being reordered after the reordering had already taken place in the model. This fix calculates the node key in the new location to provide the correct node in the event object.

          Please re-test reorder events.

          Show
          Arturo Zambrano added a comment - r48503: fix to provide the node being dragged during reorder events Previously the code was trying to get the node being reordered after the reordering had already taken place in the model. This fix calculates the node key in the new location to provide the correct node in the event object. Please re-test reorder events.
          Hide
          Arturo Zambrano added a comment -

          r48553: added logic to determine the right node key in special reordering cases, in particular when a node reordering alters the indexes of the entire tree or subtree

          Show
          Arturo Zambrano added a comment - r48553: added logic to determine the right node key in special reordering cases, in particular when a node reordering alters the indexes of the entire tree or subtree
          Hide
          Carmen Cristurean added a comment -

          ICEfaces4 trunk r48560: verified showcase > ace:tree > all demos; ran ace:tree QA regressions on FF41, Chrome49, IE11, no issues found.

          Show
          Carmen Cristurean added a comment - ICEfaces4 trunk r48560: verified showcase > ace:tree > all demos; ran ace:tree QA regressions on FF41, Chrome49, IE11, no issues found.

            People

            • Assignee:
              Arturo Zambrano
              Reporter:
              Arran Mccullough
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: