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());
}
}
}

3 thoughts on “snippets – to collapse a tree which is expanded

  1. karthick

    nice post,
    in same tense.
    i had some usecase. i cant achieve it.
    you may give right direction.
    here my usecase regards af:tree with links navigating to the page

    >> configuration
    |
    >config1010 basicemployeeprofile
    >config1020 salaryprofile
    >> transaction
    |
    >trans1010 profile
    >trans1020 salaryupdation

    no problem with this tree.
    my concept is simple.

    when i click config1010 means it want to navigate to
    config1010.jspx page or jsff.

    when i click config1020 means it want to navigate to
    config1020.jspx page or jsff.

    here n most example, which i saw is , when i click the node means navigate to corresponding records.

    here i want to navigate corresponding page.

    so thing is simple the id that is config1010.
    if config1010 is clicked means
    navigate config1010.jspx page

    Reply
    1. Ksenia

      Hi Andrejus,if you still read this blog considering the last post was made in 2010 but I have a pelrobm. I have a jspx page which has been developed based on a template (which contains six facets in 3 layers (top layer – header.jsff, middle layer (2 jsff files) and last layer (3 jsff files)). I have created a task-flow (with fragments) and have rendered it as a region in one of the section of middle layer. I’m loading the fragments dynamically using the navigation rules which i have mentioned in task-flow. The problwm which i’m facing here is, whet ever the fragmnts i’m loading dynamically in that section (where i have added the task-flow as region), i’m able to load the fragments succesfully with out any pelrobm. But when i try to call the navigation rule from header.jsff (which was created as part of template), it is not loading the respective fragment. Please provide some help or solution in this regard. I have done lot of RnD and could not able to come up with a solution. help is highly appreciated.

      Reply
  2. karthick

    nice post,
    in same tense.
    i had some usecase. i cant achieve it.
    you may give right direction.
    here my usecase regards af:tree with links navigating to the page

    >> configuration
    |
    >config1010 basicemployeeprofile
    >config1020 salaryprofile
    >> transaction
    |
    >trans1010 profile
    >trans1020 salaryupdation

    no problem with this tree.
    my concept is simple.

    when i click config1010 means it want to navigate to
    config1010.jspx page or jsff.

    when i click config1020 means it want to navigate to
    config1020.jspx page or jsff.

    here n most example, which i saw is , when i click the node means navigate to corresponding records.

    here i want to navigate corresponding page.

    so thing is simple the id that is config1010.
    if config1010 is clicked means
    navigate config1010.jspx page

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s