Tag Archives: tree

snippets – to collapse a tree which is expanded



public void rowDisclosureListener(RowDisclosureEvent rowDisclosureEvent) {
System.out.println(":::: RowDisclosureListener Invoked");
int depth = tree.getDepth();
if (depth > 0) {
return;
}
RowKeySet discloseRowKeySet = tree.getDisclosedRowKeys();
RowKeySet addedRowKeySet = rowDisclosureEvent.getAddedSet();
Iterator addedRowKeySetIter = addedRowKeySet.iterator();
if (addedRowKeySetIter.hasNext()) {
discloseRowKeySet.clear();
Object firstKey = addedRowKeySetIter.next();
discloseRowKeySet.add(firstKey);
tree.setSelectedRowKeys(addedRowKeySet);
tree.setRowKey(firstKey);
AdfFacesContext adfFacesContext = null;
adfFacesContext = AdfFacesContext.getCurrentInstance();
adfFacesContext.addPartialTarget(tree.getParent());
}
}
}

Advertisements

How to change the default text title of Detached table/treetable


have trindad-skins.xml in your web-inf folder and have the following tag

<skin>
 <id>dummy.desktop</id> // you are overriding the style
 <family>dummy</family>
 <extends>fusion.desktop</extends> // this should be from the trinidad-config.cml
 <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
 <style-sheet-name>skins/dummy/dummy.css</style-sheet-name>
 <bundle-name>oracle.view.resource.rich.SkinBundle</bundle-name> // your skin bundle to override the name
 </skin>

here dummy.css is used to override any visual property of the faces component defined in fusion theme
to override the label, use in the SkinBundle like (The java bundle file should be registered as a managed bean in adfc-config.xml)

package oracle.view.resource.rich;
 import java.util.ListResourceBundle;
public class SkinBundle
 extends ListResourceBundle
 {
 @Override
 public Object[] getContents()
 {
 return _CONTENTS;
 }

static private final Object[] _CONTENTS =
 {
 { "af_panelCollection.LABEL_DETACH_TABLE_DLG", "Any name for the Detachable Table" },
 { "af_panelCollection.LABEL_DETACH_TREE_TABLE_DLG", "Any name for the Detachable Tree Table" }
 };
 }