gwt - dynamic tree structure using uibinder - gwt

I have a tree structure which has sub nodes and these sub nodes in turn have their own sub nodes.
I now want to add click handlers for the root node and every child node. Can any one please help me that?
Thanks

There is no need to add a ClickHandler to each node. It is very inefficient. You need to add a single SelectionHandler to your tree.
When you create each TreeItem, you can set a user object on this item. In your SelectionHandler, you check what user object is set on the selected item, and then you act accordingly.

Related

Is there any way to add a single component to multiple component groups in AEM [Adobe Experience Manager]

I need to add a single component to multiple component groups in AEM.
I am pretty sure that a component can only belong to one component group.
If you would like to have your component visible in different places (but not the complete group), you basically have two options:
Add the component (not the group) to the allowed components list in your design ( configuration.
Create a new group, change your component's group to the newly created one and add the new group in the design / configs you need.
HTH

jcr:lastModified vs cq:lastModified

What is the significance of having 2 separate last modified dates(jcr:lastModified and cq:lastModified)? Is there a scenario where one of the dates gets updated and second one not. Cant we live with one of the last modified (maybe jcr) and use it everywhere?
My issue is, we have few queries and conditions in our application defined based of either of these dates and am confused if the usage is right.
Here is a sample:
cq:lastModified is present at jcr:content node level, means it is available on all those nodes whose jcr:primaryType is cq:pageContent. Where as at all other nodes types jcr:lastModified is used. In general we can say that if any content is getting modified through aem functionality it will refer and update cq:lastModified and everything else that is using JCR core functionality will refer and update jcr:lastModified. Both properties can’t be present on the same node.
Read more at WHAT IS THE DIFFERENCE BETWEEN JCR:LASTMODIFIED AND CQ:LASTMODIFIED
I think one should always check both properties. I'm currently facing the situation that updating an image with the ootb image dialog is not changing the cq:lastModified property. however, the jcr:lastModified property is either added or modified. This a very curious behavior I'd say. I'm not sure if I'm missing something in my dialog config:
Can be caused by the fact that the image tab is embedded in another dialog ... but I'm not sure
Any modification on page by an authoring activity i.e. on component dialogs or page properties dialog, it always associated with jcr:lastModified and jcr:lastModifiedBy properties on the respective nodes (i.e. if content modification is done on component then node type is nt:unstructured and if it is page properties like jcr:title then it is cq:pageContent).
For each content modification on the page as part of authoring activity, cq:lastModified and cq:lastModifiedBy properties on the jcr:content node gets updated; no matter on which component the modification have been done. Hence, if there is a modification on page properties like jcr:title then on jcr:content node, cq:lastModified, cq:lastModifiedBy, jcr:lastModified and jcr:lastModifiedBy property values get changed.

Select all children without selecting parent

I am using fancytree's multi-hierarchy select mode (selectMode 3) to select which nodes to remove from the tree. The problem is when all the children are selected - the parent is selected as well, but the user may not want to remove the parent from the hierarchy. I checked the documentation and other Stack Overflow articles but couldn't find a workaround. Any ideas? Thanks!
As the author notes in https://github.com/mar10/fancytree/issues/626 , this situation could be handled by using selectMode: 2.
This mode does not implement any additional logic on its own.
But the click event can be implemented and data.node.visit() can be used to modify the selection state of child nodes.
One complication though is that all child nodes may need to be selected when a parent node is selected. It may help to disable child nodes when the parent is selected.

Unity3D - Prevent Grid Layout Group rearrange

When i delete an item in grid, grid will rearrange the rest of items, it means they will fill the empty slot of deleted item by others
Is there any way to prevent this ?
Have your GridLayoutGroup contain a set of child container game objects (pseudo speak).
In each container, place the item you desire.
Then, rather than deleting a container, delete the item inside the container instead.
This way, the containers stay in place, and only the items inside get deleted. Therefore, no rearrangement will occur.

Adobe CQ: authoring content once to display in multiple components

Is there any way to create components in CQ with content pre-added, so that authors can easily pull in a component that has the exact same content on each page where it appears?
Yes , it can be done by adding a cq:template[nt:unstructured] node under your component. If all the data is stored on the component node itself , add the default values as properties to cq:template node with name same as the ones in your dialog. In case the data is stored in a child node add a similar node under cq:template node.
Source : http://blogs.adobe.com/experiencedelivers/experience-management/defaults-in-your-component/