Can you please suggest how to implement AonTreeNodeView class as it requires HasDataPresenter class in its constructor. Could you please share the code. It is used in CellTreeNodeView inside static class NodeCellList.
On Wednesday, February 20, 2013 12:54:19 PM UTC+5:30, magesh kumar wrote:
-- On Wednesday, February 20, 2013 12:54:19 PM UTC+5:30, magesh kumar wrote:
Yea Sure.... There is a onBrowserEvent in the CellTree..............@Overridepublic void onBrowserEvent(Event event) {AonCellBasedWidgetImpl.get().onBrowserEvent(this, event); if (isRefreshing) {// Ignore spurious events (onblur) while replacing elements.return;}super.onBrowserEvent(event);String eventType = event.getType();if ("focus".equals(eventType)) {// Remember the focus state.isFocused = true;onFocus();} else if ("blur".equals(eventType)) {// Remember the blur state.isFocused = false;onBlur();} else if ("keydown".equals(eventType) && !cellIsEditing) {int keyCode = event.getKeyCode();switch (keyCode) {// Handle keyboard navigation.case KeyCodes.KEY_DOWN:case KeyCodes.KEY_UP:case KeyCodes.KEY_RIGHT:case KeyCodes.KEY_LEFT:handleKeyNavigation(keyCode);// Prevent scrollbars from scrolling.event.preventDefault();return;case 32:// Prevent scrollbars from scrolling.event.preventDefault();}}final Element target = event.getEventTarget().cast();ArrayList<Element> chain = new ArrayList<Element>();collectElementChain(chain, getElement(), target);final boolean isMouseDown = "mousedown".equals(eventType);final boolean isClick = "click".equals(eventType);final AonTreeNodeView<?> nodeView = findItemByChain(chain, 0, rootNode);if (nodeView != null) {if (isMouseDown) {Element showMoreElem = nodeView.getShowMoreElement();try {nodeView.setOpen(!nodeView.isOpen(), true); return;} catch (Exception e) {System.out.println("Error");}if (nodeView.getImageElement().isOrHasChild(target)) { // Open the node when the open image is clicked.nodeView.setOpen(!nodeView.isOpen(), true); return;} else if (showMoreElem != null&& showMoreElem.isOrHasChild(target)) { // Show more rows when clicked.nodeView.showMore();return;}}// Forward the event to the cellif (nodeView != rootNode&& nodeView.getSelectionElement().isOrHasChild(target)) { // Move the keyboard focus to the clicked item.if (isClick) {/** If the selected element is natively focusable, then we do* not want to steal focus away from it.*/boolean isFocusable = AonCellBasedWidgetImpl.get().isFocusable(target);isFocused = isFocused || isFocusable;keyboardSelect(nodeView, !isFocusable);}nodeView.fireEventToCell(event); }}}Just use the above one and you are right on the track.........Sorry that i didn't post that immediately....
On Tuesday, 19 February 2013 15:54:35 UTC+5:30, membersound wrote:You're always welcome to share your solution, at least hints for others searching later for those kind of issues.
Am Dienstag, 19. Februar 2013 07:03:40 UTC+1 schrieb magesh kumar:Finally i managed to get a solution..........
On Friday, 15 February 2013 04:46:33 UTC+5:30, Tomek Kańka wrote:Oh, there are two of us.
I just asked the same question day ago:).
My ideas:
Should I use selectionModel for these items, and somehow find what node was selected (how?), or
use CellPreviewEvent.Handler in some mysterious way?
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment