Refresh a treeTable

Hi,
Is there any thing special to do, to refresh treeTable datas?
This is my problem :
- i have an af:treeTable in a jspx. It is based on 3 VO (1 per level) : VO1->VO2->VO3 linked by viewLink. Each VO are using EO and all are using in particular one EO (i will call it EOCom)
- i have an other VO based on EOCom (i will call it VOSec)
-> When i press a button in my jspx, i call a bakingBean method. This method call a AM method. This AM method insert a row in VOSec.
-> My backingBean method is then making a partialRefresh :
AdfFacesContext.getCurrentInstance().addPartialTarget(myTreeTable);Problem : the new row doesn't appear in my treeTable!
If i drag&drop the VOSec, and add a PartialRefresh on it, the row appear.
If i drag&drop one VO used in the tree, and add a PartialRefresh on it, the row appear.
so... how to refresh a treeTable?
thanks in advance
Clément
PS : i'm using jdev 11.1.1.2.0

If i update datas in one EO used by the tree, it works without postChanges.
Only insert/delete row is making trouble.

Similar Messages

  • Refresh Child Nodes of an af:treeTable

    I have two VOs with a master/detail relationship defined with a View Link. The master VO has a bind variable to change which set of master rows to return.
    I have an af:panelStretchLayout. The top facet has a form created by dragging the ExecuteWithParms from the Data Control for the master VO as a parameter form, and the center facet has an af:treeTable derived from the master VO with child nodes derived from the detail VO.
    When you see this on first page load, it is right: bind variable was set from the default for the bind variable, tree table shows correct information.
    But when I choose a different value for the bind variable and click the button to re-execute the query, the parent nodes are refreshed, but any parent nodes that weren't in the initial query results have no children, even though there ARE child rows in the database. In short, it re-queries the master VO, refreshes the treeTable, but does NOT re-query the detail VO.
    Now, I know that this is expected behavior - for better performance, ADF caches results and since the initial query didn't include children for these parents, there is no data to show. So my first thought was to add CacheResults="false" to the iterator. Nope. Tried a few different settings for Refresh attribute - nope (since the parent nodes ARE refreshing, I figured this wouldn't help, but it was worth a try). I tried the following method in the backing bean based on a suggestion in a blog entry:
    * Executes the query with the new parameter, then requeries the codes for each category.
    * @param actionEvent
    public void requeryServices(ActionEvent actionEvent) {
        DCBindingContainer bindings = (DCBindingContainer)JSFUtils.resolveExpression("#{bindings}");
        // First execute the query for the Categories
        bindings.getOperationBinding("ExecuteWithParams").execute();
        // Get the iterator and its View Object
        DCIteratorBinding categoriesViewIterator = bindings.findIteratorBinding("ServiceCategoriesView1Iterator");
        ViewObject categoriesView = categoriesViewIterator.getViewObject();
        // From the VO, get all the category rows.
        Row[] categoryRows = categoriesView.getAllRowsInRange();
        // For each category, find the ViewLinkAccessor, and execute the query for the codes.
        for (Row thisCategory : categoryRows) {
            RowSet codes = (RowSet)thisCategory.getAttribute("ServiceCodesView");
            codes.executeQuery();
        // Refresh the treeTable
        AdfFacesContext.getCurrentInstance().addPartialTarget(getServicesSelectionTree());
    }This doesn't work either - same results - parent is re-queried, children are not.
    What should I try next to get the child nodes to refresh?

    Sure, I know that I can get the binding container the other way - the sample code I was copying just happened to use JSFUtils, and I just happened to have it.
    Using JDev 11.1.2.3.
    The code I showed was just one of the ways I tried to solve this. The problem is that when I do an ExecuteWithParams on the tree binding, the children of that tree don't get re-executed. Suppose I have a tree table that looks like this when the page first displays and the tree is expanded:
    Item One
    <ul>
    <li>Child OneDotOne</li>
    <li>Child OneDotTwo</li>
    <li>Child OneDotThree</li>
    </ul>
    Item Two
    <ul>
    <li>Child TwoDotOne</li>
    <li>Child TwoDotTwo</li>
    <li>Child TwoDotThree</li>
    </ul>
    Item Four
    <ul>
    <li>Child FourDotOne</li>
    <li>Child FourDotTwo</li>
    <li>Child FourDotThree</li>
    </ul>
    Now I re-execute the parent query (using ExecuteWithParams) and give it a parameter that should give me:
    Item Two
    <ul>
    <li>Child TwoDotOne</li>
    <li>Child TwoDotTwo</li>
    <li>Child TwoDotThree</li>
    </ul>
    Item Three
    <ul>
    <li>Child ThreeDotOne</li>
    <li>Child ThreeDotTwo</li>
    <li>Child ThreeDotThree</li>
    </ul>
    Item Four
    <ul>
    <li>Child FourDotOne</li>
    <li>Child FourDotTwo</li>
    <li>Child FourDotThree</li>
    </ul>
    But what I actually get is:
    Item Two
    <ul>
    <li>Child TwoDotOne</li>
    <li>Child TwoDotTwo</li>
    <li>Child TwoDotThree</li>
    </ul>
    Item Three
    Item Four
    <ul>
    <li>Child FourDotOne</li>
    <li>Child FourDotTwo</li>
    <li>Child FourDotThree</li>
    </ul>
    Notice that even though Item Three has children, they don't show. The difference is that Items Two and Four were in the original results, but Item Three wasn't. If I browse the VOs in the AM Tester, Item Three's children show when I execute the parent with different parameters.
    I suppose I could try to replicate this problem with the HR schema. I'll try it Monday.

  • ADF Treetable scrolling position resets to top on refresh

    I have a master details page with the following components.
    TreeTable with a Check Box on LHS  and TabbedPannel on RHS.
    So, users can select any row on the LHS and the corresponding details will be displayed on RHS in a new Tab. When user closes the Tab it will clear the Check Box on TreeTable.
    Issue is, when user is at last row of TreeTable when there are more rows (Scroll bar will be at last), and user closes the Tab on RHS side, I will be clearing the checkbox binding and refresh the treetable using PPR to reflect the same.
    This is causing the treetable  scroll bar to be reset to the top. And User lost the old position on needs to scroll down again.
    Can we control the Scroll bar position after PPR refresh (or)
    Can we just clear off the CheckBox selection (only one row) with out refeshing the whole treetable
    Environment:
    JDev Version : 11.1.1.6.2
    Component : ADF TreeTable with TreeModel binding (Not using BC)

    In my case, I am fine with disclosureState items. They do not collapse even after I remove the checkbox selection and refreshing the TreeTable component.
    Only issue is scrollbar is resetting to top.
    I can't use the disclosure event as they can do expandAll , select first compoenent scroll down and close the selection on RHS tab.
    Which will reset the LHS scrolling position to top.

  • Af:TreeTable problem

    Hello all!
    (JDev 11 ADF BC)
    I try to use af:Treetable component based on view.
    In jsf page i have af:treetable and simple button. Button updating some info in my view. I need to refresh af:treetable component..I do this with partial trigger..All works fine but first level of the treetable dont refreshed...
    How to do this or how to refresh af:treetable programmatically?

    Hi,
    I made a usecase, but everything works fine for me:
    my untitled2.jspx :
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document>
          <af:messages/>
          <af:form>
            <af:panelGroupLayout partialTriggers="button1">
              <af:treeTable value="#{bindings.DeptView1.treeModel}" var="node"
                            selectionListener="#{bindings.DeptView1.treeModel.makeCurrent}"
                            rowSelection="single" width="503">
                <f:facet name="nodeStamp">
                  <af:column>
                    <af:outputText value="#{node}"/>
                  </af:column>
                </f:facet>
                <f:facet name="pathStamp">
                  <af:outputText value="#{node}"/>
                </f:facet>
              </af:treeTable>
            </af:panelGroupLayout>
            <af:commandButton text="commandButton 1" id="button1"
                              actionListener="#{myBB.doAction}"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>my managed bean:
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.event.ActionEvent;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCControlBinding;
    import oracle.binding.BindingContainer;
    import oracle.jbo.ViewObject;
    public class Class1 {
        public Class1() {
        public void doAction(ActionEvent actionEvent) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            ValueBinding vb = ctx.getApplication().createValueBinding("#{data}");
            BindingContext bindingsCtx = (BindingContext) vb.getValue(ctx);
            BindingContainer bc = bindingsCtx.getCurrentBindingsEntry();
            DCControlBinding cb = (DCControlBinding)bc.get("DeptView1");
            ViewObject vo = cb.getViewObject();
            vo.setWhereClause("DEPTNO=10");
            vo.executeQuery();
    }and adfc-config:
    <?xml version="1.0" encoding="UTF-8" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <view id="untitled2">
        <page>/untitled2.jspx</page>
      </view>
      <managed-bean>
        <managed-bean-name>myBB</managed-bean-name>
        <managed-bean-class>brano.test1.view.Class1</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
    </adfc-config>I am using SCOTT schema.
    After click on button I set where value for master view object and it is reflected.
    hope it helps,
    Branislav

  • TreeTable Selection Listener Issue

    I have a treeTable and i have used custom selection Listener instead of using bindings.<viewObject>.treeModel.makeCurrent. since i had to do more than just makeCurrent on selection, i choose this approach. Everything is working except, when i refresh the treeTable after create, the activeRow will be first row but selection shows on where i have last selected.
    My custom selectionListener is working very fine but i have noticed that when i refresh treeTable selectionListener is never called. but only called when i make selection... Is there anyway i can get my custom selectionListener be called on refresh of treetable or is there any other way i can control selection on fresh of treeTable.
    It will be highly appreciated if you can suggest me way.
    Thanks

    Thanks Timo for the reply. I have a customization to select the second row of the tree table by default. I am customizing the 'selectedRowKeys' value to achieve this default selection. It works fine for the first time.
    In the below scenario it's is not working,
    1. Select a row other than default selected
    2. After some action i am refreshing the table, now the focus(highlight) is on the previous selected row but actually the selectedkey is second row(Scenario1)
    This my tree table structure,
    Revision 0
    - - - - Scenario1
    - - - - Scenario2
    - - - - Scenario3
    Revision 1
    - - - - Scenario 4
    - - - - Scenario 5
    - - - - Scenario 6
    Thanks,
    Nagesh

  • Troubles with af:treeTable based on ViewObject after replacing SQL query.

    Hi everyone!
    We have <af:treeTable> component in our application, based on 3 ViewObject instances. These instances have the following structure in the Application Module:
    RootViewObject
    |----MainViewObject
    |----------|--------------ManagedViewObject
    According to our business logic, we change SQL query programmatically, reexecute all queries, refresh <af:treeTable> component, but the content of our tree table does not change after these actions. I have tried to output content of ViewObjects after changing and reexecuting the queries, and I have found out that the data in the ViewObjects have been changed!
    Why does the content of the <af:treeTable> component NOT change after refreshing it programmatically?
    Any ideas?
    Thanks in advance!
    Edited by: Emin10 on 10.12.2012 0:28
    Edited by: Emin10 on 10.12.2012 0:28

    Kamaal, Saif Kamaal
    I've already tried to put PPR on the parent container (in my case this is a toolbarButton).
    I refresh treeTable programmatically using this code:
    RequestContext rc = RequestContext.getCurrentInstance();
    rc.addPartialTarget(mytreeTable);

  • Row Selection for second and subsequent level nodes in tree table

    Hi All,
    We have a .jsff page with tree bindings to display a three-level hierarchy tree table.Suppose the hierarchy is
    -> Department
    ->-> Employees
    ->->-> Employee details.
    I have a use case where-in when we add the employee node within a department,the department node must expand and the newly added employee node must be selected.
    In both the cases(for new department or employee), we are following the approach mentioned below:
    1. Get the treeTable Iterator.
    2.Adding the new object to the java ArrayList which is bound to the corresponding level in the tree.
    3.Refreshing the treeTable iterator.
    4.Execute treeTable.setSelectedRowKeys()
    5.Add a partial target to the treetable.
    The issue is that the new employee gets added but the upper-level department node collapses and no selection is performed on the new employee node.
    But when we add a new department node, it gets selected on creation.
    Is there any additional steps to be performed for second-level row selection?

    Hi,
    Thanks for the reply.
    I looked at the code given in sample 61.
    In the sample, a new node is not added dynamically (for ex.either new location or its child nodes.)
    As mentioned in the above post, after adding a new node at a level in our use case, when we perform the refresh of the tree-table's iterator,the selection state of the rows is not shown on the table.
    If the tree-table's iterator is not refreshed and the treeTable.setSelectedRowKeys() is executed, the rows get selected but the subsequent node additions do not show up in the table as the table's iterator is not refreshed.
    Any sample code is available where in both the addition of new node and its selection is performed at the same time?
    Thanks.

  • How can I refresh the table in detailStamp in another table

    I have:
    <af:table value="#{bindings.View1.collectionModel}" id="table1"
    *rowDisclosureListener="#{myFun.rowDisclosureListener}">*
    <f:facet name="*detailStamp*">
    <af:panelFormLayout id="pfl2">
    <f:facet name="footer"/>
    <af:table value="#{bindings.View2.collectionModel}" *id="table2"*
    </af:table>
    </af:panelFormLayout>
    </f:facet>
    </af:table>
    Into *rowDisclosureListener* I wrote:
    *//With param read in row table1, I apply criteria in table2*
    ViewObject vo = ADFUtils.findIterator(getIteratorName()).getViewObject();
    if (vo != null) {
    ViewObject vo1 = ADFUtils.findIterator("myIterator").getViewObject();
    applyViewCriteriaOnViewObject(vo1, "myCriteria");
    vo1.setNamedWhereClauseParam("parm", vo.getCurrentRow().getAttribute("field1"));
    vo1.executeQuery();
    AdfFacesContext adfFacesContext = null;
    adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(table.getParent());
    *In table2 I set partialTriggers="::::pc1 :::table1">*
    Everythings works perfectly (the criteria is applied correctly), but when I disclose row, table2 is empty. It is not refresh. Why?
    Thanks

    And now?
    How can I replace table2? What is the component that I can use istead of the table2? From ViewObject vo1 I received many rows.
    And I can not replace table1 with treetable (I do not know what to change).
    Thanks

  • Tree Table is not getting refreshed properly in Jdev 11.1.2.0

    Hi,
    I am seeing a peculiar issue with tree table not getting refreshed in Jdev 11.1.2.0.
    Let me explain you my use case.
    I have a tree table in a page, where the first column is displayed as selectBooleanRadio component. When user selects this selectBooleanRadio component, that treetable node should get expanded and at the same time all the child records(I have a select boolean check box component(transient attribute) at the child level) for that node should get selected. This is to allow user to unselect the child records, which he/she does not want to process further(some functionality).
    Now when the user selects any radio button, the tree table node is not expanded, but the arrow beside the radio button for that node can be seen as expanded.
    I thought it may be a partial trigger issue, so i tried refreshing the tree table programatically as well. But it was of no use.
    Then I set the partial triggers wrt to SelectBooleanRadio component on the parent container of the TreeTable. After which somehow the node got expanded but the tree table shrinks in width and the actual disclosure functionality of a tree table is lost.
    The same use case works perfectly fine in Jdev 11.1.1.5.
    For reference:
    I created a sample test case(Dept/Emp) in jdev version 11.1.1.5, which works fine. Workspace: http://adf-use-cases.googlecode.com/files/TreeTable1.rar
    But the same test case, when i created in jdev version 11.1.2.0, gives issues. Workspace: http://adf-use-cases.googlecode.com/files/TreeTableUseCase.rar
    If you download the application and run in respective jdev version, you will get to know more about the issue.
    Please let me know, If I am doing anything wrong in the implementation of this use case.
    Any help/suggestions are appreciated.
    Thanks
    Umesh
    Note: My complete application is in Jdev 11.1.2.0, so I can't degrade my jdev version to 11.1.1.5.

    Thanks Frank for the reply.
    But upgrading the jdeveloper to 11.1.2.2 is not an ideal solution for us now, because of the size of the project.
    Some how, the issue of refreshing the tree table is resolved. I am using a command button with clientComponent to true and causing a full page refresh.
    I am not sure, if this is a perfect solution.
    As you said, that this behavior may be an issue with the Jdev version 11.1.2.0, I am using. I am going with the above said approach.

  • How to refresh the list of select one choice which is inside a table?

    Hello I am using Jdeveloper Version 11.1.2.1.0.
    The table is a normal table that is made to look like a treeTable.
    For some rows are or can be parents with Parent_vo_group_id = null and other are children with parent_vo_group_id = vo_group_id of the parent...
    If a children changes its parent_vo_group_id to null it can become a parent as well.
    I am having a select one choice inside a table column. The list comes from the same table with column Name:
    <af:table value="#{bindings.VoGroupAdminView2.collectionModel}" var="row"
                                                      rows="#{bindings.VoGroupAdminView2.rangeSize}"
                                                      contentDelivery="immediate"
                                                      visible="#{bindings.VoGroupAdminView2Iterator.currentRow != null}"
                                                      fetchSize="#{bindings.VoGroupAdminView2.rangeSize}"
                                                      partialTriggers="::soc1" styleClass="AFStretchWidth"
                                                      rowBandingInterval="0" editingMode="clickToEdit"
                                                      binding="#{adminGroupManagementBean.groupTable}"
                                                      selectionListener="#{adminGroupManagementBean.groupSelectionListener}"
                                                      rowSelection="single" id="t5">
                                                <af:column sortProperty="#{bindings.VoGroupAdminView2.hints.Name.name}"
                                                           sortable="false" styleClass="columnData"
                                                           headerClass="tableHeader"
                                                           headerText="#{bindings.VoGroupAdminView2.hints.Name.label}"
                                                           id="c1">
                                                    <af:inputText value="#{row.bindings.Name.inputValue}"
                                                                  requiredMessageDetail="Please enter a group name"
                                                                  label="#{bindings.VoGroupAdminView2.hints.Name.label}"
                                                                  required="true" id="it7" immediate="true" autoSubmit="true"
                                                                  columns="#{bindings.VoGroupAdminView2.hints.Name.displayWidth}"
                                                                  maximumLength="#{bindings.VoGroupAdminView2.hints.Name.precision}"
                                                                  shortDesc="#{bindings.VoGroupAdminView2.hints.Name.tooltip}"
                                                                  contentStyle="#{row.ParentVoGroupId eq null? 'font-weight:bold' : 'padding-left:20px'}"
                                                                  valueChangeListener="#{adminGroupManagementBean.groupNameChangeListener}"
                                                                  partialTriggers="soc2">
                                                        <f:validator binding="#{row.bindings.Name.validator}"/>
                                                    </af:inputText>
                                                </af:column>                                   
                                                <af:column sortProperty="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.name}"
                                                           sortable="false" styleClass="columnData"
                                                           headerClass="tableHeader"
                                                           headerText="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.label}"
                                                           id="c4">
                                                    <af:selectOneChoice value="#{row.bindings.ParentVoGroupId.inputValue}"
                                                                        label="#{row.bindings.ParentVoGroupId.label}"
                                                                        simple="true" immediate="true"
                                                                        required="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.mandatory}"
                                                                        shortDesc="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.tooltip}"
                                                                        id="soc2" autoSubmit="true"
                                                                        unselectedLabel="&lt;null&gt;"
                                                                        valueChangeListener="#{adminGroupManagementBean.parentIdValueChangeListener}"
                                                                        visible="#{row.bindings.ChildrenCount.inputValue eq 0 ? true : false}">
                                                        <f:selectItems binding="#{adminGroupManagementBean.selectOneChoiceList}"
                                                                        value="#{row.bindings.ParentVoGroupId.items}"
                                                                       id="si2"/>
                                                    </af:selectOneChoice>
                                                </af:column>
                                            </af:table> My select one choice uses the same iterator as the table.
    <iterator Binds="VoGroupAdminView2" RangeSize="-1" DataControl="AppModuleDataControl"    id="VoGroupAdminView2Iterator"/>The table uses this view called VoGroupAdminView:
    Select t1.vo_Group_id,     
           t1.name,
           t1.Vehicle_Owner_Id,
           t1.Graphical_Symbol,
           t1.Lm_Comment,
           t1.Parent_Vo_Group_Id ,
           decode (t2.children_count, null, 0, t2.children_count) as children_count
           from
    (SELECT VoGroup.vo_Group_id,     
           VoGroup.name,
           VoGroup.Vehicle_Owner_Id,
           VoGroup.Graphical_Symbol,
           VoGroup.Lm_Comment,
           VoGroup.Parent_Vo_Group_Id
      FROM VO_GROUP VoGroup
    START WITH VoGroup.Parent_Vo_Group_Id IS NULL
    CONNECT BY VoGroup.Parent_Vo_Group_Id = PRIOR VoGroup.Vo_Group_Id
    order SIBLINGS by VoGroup.name) t1,
    (select parent_vo_group_id, count (parent_vo_group_id) as children_count from vo_group
    group by parent_vo_group_id) t2
    where t1.vo_group_id = t2.parent_vo_group_id (+)the ParentVoGroupId attribute has list of values from this view object called VoGroupAdminLov:
    SELECT
        VO_GROUP.NAME,
        VO_GROUP.VEHICLE_OWNER_ID,
        VO_GROUP.PARENT_VO_GROUP_ID,
        VO_GROUP.VO_GROUP_ID
    FROM
        VO_GROUP
    WHERE  VO_GROUP.PARENT_VO_GROUP_ID is null
    and VO_GROUP.VO_GROUP_ID <> ?
    order by  VO_GROUP.NAMEI want to refresh the list of values in the select one choice everytime when i add a new row in the table, delete row in the table or change the value of select one choice component.
    What I have tried:
        public void parentIdValueChangeListener(ValueChangeEvent valueChangeEvent) {
            this.setValueToEL("#{row.bindings.ParentVoGroupId.inputValue}", valueChangeEvent.getNewValue());
            BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding voGroupAdminIterator = (DCIteratorBinding)bc.get("VoGroupAdminView2Iterator");
            Key selectedGroupKey = voGroupAdminIterator.getCurrentRow().getKey();
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            am.getTransaction().postChanges();
            am.getVoGroupAdminView2().executeQuery(); //refresh the table view object;
            am.getVoGroupAdminLov1().executeQuery(); //refresh the list of values view object
            voGroupAdminIterator.invalidateCache();  //remove the cache of the iterator
            voGroupAdminIterator.setCurrentRowWithKey(selectedGroupKey.toStringFormat(true)); // set the selected row again.
            RichSelectOneChoice soc =
                (RichSelectOneChoice)FacesContext.getCurrentInstance().getViewRoot().findComponent(":pt1:t5:soc2");
            AdfFacesContext.getCurrentInstance().addPartialTarget(soc);
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.groupTable);    
        }When i am adding a new row to the table its select one choice list is refreshed but only for the new row. The rest rows have not updated list of values for their select one choice components.
        public String addGroupButtonAction() {
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            ViewObjectImpl voGroupAdminView = am.getVoGroupAdminView2();
            Row newRow = voGroupAdminView.createRow();
             newRow.setNewRowState(Row.STATUS_INITIALIZED);
            voGroupAdminView.insertRowAtRangeIndex(0, newRow);
            am.getTransaction().postChanges();
            return "null";
        }Edited by: 897833 on Mar 19, 2012 9:07 AM

    I made a button to refresh the value of select one choice and it doesn't work yet.
    So I just move one of the
        public String refreshParentIdSOCButtonAction() {
            BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding voGroupAdminIterator = (DCIteratorBinding)bc.get("VoGroupAdminView2Iterator");
            Key selectedGroupKey = voGroupAdminIterator.getCurrentRow().getKey();
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            am.getTransaction().postChanges();
            am.getVoGroupAdminView2().executeQuery();
            am.getVoGroupAdminLov1().executeQuery();
            voGroupAdminIterator.invalidateCache();
            voGroupAdminIterator.setCurrentRowWithKey(selectedGroupKey.toStringFormat(true));
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.parentIdSelectOneChoice);  //refresh the binded SOC as you said
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.parentIdSelectOneChoiceList); //refresh the binded list even
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.groupTable); //refresh the table it is in;
            return null;
        }Edited by: 897833 on Mar 23, 2012 2:58 AM

  • Issue with child node edit on TreeTable

    Hello,
    I have a treeTable which is based on single VO. My problem is such that, when i select the child node and click on edit, i get values of it's parent :( ....
    but when i have once  edit on any node (either rollback/commit) and hit the browser refresh button now it works as expected and no more issue....
    what the heck is that. I have used backingBean scope and i have jdev 11.1.1.3.0
    Thanks
    Raj

    Hello Frank,
    Thank you so much for the help.. I have 2 iterator as explained in http://www.oracle.com/technetwork/developer-tools/adf/learnmore/sept2011-otn-harvest-508189.pdf .
    As my treeTable is based on single VO , whenever i select a child node and hit the toolbar edit and/or context menu edit, i get parent node info in the edit form. and this happens until i hitting browser refresh. after that it works as expected....
    when selection is made and edit button is clicked i call the managed bean method to call service operation as:
    public void onTreeTableEditClicked(ActionEvent actionEvent)
    Number id = getSelectedIdFromTree(); // my problem is here ... i am getting parent id until once edit is done(either rollback/commit) and browser refresh is hit. after that i am getting selected it.
    if (id!= null)
    OperationBinding opr =
    ADFBindingUtils.getDCBindingContainer().getOperationBinding("selectMyMethod");
    opr.getParamsMap().put("id", id);
    opr.execute();
    _showPopup(getEditPopup());*
    else
    // show warning.
    public Number getSelectedIdFromTree()
    RowKeySet rks2 = myTreeTable.getSelectedRowKeys();
    Iterator rksIterator = rks2.iterator();
    if (rksIterator.hasNext())
    List<Key> list = (List<Key>) rksIterator.next();
    return ((DBSequence) (list.get(list.size() -
    1).getKeyValues()[0])).getSequenceNumber();
    return null;
    // in the application Module
    public void selectMyMethod(Number id)
    MYVOImpl pvo = getEditMyVOImpl();
    MYVORowImpl row =
    (MYVORowImpl ) pvo.findByKey(new Key(new Object[]
    { new DBSequence(id) }), 1)[0];
    pvo.setCurrentRow(row);
    and the edit popup has value referenced by editIterator...
    Please let me know where i am wrong, or is there something i am missing.
    Thank you
    Edited by: MavenDev on Nov 8, 2011 8:34 AM

  • TreeTable selectedRowKeys not working in Jdev 11.1.1.4

    Hi,
    We have a treetable which we create using bindings (underlying objects are POJOs and not BC)
    We used to add a row to the treetable and then select the first node. This code used to work "as is in Jdev 11.1.1.3"
    Now when we test the same code using Jdev 11.1.1.4; on adding a row to the treetable; all the contents of the tree table disappear.
    The code below contains
    a)The iterator - myTagVOsIterator which is used to build the treetable
    b) Call to a method dialogOkClick() in some other file which is responsible for adding an object into the myTagVOs List
    c) Setting the selectedRowKeys such that it points to the first row (causes a problem in 11.1.1.4)
    d) Expand all the Top Most Nodes using disclosedRowKeys (this works fine in both 11.1.1.3 and 11.1.1.4)
    e) Refresh the tree table
    Code is as follows:
    public void addRowToTableListener(ActionEvent actionEvent) {
    BindingContext bindingContext = BindingContext.getCurrent();
    BindingContainer bindings = bindingContext.getCurrentBindingsEntry();
    DCBindingContainer dcBindingContainer =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcIteratorBinding = dcBindingContainer.findIteratorBinding("myTagVOsIterator");
    RowSetIterator rowSetIterator = dcIteratorBinding.getRowSetIterator();
    OperationBinding addOper = (OperationBinding)bindings.get("dialogOkClick");
    addOper.execute(); //Responsible for adding another object to the myTagVOs list
    if (dcIteratorBinding != null) {
    dcIteratorBinding.executeQuery(); //Refresh the iterator
    int currentRow = 0; //Point to first row in tree table
    dcIteratorBinding.setCurrentRowIndexInRange(currentRow);
    Row currRow = dcIteratorBinding.getRowAtRangeIndex(currentRow);
    rowSetIterator.setCurrentRow(currRow);
    Key key = rowSetIterator.getCurrentRow().getKey();
    dcIteratorBinding.setCurrentRowWithKey(key.toStringFormat(true));
    DCDataRow row = (DCDataRow)rowSetIterator.getCurrentRow();
    Key rowKey = row.getKey();
    List<Key> list = new ArrayList<Key>();
    list.add(rowKey);
    RowKeySet selectedRowKeys = new RowKeySetImpl();
    selectedRowKeys.add(list);
    timePeriodTree.setSelectedRowKeys(selectedRowKeys);
    //for expanding first level
    CollectionModel model = (CollectionModel)((RichTreeTable)timePeriodTree).getValue();
    JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)model.getWrappedData();
    JUCtrlHierNodeBinding rootNode = treeBinding.getRootNodeBinding();
    RowKeySet rks = (((RichTreeTable)timePeriodTree).getDisclosedRowKeys());
    if (rks == null) {
    rks = new RowKeySetImpl();
    List<JUCtrlHierNodeBinding> firstLevelChildren = rootNode.getChildren();
    for (JUCtrlHierNodeBinding node : firstLevelChildren) {
    ArrayList l = new ArrayList();
    l.add(node.getRowKey());
    rks.add(l);
    ((RichTreeTable)timePeriodTree).setDisclosedRowKeys(rks);
    //end of for expanding first level
    AdfFacesContext ctx = AdfFacesContext.getCurrentInstance();
    ctx.addPartialTarget(timePeriodTree);
    Pls advise.
    Thanks
    Santosh

    Hi,
    below code works for me in a test case of mine. Note the difference to your code (mostly in that it avoids redundant code and in particular how it sets the selected rowkey)
        public String onEmployeeCreation() {
            BindingContext bindingContext = BindingContext.getCurrent();
            BindingContainer bindings = bindingContext.getCurrentBindingsEntry();
            DCBindingContainer dcBindingContainer =
            (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding dcIteratorBinding = dcBindingContainer.findIteratorBinding("allDepartmentsIterator");
            SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yy");
            Employees newEmp = null;
            try {
              newEmp =  new Employees(new Long(211), "Jennifer2", "Whalen2", "JWHALEN2","515.123.4444",
                         sdf.parse("17-SEP-87"), "AD_ASST", new Long(4400), new Long(101),
                         new Long(10));
            } catch (ParseException e) {
                e.printStackTrace();
            OperationBinding addOper = (OperationBinding)bindings.get("createNewEmployee");
            addOper.getParamsMap().put("employee", newEmp);
            addOper.execute(); //Responsible for adding another object to the myTagVOs list
            dcIteratorBinding.executeQuery();
            dcIteratorBinding.setCurrentRowIndexInRange(0);
            rks = new RowKeySetImpl();
            ArrayList rowKey = new ArrayList();
            Object pk = dcIteratorBinding.getCurrentRow().getKey();
            rowKey.add(pk);
            rks.add(rowKey);
            treeTable.setSelectedRowKeys(rks);
            //treeTable.setDisclosedRowKeys(rks);
            AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
            adfFacesContext.addPartialTarget(treeTable.getParent());
            return null;
        }Note that I made sure that on the generated metadata in the DataControl, the primary key attribute is marked as primary key (select the collection in the DC palette, choose Edit Definition from the context menu and select the PK attribute. In the PropertyInspector, set the primary key property to true)
    Frank

  • Exception when click row of af:treetable

    Hi,
    I use Jdeveloper 11.1.1.1.0 for create webapp, I created a page with treetable
    Sometime, when I click a row of table then I see Excepption
    javax.faces.model.NoRowAvailableException
    In treetable I used selection listerner
    Please help me solve this problem.
    Thanks
    Duy

    Dear Sameh Nassar,
    My code is very long, I will description for you as follow:
    In row of treetable i have a command link, I click link for open a popup, click ok button of popup --> update data --> close popup --> refresh treetable
    Thanks you

  • How to Refresh JTree if a file System got changed during Run-time

    Hi,
    Can anyone tell me how to refresh a JTree(javax.swing.JTree) used for displaying file system(both local and remote).
    I'm getting a problem if a file/directoy is added to the file system, after my Applet is loaded. Actually, i have used DefaultTreeModel's reload() method for refreshing and calling it inside SwingUtilities.invokeLater() using Thread, but its not working.
    I want that the tree should reflect the latest Files/Directories on the click of a node, if any file or directory is added under that node.
    Plz tell me if this is possible or not.
    Thanks

    Hi Shay_te,
    Thanx for ur reply as i was eagerly waiting for the one.
    but the example is using the TreeTable
    and i have used JTree and DefaultTreeModel.
    I'm calling reload(node) within treeExpand() method
    Then, i'm regestring addTreeModelListener() as
    m_model.addTreeModelListener(new javax.swing.event. TreeModelListener(){ }
    inside which all 4 methods are over-ridden
    code snippet is as follows so plz help me and tell if this the right way:
    class DirExpansionListener implements TreeExpansionListener{
            DirExpansionListener(){
            public void treeExpanded(TreeExpansionEvent event) {
                final DefaultMutableTreeNode node = getTreeNode(event.getPath());
                final FileNode fnode = getFileNode(node);
                Thread runner = new Thread() {
                    public void run() {
                        if (fnode != null && fnode.expand(node)) {
                            Runnable runnable = new Runnable() {
                                public void run() {
                                    try{
                                       m_model.reload(node);
                                        m_model.addTreeModelListener(new javax.swing.event.TreeModelListener() {
                                            public void treeNodesChanged(javax.swing.event.TreeModelEvent evt) {
                                            public void treeStructureChanged(javax.swing.event.TreeModelEvent evt) {
                                                System.out.println("Path of node changed->"+evt.getTreePath());
                                            public void treeNodesInserted(javax.swing.event.TreeModelEvent evt) {
                                                System.out.println("Nodes Inserted method called..");
                                            public void treeNodesRemoved(javax.swing.event.TreeModelEvent evt) {
                                        System.out.println("Run inside DEvent called..");
                                        //Thread.sleep(500);
                                        //fnode.expand(node);
                                    }catch(Exception e){System.out.println("err :" +e);}
                            SwingUtilities.invokeLater(runnable);
                runner.start();
            public void treeCollapsed(TreeExpansionEvent event) {}
        Please reply...

  • Partial trigger for treetable

    I am using 11g. I have a adf treetable similar to the employees. The tree table is working fine.
    I have two panel accordian. The first accordian has the treetable.
    I want to display the salary and more information for the employee in the second panel accordion.
    The problem is the salary is not getting refreshed when I do the row selection in the tree table.
    I set the id of the treetable to the partial trigger of the Salary.
    Am I missing something in setting the properties?
    I really appreciate your help.
    Thanks

    <f:facet name="center">
    <af:treeTable value="#{bindings.EmpView1.treeModel}" var="node"
    selectionListener="#{bindings.EmpView1.treeModel.makeCurrent}"
    rowSelection="single" id="treetbl" immediate="true"
    columnSelection="single" initiallyExpanded="true">
    <f:facet name="nodeStamp">
    <af:column inlineStyle="width:500px;">
    <af:outputText value="#{node}"/>
    </af:column>
    </f:facet>
    <f:facet name="pathStamp">
    <af:outputText value="#{node}"/>
    </f:facet>
    </af:treeTable>
    </f:facet>
    <f:facet name="header"/>
    <f:facet name="end">
    <af:panelGroupLayout layout="vertical">
    <af:panelLabelAndMessage label="#{bindings.Sal.hints.label}"
    partialTriggers="treetbl">
    <af:outputText value="#{bindings.Sal.inputValue}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.Sal.format}"/>
    </af:outputText>
    </af:panelLabelAndMessage>
    <af:panelLabelAndMessage label="#{bindings.Mgr.hints.label}"
    partialTriggers="treetbl">
    <af:outputText value="#{bindings.Mgr.inputValue}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.Mgr.format}"/>
    </af:outputText>
    </af:panelLabelAndMessage>
    <af:panelLabelAndMessage label="#{bindings.Sal.hints.label}"
    partialTriggers="treetbl">
    <af:outputText value="#{bindings.Sal.inputValue}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.Sal.format}"/>
    </af:outputText>
    </af:panelLabelAndMessage>
    </af:panelGroupLayout>
    </f:facet>
    It works only for 1'st level. When I choose the child nodes the Job, Salary, mgr is not refreshing.
    Thanks

Maybe you are looking for

  • High CPU usage running select from dba_ts_quotas

    We recently installed grid agent on a DEV box and have seen out CPU spike like crazy at times. I have 10 instances running on this box (cringe), they are at different versions from 10 -11G. The agent is at 10.2.0.4. I looked up the query that's eatin

  • How to determine the correct moment when Word has finished to write to a docx file

    Hello, we are currently passing a document to Microsoft Word for editing and want to take back the changed/saved document when editing is finished. But it seems we have issues to determine the correct moment when Word has for sure saved all changes a

  • How to write single line text file

    Hi, I need to write a single line text file using oracle forms 10g that's usually quite long 8million+ characters, I looked into utl_file but came accross the single line limit, is there any way to do this either to the client pc or to the server Tha

  • How can I get ArcSoft Photostudio 6 to open pictures from iPhoto?

    Moving from PC to iMac.  On PC, I could load and also save to my photo library from Photostudio 6.  But when I see my iPhoto library when trying to open from Photostudio 6, it's pale and I can't open it.  Is there a way to unlock this, or be able to

  • On Plus support for Voice services

    Hi Friends, I am trying to explore use of onplus for Config, Monotoring and reporting for voice services (example UC50,ISR with CME/CUE cards as well as use of SRST). Could you please sugget any documentation I can refere for this req. Suresh