ADF 10.1.3.3 - Set current row on detail table in master/detail

I want my master/detail form to remember the row the user selected in the detail table before pressing submit/commit.
Today is it always the last row displayed that default is selected.
How can that be accomplished ?
Message was edited by:
jsteenberg
Message was edited by:
jsteenberg

Which technology are you using?

Similar Messages

  • LOV switcher and set current Row

    Hi
    I have a LOV switcher attached to one of the columns in the view object.
    It works fine while switching the LOV's in mostly all conditions.
    But its failing for one case.
    We are using checkboxex to select a row , and do a operation in the row.
    To do this, the button on which the operation is performed ...
    1)we have checked which row has the transient value of check box as checked
    2) Set the current row of the iterator to the row that comes from the selected check box index..
    3) Called the operation.
    But as the code go to step two and the current row is set to the required row, all the LOV 's in all the rows start showing the Default LOV which is selected in the LOV switcher, if i do a f5 fr the page, the original values are restored.
    Also if the VO fecth size is 25 , it gives wrong value for 25 rows, if i scroll through the table again it automatically shows the correct value.
    This has been taking a lot of out time to debug the issue.
    I guess its somethng to do with LOV switcher , set current row and the table getting refreshed incorrectly on set current row

    Hi Timo ,
    Thanks fr the reply..
    Jdev 11.1.1.4
    Code for checkbox selection
    DCBindingContainer dcbindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterator =
    dcbindings.findIteratorBinding(iteratorName);
    Row[] rowSet = iterator.getAllRowsInRange();
    Integer selectCount = 0;
    for (Row row : rowSet) {
    Object selAtt = row.getAttribute(selectAttribName);
    if (selAtt != null && (Boolean)selAtt == true) {
    System.out.println("Row selected");
    selectCount++;
    if (selectCount > 1) {
    System.out.println("More than one row selected!");
    throw new ValidationException("More than one row selected");
    else{
    iterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
    } else {System.out.println("Row not selected");}
    I actually sorted the issue out
    had to write
    iterator.refresh(Row.REFRESH_CONTAINEES); after iterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
    But not sure if thts correct ...

  • How to set current row in table after use tab key on inputText

    Hello all,
    My first post .., I'm newbie in ADF and I will try to explain my problem.
    For the moment we use ADF 11g (11.1.1.4), in a jsff page I have a table with an inputText column.
    On the valueChangeListener of the inputText, I invoke a method in a viewScope bean which call an EJB method, make some services in the EJB on the line modified. After that I refresh the VO and the table (because others values on the line have been modified) and reset the focus on the same inputText modified by the user with javaScript because focus was lost after refresh.
    So far, everything works fine.
    When I use the arrow keys to change the selected row in the table, it's work fine (focus is still in the next or previous inputText), but if user try to use tab key to change the current line, the inputText on the next line have the focus but the current row of the table is not changed (I think it's normal).
    My question : how can I change the current row after tab key pressed in this case ?
    I don't know if it's really clear, not easy to explain, don't hesitate to ask more details.
    Thanks in advance.

    Frank Nimphius wrote:
    Hi,
    My question : how can I change the current row after tab key pressed in this case ?
    Use a client event to listen for the keyboard entry and intercept the tab. The use af:serverListener to call the server to set the rowKey on the table and issue a PPR for the table to re-paint
    See sample 11 on http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples
    to learn about how to use the client listener and server listener
    FrankHi,
    Thanks a lot for your advices, I used the client and server listener
    I used this code on the method call in order to change the selection after key tab pressed, I don't know if it can be easier, but it works.
              if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("START changeSelectedRow");
              RowKeySet oldRowKeySet = myTable.getSelectedRowKeys(); // get oldRowKeySet
              if (oldRowKeySet == null) {
                   if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("oldRowKeySet is null");
                   return;
              RowKeySetImpl newRowKeySet = new RowKeySetImpl(); // The new RowKeySet use to change the selectedRow
              DCIteratorBinding bindingIterator = ADFUtils.findIterator(MY_ITERATOR);
              bindingIterator.setRangeSize(-1);
              // set the new index of the current row.
              int index = bindingIterator.getCurrentRowIndexInRange();
              if (index < bindingIterator.getAllRowsInRange().length - 1) {
                   index++;
              bindingIterator.setCurrentRowIndexInRange(index);
              // get the current row after changed the index
              Row currentRow = bindingIterator.getCurrentRow();
              if (currentRow != null) {
                   ArrayList nextLst = new ArrayList(1);
                   nextLst.add(currentRow.getKey());
                   newRowKeySet.add(nextLst);
                   // set the new selectedRow
                   myTable.setSelectedRowKeys(newRowKeySet);
                   SelectionEvent selectionEvent = new SelectionEvent(oldRowKeySet, newRowKeySet, myTable);
                   selectionEvent.queue();
                   AdfFacesContext.getCurrentInstance().addPartialTarget(myTable);
              if (LOGGER.isDebugEnabled()) {
                   LOGGER.debug("END changeSelectedRow");
    Best Regards
    Benjamin

  • Ora-30926 : unable to get a stable set of rows in source table

    Dear All
    When I try to load my cube I get the error "ora-30926 : unable to get a stable set of rows in source table".
    Any idea? Googling for this error did not return any solutions.
    My env:
    source: Oracle 10g (10.2.x)
    Target: Oracle 11g (11.1.0.7)
    I am using warehouse builder 11.1.0.7 on Linux
    thank you

    Carsten / neashton
    Thanks for your help. Duplicate rows were the issue.
    I finally debugged the problem to my time dimension.
    The OWB wizard generated time dimension contains only date, but no time.
    Unfortunately, for me to uniquely identify my data, I need to include time also (detailed in how do I include 'Time' in a time dimension? .
    Since Carsten was the first one to answer this, I am awarding the points to him.
    thanks a lot both of you
    Edited by: T2 on Jun 2, 2009 4:01 AM

  • Setting current row using a string key in an iterator

    Hi ,
    I am using Studio Edition Version 11.1.1.6.0 and integrated wls.
    QUESTION:_
    As suggested by Sudipto i want to brief up my query.
    I have a master-detail relationship .Using that relation's Tree model i am displaying through an <af:iterator> . I want to set the current row in the iterator of the parent view object . Is there a way please help .
    Description:_
    I have 2 master-details tables . FormSections is the mater and SectionContents is the child.
    I have an use case and using the tree collection model in an iterator to display the nodes.The jsf page has the following markup
    <iterator id="i1" value="#{bindings.FormSectionsView1.collectionModel}"
    var="section">
    <decorativeBox id="db2">
    <facet name="top">
    <commandLink text="#{section.Sectionname}" id="cl1">
    <showPopupBehavior triggerType="action" popupId="p1"/>
    </commandLink>
    </facet>
    <facet name="center">
    <iterator id="i2" value="#{section.children}" var="field">
    <outputText value="#{field.Fieldlabel}" id="ot3"/>
    </iterator>
    </facet>
    </decorativeBox>
    </iterator>
    on the popup p1 i have #{DesignBean.createField} popupfetch listener.Now i want to insert a new row in the child when i click on the commandlink.
    I have tried the following
    1) Tried binding setCurrentRowWithKey and setCurrentRowWithKeyValue (namedvalue as #{section.Sectionid}) but there was no change i get the current row set to empty
    2) Tried using the following bean codes
    a) DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding sectionsIterator =
    (DCIteratorBinding)bindings.get("FormSectionsView1Iterator");
    System.out.println(sectionsIterator.getCurrentRow());
    String key_str="21";
    sectionsIterator.setCurrentRowWithKeyValue(key_str);
              executeOperationBindings("CreateInsert1");// child createinsert binding execution
         b)     DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding sectionsIterator =
    (DCIteratorBinding)bindings.get("FormSectionsView1Iterator");
    System.out.println(sectionsIterator.getCurrentRow());
    String key_str="21";
    Key key=sectionsIterator.createKey(key_str);
    if(key!=null)
    sectionsIterator.setCurrentRowWithKey(key.toStringFormat(true));
              executeOperationBindings("CreateInsert1");
              Now i have a problem of setting the parent to the current row on the iterator of the parent i am getting null pointer exception when tried to set the key.
    Thanks,
    Raj
    Edited by: RajaSekharReddy.M on Jan 30, 2013 6:11 AM
    Edited by: RajaSekharReddy.M on Jan 31, 2013 4:39 AM

    Rajasekhar ,
    What model layer do you use ? If ADF BC then shouldn't the parent child relationship already been defined as a View Link ?
    Also I'm a little confused as to why you are setting a hardcoded the key with a string , since you are clicking the command link from the row , you should be accessing it as
    #{section.sectionId}
    Also I didnot understand this line-
    Now i have a problem of setting the parent to the current row on the iterator of the parent i am getting null pointer exception when tried to set the key.A small tip is you can start giving briefly what you are trying to achieve and whats failing to get accurate replies . Please refer -
    https://forums.oracle.com/forums/ann.jspa?annID=56

  • How to set current row in calendar

    Hi All,
    I am implementing ADF calendar using ADF faces. When i click on any activity the current row selected is not being displayed. Instead it always points to the last row of the VO.
    How to i explicitly set the current row to the selected row.(this can be declaratively achieved in tables selectedRow property)
    Thanks
    Sandeep.G

    Use the following code to default the calender date to today's.
      public void initializeSearchFormData()
        String methodName = "initializeSearchFormData()";
        _logger.entering(CLAZZ_NAME, methodName);
        MapDataSearchFormVOImpl searchDataVO = getMapDataSearchForm();
        // only create if we don't have any rows yet
        if (searchDataVO.getEstimatedRowCount() == 0)
          _logger.logp(Level.FINEST, CLAZZ_NAME, methodName,
                       "Creating new row for MapDataSearchFormVOImpl.");
          MapDataSearchFormVORowImpl newRow =
            (MapDataSearchFormVORowImpl) searchDataVO.createRow();
          newRow.setSELECT_DATE(DateTimeUtil.singleton().getCurrentJboDate());
          searchDataVO.clearCache();
          searchDataVO.insertRow(newRow);
          searchDataVO.setCurrentRow(newRow);
       * Container's getter for MapDataSearchForm.
       * @return MapDataSearchForm
      public MapDataSearchFormVOImpl getMapDataSearchForm()
        return (MapDataSearchFormVOImpl) findViewObject("YOUR VO NAME");
        _logger.exiting(CLAZZ_NAME, methodName);
      }Regards,
    Kiran Konjeti

  • Need to Set Current Row when Using Built-in Data Control Delete Operation?

    I have an af:table bound to a ViewObject (VO) collection (no Entity Object) - within each row, I include a column that contains a 'Remove' command button so the user can remove the row. I add the command button by dragging/dropping the built-in delete operation from the VO on the Data Control Palette. When I use this as is (no changes), the Remove button always deletes the first row in the collection, not the selected row. Do I need to add code to set the current row, and if so can someone please provide an example and specify where I need to add? thanks.
    ------ .jspx af:table with command button to remove each row ------
    <af:table value="#{bindings.ListView1.collectionModel}" var="row"
    rows="#{bindings.ListView1.rangeSize}"
    first="#{bindings.ListView1.rangeStart}"
    // note: I don't have any code added for selectedRow or makeCurrent - assuming this is built-in?
    selectionState="#{bindings.ListView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.ListView1.collectionModel.makeCurrent}">
    <af:column>
    <af:commandButton actionListener="#{bindings.Delete.execute}"
    text="Remove"
    disabled="#{!bindings.Delete.enabled}"/>
    </af:column>
    ---------- corresponding pagedef file ------------
    <bindings>.....
    <action id="Delete" IterBinding="ListView1Iterator"
    InstanceName="SrchDataControl.ListView1"
    DataControl="SrchDataControl" RequiresUpdateModel="false"
    Action="30"/>
    </bindings>
    Note: I also tried solution posted on following thread, but again, only first row is deleted, not the selected row?: Delete and Commit
    Message was edited by:
    javaX

    I just want to delete (or remove) it from the VO. Data for this VO is not on the database.
    The function is doing what I want it to do (delete from the VO), its just always deleting the first row, versus the selected row. I select the command button next on a column next to an item further down in the list and it deletes the first row. The problem is setting the selected row to be removed - I thought setting the current row would be taken care of by the SelectListener?
    selectionState="#{bindings.MyIspListView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.MyIspListView1.collectionModel.makeCurrent}"

  • Set current row with key

    i have 3 tables master-details. for example I have tables a,b,c. table a is master for table b and b is master for table c .
    on first page I display a and b data as ADF master table- detail table when I click on submit button should be go to page tow to create new record in table c and set the FOREIGN KEY .

    If you have view links specified, then it's handled automatically (like Frank said). Suppose the following data model:
    Companies - Departments - Employees
    Make sure there exists an instance of the Companies VO in your datacontrol having Departments as a child and the Departments having Employees as child. If not create it in the data model of your service.
    Companies
    ->Departments
    -->Employees
    I will try to make an example today.
    Regards,
    Koen Verhulst

  • How to get current row of Advanced table with no submit

    I have an advanced table with an 'Add another button'. When an empty row is created by clicking this button, LOV is used on the first column to populate other fields of the row. The rows of the table carry a button called "Add dependencies" whose functionality is to take the user to a different table to add rows to a different VO. This button is just a button and not a submitButton. I am passing the row's primary key as part of the URI as Vo attribute FdTaskId={@FdTaskId}
    The button works perfectly fine for database fetched rows (rows already present in the database), but, for the rows created using 'Add Another button', though LOV populates all fields including the primary key, the URI parameter passes null to the next page. That means, the VO attribute is not set. This works fine only when a 'submit' happens in the first page. For example, if I click Add another row again, then the previously inserted row passes the primary key fine as part of {@FdTaskId}.
    Could you please help me how I can resolve this issue?
    Thanks,
    Datta

    I am doing exactly that. My issues is that, VO attribute is passed correct for the table rows which are fetched from the database. For the table rows which got created through 'Add Another button', the VO attribute passed through URI as {@FdTaskId} is returning null. The VO attribute sets only when a form submit happens. For example, after adding a row through 'Add another row' button, click the same button again to add one more row and now go back to previously added row and now you can see that its VO attribute is set ({@FdTaskId} carries value )

  • How to get current row value from table when press the submit button

    Hi,
    I want to get the current row value of SuccessionPlanId which is one of the column in a advanced table.
    I created one button (created using personalization, action fired thru CO)in the table as column, so each row having one button, if i press the first row's button means then i want to fetch the first row's SuccessionPlanId and if it is 3rd means then i want to get the value of third row's value.
    How to do it in controller extension?
    Please reply soon, its urgent.
    Thanks in advance,
    SAN

    Pratap,
    Yes, I tried with 'delete' button which is seeded one.
    For this, our code using row reference is working too fine. it throws exact SuccessionPlanId value of corresponding row.
    I created MessageStyledText, but here i need to give text value right, then only it 'll appear in the page.
    Instead i created one image and fired explicitly from the controller processRequest method.
    But the same problem remains..
    here my code:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean){
    super.processRequest(pageContext, webBean);
    OAButtonBean oabb = (OAButtonBean)webBean.findChildRecursive("XXSubmit");
    FireAction action = new FireAction("XXSubmit");
    oabb.setAttributeValue(UIConstants.PRIMARY_CLIENT_ACTION_ATTR, action);
    OAImageBean oaib=(OAImageBean)webBean.findChildRecursive("XXSubmitImage");
    oaib.setFireActionForSubmit("XXSubmitImage", null, null, true);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean){
    if("XXSubmitImage".equals(pageContext.getParameter("event"))){
    String succIdI="";
    String rowRefI = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    if(rowRefI != null && !("".equalsIgnoreCase(rowRefI ))){
    PerSuccPlanSearchVORowImpl rowI = (PerSuccPlanSearchVORowImpl)oaam.findRowByRef(rowRefI);
    if(rowI != null)
    succIdI=rowI.getAttribute("SuccessionPlanId").toString();
    }else{
    throw new OAException("Row is null");
    throw new OAException(succIdI, OAException.INFORMATION);
    }else{
    super.processFormRequest(pageContext, webBean);
    If i run the page using this controller, it throws exception without any value, because for 'succIdI' i initialized without any string.
    Can you please suggest me how to solve?

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • Pass current row data from table and pass it to a method in AM

    Hi All,
    I have a table with row selection enabled. Also for each row I have a select image which on selection should pass the data from one of the columns of the current row selected to a method in AM.
    Can anybody let me know on "How on selection of the image in any row, can I pass the column data to the method in AM?".
    Thanks,
    Vijay

    Hi,
    the most easiest and straight forward approach is
    - Ckick the "Binding" tab at the bottom of the Visual Editor
    - In the Bindings section click teh green plus icon and choose Generic Bindings | Attribute Value
    - point the iterator selection to the iterator used by the table
    - choose the column's attribute name from the list of attributes
    - Create a method on the ApplicatioNModule IMPL class (should take single argument)
    - expose it as a client interfaces so it shows in the Data Controls panel
    - In the "Binding" tab, create a method binding for this exposed method
    - point the method binding argument to #{bindings.column-attribute-name.inptValue}
    So whenever you need to pass the value on to the AM, you just call the method binding
    OperationBinding oper = (OperationBinding) bindings.get("name of method");
    oper.execute();
    Frank

  • ADF TreeTable One row data to create a master-detail parent-child relation

    I want to display an editable detail table on a page. The problem is the detail table has many fields so that the screen scrolls horizontally. I need my page to just fit on one page without scrolling.
    now my idea is to use a TreeTable. A lot of fields on the detail table will act as children of the main node so I can fit the table onto one screen without scrolling.
    So there is really no master detail relationship because Im referring to the same row data.
    Not the usual use case of using a Tree Table but just wondering if this is possible. I posted this hoping that anyone could shed a light on this.
    regards,
    Anton

    You can do that like in this example:
    http://apex.oracle.com/pls/apex/f?p=31517:278
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Programmatically Inserting Row in a 1-1 Master Detail

    JDeveloper 11.1.1.2.0
    In a 1-1 relationship, your accessor will be returning a ROW instead of a ROWITERATOR/ROWSET.
    This means that you first need to create a row to even set the row rather than getting the rowset and inserting directly. I'm looking for the best way to insert a row in both the master and detail programmatically.
    So far what i've done so far are:
    1. Inside VO i have a method that i expose that creates master row then creates detail row using their entity definition:
    <masterName>EntityImpl masterRow = <masterName>EntityImpl.getDefinitionObject().createInstance2(this.getDBTransaction(), null);
    <detailName>EntityImpl detailRow = <detailName>EntityImpl.getDefinitionObject().createInstance2(this.getDBTransaction(), null);
    detailRow.setAttribute("masterId",masterRow.getAttribute("masterId));
    2. Create in ApplicationModule by getting VO's and utilizing create and insert VO methods.
    I'm wondering if there is a different approach in doing this. Take note that this is a 1-1 relationship.

    Drag the Create operation for your VO to the page as the first button.
    Then use the same VO in the pop-up as a form where people insert the data.
    http://andrejusb.blogspot.com/2010/05/crud-operations-in-oracle-adf-11g-table.html

  • Add a new row in Detail form in MASTER DETAIL FORM

    Hello Everyone,
    I need help on the following.I have master detail form .In detail form i have Add Row button which adds a new row and i have save button to save the record .But now if i am adding a row its not adding a new row .It says it process but didn't show the new row .
    Can somebody help me on this
    thanks in advance

    Hello,
    How many records do you show in your detaii region and how many are there for that master? Maybe the new row is in the next set of records - or at the 'bottom' of the last set of records?
    Did you check if the row is inserted in the database (and just didn't show up for one reason or another)?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

Maybe you are looking for

  • CIN pricing procedure and normal procedure linkup

    Hi gurus How do we link cin pricing procedure taxinn and normal pricing procedure rvaa01(for example) what are the confi settings....like we maintain jexp,jeap etc, in taxinn and pr00,k004,k005 in rvaa01, ver do we linkup these two pricing procedure

  • Showing dim for parameter in selection screen

    hi, i would like to have 2 parameters become dim (not active) when selection screen showing so that user not allowed to enter anything. i tried both method but also not working. what i have missed. thanks p_1 DEFAULT 'SS' MODIF ID dim, p_2 DEFAULT 'M

  • SQL Server 2000 -collation.

    Hi, If its important collation in SQL Server 2000, i have - SQL_Latin1_General_CP850_BIN(master, msdb, model etc.), but DB <SAP> haves SQL_Latin1_General_CP850_BIN2. I try to change collation on the server by instcoll.exe but i have error: C:\col\ins

  • Link authorization object to transaction code

    Hi to all how to link authorization object to transaction code? i think we can do by using SU24, i am not getting how to do ? can any one help me on this Immediately Regards raadha

  • Can a java code interact with trigger

    Hi guyz , is there any way by which a trigger can interact with JDBC ? I want to check the database each time its updated and if some condition is violated , the info((row from table which has voilated some rule) is passed to java code which can then