Add row in ADF table

I'm trying to add a new row to ADF table. Here are my steps:
1. Create new entities from tables (New -> EJB -> Entities from Tables)
2. Create Session Bean (New -> EJB -> Session Bean) with all requested methods for earlier created entity
3. Create Data Control out of it (right click on session bean -> Create Data Control) - it creates "testFindAll"
4. After these steps, I drag&drop my "testFindAll" from data controls to form and create table
5. Now, I drag&drop operation Create from my "testFindAll -> Operations", create button and change action from Create to CreateInsert
And now, the troubles : ((.. When I click button to add new row I get null pointer exception. Here is part of trace:
java.lang.NullPointerException
at oracle.adf.model.adapter.bean.UpdatableBeanDataControl.createRowData(UpdatableBeanDataControl.java:137)
at oracle.adf.model.bean.DCBeanDataControl.createRowData(DCBeanDataControl.java:642)
at oracle.adf.model.bean.DCDataVO.doCreateData(DCDataVO.java:870)
at oracle.adf.model.bean.DCDataRow.create(DCDataRow.java:306)
at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:432)
at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:4679)
at oracle.adf.model.bean.DCDataVO.createInstance(DCDataVO.java:567)
at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1818)
at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2211)
at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2257)
at oracle.jbo.server.ViewRowSetImpl.createRow(ViewRowSetImpl.java:2233)
at oracle.jbo.server.ViewObjectImpl.createRow(ViewObjectImpl.java:9404)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1223)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2120)
at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:464)
at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:307)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:693)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:217)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
I know that I it possible to do this if you create ViewObject instead of Entities from Tables and SessionBean. But I need this approach.
Thanks a lot!

Hi Goran,
What is your JDev version? Are you trying with EJB 3.0 or 2.1? I just tried (with 3.0) and it is working fine (tested in JDev 11.1.1.2.0).
Here is my pagedef
<action IterBinding="deptFindAllIterator" id="Create"
            RequiresUpdateModel="true" Action="createRow"/>Infact, i don't have to change the Create action to CreateInsert. By default it was CreateInsert only.
-Arun

Similar Messages

  • Issue Using CreateInsert to Add Row to ADF Table

    I am using JDev 11.1.2 and have a pretty simple application. The application contains tabs and each tab displays a page fragment. In each page fragment, I have a panelstretch layout. In the top facet I have a form and in the center facet I have a table. I am having an issue once deploying to a standalone WLS server. It works as desired when run locally through the integrated wls. User clicks CreateInsert button and it clears the form and inserts a blank into the table. User clicks Commit and the data appears in the adf table. Pretty simple and straight forward. However, when deployed to the standalone wls the user clicks CreateInsert button the form clears and all the rows in the adf table disappear. I can reload the page and then the rows appear, including the blank one. I have tested this in IE 8 (both in and out of compatibility mode), Firefox 12, and Chrome and get the same results.
    I have one page fragment that it works correctly on when deployed to standalone WLS. All other fragements behave like I described above. I compared the jsff, pagedef, and view objects. I do not see any difference between them. I posted the jsff code below, but I can also post the pagedef code if needed. Any direction on how to resolve this would be great. Am I missing something obvious?? Thanks for any help or advice you can lend!
    ******Working jsff*****
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">
    <af:panelStretchLayout id="psl1" styleClass="AFStretchWidth" startWidth="0px" topHeight="185px" bottomHeight="0px"
    endWidth="0px" dimensionsFrom="auto">
    <f:facet name="bottom"/>
    <f:facet name="center">
    <af:panelGroupLayout id="pgl1" layout="scroll">
    <af:panelCollection id="pc1" styleClass="AFStretchWidth">
    <f:facet name="menus">
    <af:menu text="Print Menu" id="m1">
    <af:commandLink text="Print Notes" id="cl1" useWindow="true" partialSubmit="true">
    <af:setActionListener from="au_notes" to="#{pageFlowScope.jrxml}"/>
    <af:fileDownloadActionListener contentType="application/pdf" filename="Report"
    method="#{JasperBean.printreport}"/>
    </af:commandLink>
    </af:menu>
    </f:facet>
    <f:facet name="toolbar">
    <af:toolbar id="t2">
    <af:commandButton actionListener="#{bindings.CreateInsert.execute}" text="Insert"
    disabled="#{!bindings.CreateInsert.enabled}" id="cb2"/>
    <af:commandButton actionListener="#{bindings.Delete.execute}" text="Delete"
    disabled="#{!bindings.Delete.enabled}" id="cb3"/>
    </af:toolbar>
    </f:facet>
    <f:facet name="statusbar"/>
    <af:table value="#{bindings.TAuOrgNotesView1.collectionModel}" var="row"
    rows="#{bindings.TAuOrgNotesView1.rangeSize}"
    emptyText="#{bindings.TAuOrgNotesView1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.TAuOrgNotesView1.rangeSize}" rowBandingInterval="0"
    selectedRowKeys="#{bindings.TAuOrgNotesView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.TAuOrgNotesView1.collectionModel.makeCurrent}" rowSelection="single"
    id="t1" styleClass="AFStretchWidth" partialTriggers="::cb2 ::cb3 :::cb1" autoHeightRows="10">
    <af:column sortProperty="#{bindings.TAuOrgNotesView1.hints.NoteDate.name}" sortable="false"
    headerText="#{bindings.TAuOrgNotesView1.hints.NoteDate.label}" id="c1" width="60">
    <af:outputText value="#{row.NoteDate}" id="ot1">
    <af:convertDateTime pattern="#{bindings.TAuOrgNotesView1.hints.NoteDate.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="#{bindings.TAuOrgNotesView1.hints.NoteInitials.name}" sortable="false"
    headerText="#{bindings.TAuOrgNotesView1.hints.NoteInitials.label}" id="c2" width="60">
    <af:outputText value="#{row.NoteInitials}" id="ot2"/>
    </af:column>
    <af:column sortProperty="#{bindings.TAuOrgNotesView1.hints.NoteNote.name}" sortable="false"
    headerText="#{bindings.TAuOrgNotesView1.hints.NoteNote.label}" id="c3" width="700" noWrap="true">
    <af:outputText value="#{row.NoteNote}" id="ot3"/>
    </af:column>
    </af:table>
    </af:panelCollection>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="start"/>
    <f:facet name="end"/>
    <f:facet name="top">
    <af:panelBox text="Note Info" id="pb1" rendered="#{bindings.NoteSeqNumber.inputValue!=null}">
    <f:facet name="toolbar">
    <af:commandButton actionListener="#{bindings.Commit.execute}" text="Save" id="cb1" partialSubmit="true"/>
    </f:facet>
    <af:panelGroupLayout layout="horizontal" id="pgl2" valign="top"
    rendered="#{bindings.NoteSeqNumber.inputValue!=null}">
    <af:panelFormLayout id="pfl1">
    <af:inputText value="#{bindings.NoteSeqNumber.inputValue}" label="#{bindings.NoteSeqNumber.hints.label}"
    required="#{bindings.NoteSeqNumber.hints.mandatory}"
    columns="#{bindings.NoteSeqNumber.hints.displayWidth}"
    maximumLength="#{bindings.NoteSeqNumber.hints.precision}"
    shortDesc="#{bindings.NoteSeqNumber.hints.tooltip}" id="it1" visible="false">
    <f:validator binding="#{bindings.NoteSeqNumber.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.NoteSeqNumber.format}"/>
    </af:inputText>
    <af:inputDate value="#{bindings.NoteDate.inputValue}" label="#{bindings.NoteDate.hints.label}"
    required="#{bindings.NoteDate.hints.mandatory}"
    columns="#{bindings.NoteDate.hints.displayWidth}"
    shortDesc="#{bindings.NoteDate.hints.tooltip}" id="id1">
    <f:validator binding="#{bindings.NoteDate.validator}"/>
    <af:convertDateTime pattern="#{bindings.NoteDate.format}"/>
    </af:inputDate>
    <af:selectOneChoice value="#{bindings.NoteInitials.inputValue}" label="#{bindings.NoteInitials.label}"
    required="#{bindings.NoteInitials.hints.mandatory}"
    shortDesc="#{bindings.NoteInitials.hints.tooltip}" id="soc1">
    <f:selectItems value="#{bindings.NoteInitials.items}" id="si1"/>
    </af:selectOneChoice>
    <af:inputText value="#{bindings.NoteNote.inputValue}" label="#{bindings.NoteNote.hints.label}"
    required="#{bindings.NoteNote.hints.mandatory}" columns="105"
    maximumLength="#{bindings.NoteNote.hints.precision}"
    shortDesc="#{bindings.NoteNote.hints.tooltip}" id="it2" rows="5">
    <f:validator binding="#{bindings.NoteNote.validator}"/>
    </af:inputText>
    </af:panelFormLayout>
    <af:panelFormLayout id="pfl2" rows="2" maxColumns="2">
    <f:facet name="footer"/>
    <af:inputText value="#{bindings.NoteCreatedBy.inputValue}" label="#{bindings.NoteCreatedBy.hints.label}"
    required="#{bindings.NoteCreatedBy.hints.mandatory}"
    columns="#{bindings.NoteCreatedBy.hints.displayWidth}"
    maximumLength="#{bindings.NoteCreatedBy.hints.precision}"
    shortDesc="#{bindings.NoteCreatedBy.hints.tooltip}" id="it3">
    <f:validator binding="#{bindings.NoteCreatedBy.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.NoteModifiedBy.inputValue}" label="#{bindings.NoteModifiedBy.hints.label}"
    required="#{bindings.NoteModifiedBy.hints.mandatory}"
    columns="#{bindings.NoteModifiedBy.hints.displayWidth}"
    maximumLength="#{bindings.NoteModifiedBy.hints.precision}"
    shortDesc="#{bindings.NoteModifiedBy.hints.tooltip}" id="it4">
    <f:validator binding="#{bindings.NoteModifiedBy.validator}"/>
    </af:inputText>
    <af:inputDate value="#{bindings.NoteDateCreated.inputValue}" label="#{bindings.NoteDateCreated.hints.label}"
    required="#{bindings.NoteDateCreated.hints.mandatory}"
    columns="#{bindings.NoteDateCreated.hints.displayWidth}"
    shortDesc="#{bindings.NoteDateCreated.hints.tooltip}" id="id2">
    <f:validator binding="#{bindings.NoteDateCreated.validator}"/>
    <af:convertDateTime pattern="#{bindings.NoteDateCreated.format}"/>
    </af:inputDate>
    <af:inputDate value="#{bindings.NoteDateModified.inputValue}"
    label="#{bindings.NoteDateModified.hints.label}"
    required="#{bindings.NoteDateModified.hints.mandatory}"
    columns="#{bindings.NoteDateModified.hints.displayWidth}"
    shortDesc="#{bindings.NoteDateModified.hints.tooltip}" id="id3">
    <f:validator binding="#{bindings.NoteDateModified.validator}"/>
    <af:convertDateTime pattern="#{bindings.NoteDateModified.format}"/>
    </af:inputDate>
    </af:panelFormLayout>
    </af:panelGroupLayout>
    </af:panelBox>
    </f:facet>
    </af:panelStretchLayout>
    </jsp:root>
    *** Non Working jsff****
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">
    <af:panelStretchLayout id="psl1" styleClass="AFStretchWidth" startWidth="0px" topHeight="125px" bottomHeight="0px"
    endWidth="0px" dimensionsFrom="auto">
    <f:facet name="bottom"/>
    <f:facet name="center">
    <af:panelGroupLayout id="pgl1" layout="scroll">
    <af:panelCollection id="pc1" styleClass="AFStretchWidth">
    <f:facet name="menus"/>
    <f:facet name="toolbar">
    <af:toolbar id="t2">
    <af:commandButton actionListener="#{bindings.CreateInsert.execute}" text="Insert"
    disabled="#{!bindings.CreateInsert.enabled}" id="cb1"/>
    <af:commandButton actionListener="#{bindings.Delete.execute}" text="Delete"
    disabled="#{!bindings.Delete.enabled}" id="cb3"/>
    </af:toolbar>
    </f:facet>
    <f:facet name="statusbar"/>
    <af:table value="#{bindings.TAuInvestigatorsView1.collectionModel}" var="row"
    rows="#{bindings.TAuInvestigatorsView1.rangeSize}"
    emptyText="#{bindings.TAuInvestigatorsView1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.TAuInvestigatorsView1.rangeSize}" rowBandingInterval="0"
    selectedRowKeys="#{bindings.TAuInvestigatorsView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.TAuInvestigatorsView1.collectionModel.makeCurrent}" rowSelection="single"
    id="t1" styleClass="AFStretchWidth" partialTriggers="::cb1 ::cb3 :::cb2" autoHeightRows="10">
    <af:column sortProperty="#{bindings.TAuInvestigatorsView1.hints.InvFirstName.name}" sortable="false"
    headerText="#{bindings.TAuInvestigatorsView1.hints.InvFirstName.label}" id="c1" width="60">
    <af:outputText value="#{row.InvFirstName}" id="ot1"/>
    </af:column>
    <af:column sortProperty="#{bindings.TAuInvestigatorsView1.hints.InvLastName.name}" sortable="false"
    headerText="#{bindings.TAuInvestigatorsView1.hints.InvLastName.label}" id="c2">
    <af:outputText value="#{row.InvLastName}" id="ot2"/>
    </af:column>
    <af:column sortProperty="#{bindings.TAuInvestigatorsView1.hints.InvStatus.name}" sortable="false"
    headerText="#{bindings.TAuInvestigatorsView1.hints.InvStatus.label}" id="c3">
    <af:outputText value="#{row.InvStatus}" id="ot3"/>
    </af:column>
    <af:column sortProperty="#{bindings.TAuInvestigatorsView1.hints.InvInitials.name}" sortable="false"
    headerText="#{bindings.TAuInvestigatorsView1.hints.InvInitials.label}" id="c4">
    <af:outputText value="#{row.InvInitials}" id="ot4"/>
    </af:column>
    </af:table>
    </af:panelCollection>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="start"/>
    <f:facet name="end"/>
    <f:facet name="top">
    <af:panelBox text="Investigator Info" id="pb1">
    <f:facet name="toolbar">
    <af:group id="g1">
    <af:commandButton actionListener="#{bindings.Commit.execute}" text="Save" id="cb2" partialSubmit="true"/>
    </af:group>
    </f:facet>
    <af:panelFormLayout id="pfl1" maxColumns="2" rows="2">
    <af:inputText value="#{bindings.InvFirstName.inputValue}" label="#{bindings.InvFirstName.hints.label}"
    required="#{bindings.InvFirstName.hints.mandatory}"
    columns="#{bindings.InvFirstName.hints.displayWidth}"
    maximumLength="#{bindings.InvFirstName.hints.precision}"
    shortDesc="#{bindings.InvFirstName.hints.tooltip}" id="it1">
    <f:validator binding="#{bindings.InvFirstName.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.InvLastName.inputValue}" label="#{bindings.InvLastName.hints.label}"
    required="#{bindings.InvLastName.hints.mandatory}"
    columns="#{bindings.InvLastName.hints.displayWidth}"
    maximumLength="#{bindings.InvLastName.hints.precision}"
    shortDesc="#{bindings.InvLastName.hints.tooltip}" id="it2">
    <f:validator binding="#{bindings.InvLastName.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.InvStatus.inputValue}" label="#{bindings.InvStatus.hints.label}"
    required="#{bindings.InvStatus.hints.mandatory}"
    columns="#{bindings.InvStatus.hints.displayWidth}"
    maximumLength="#{bindings.InvStatus.hints.precision}"
    shortDesc="#{bindings.InvStatus.hints.tooltip}" id="it3">
    <f:validator binding="#{bindings.InvStatus.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.InvInitials.inputValue}" label="#{bindings.InvInitials.hints.label}"
    required="#{bindings.InvInitials.hints.mandatory}"
    columns="#{bindings.InvInitials.hints.displayWidth}"
    maximumLength="#{bindings.InvInitials.hints.precision}"
    shortDesc="#{bindings.InvInitials.hints.tooltip}" id="it4">
    <f:validator binding="#{bindings.InvInitials.validator}"/>
    </af:inputText>
    </af:panelFormLayout>
    <af:panelFormLayout id="pfl2" maxColumns="2" rows="2">
    <f:facet name="footer"/>
    <af:inputText value="#{bindings.InvCreatedBy.inputValue}" label="#{bindings.InvCreatedBy.hints.label}"
    required="#{bindings.InvCreatedBy.hints.mandatory}"
    columns="#{bindings.InvCreatedBy.hints.displayWidth}"
    maximumLength="#{bindings.InvCreatedBy.hints.precision}"
    shortDesc="#{bindings.InvCreatedBy.hints.tooltip}" id="it5">
    <f:validator binding="#{bindings.InvCreatedBy.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.InvModifiedBy.inputValue}" label="#{bindings.InvModifiedBy.hints.label}"
    required="#{bindings.InvModifiedBy.hints.mandatory}"
    columns="#{bindings.InvModifiedBy.hints.displayWidth}"
    maximumLength="#{bindings.InvModifiedBy.hints.precision}"
    shortDesc="#{bindings.InvModifiedBy.hints.tooltip}" id="it6">
    <f:validator binding="#{bindings.InvModifiedBy.validator}"/>
    </af:inputText>
    <af:inputDate value="#{bindings.InvDateCreated.inputValue}" label="#{bindings.InvDateCreated.hints.label}"
    required="#{bindings.InvDateCreated.hints.mandatory}"
    columns="#{bindings.InvDateCreated.hints.displayWidth}"
    shortDesc="#{bindings.InvDateCreated.hints.tooltip}" id="id1">
    <f:validator binding="#{bindings.InvDateCreated.validator}"/>
    <af:convertDateTime pattern="#{bindings.InvDateCreated.format}"/>
    </af:inputDate>
    <af:inputDate value="#{bindings.InvDateModified.inputValue}" label="#{bindings.InvDateModified.hints.label}"
    required="#{bindings.InvDateModified.hints.mandatory}"
    columns="#{bindings.InvDateModified.hints.displayWidth}"
    shortDesc="#{bindings.InvDateModified.hints.tooltip}" id="id2">
    <f:validator binding="#{bindings.InvDateModified.validator}"/>
    <af:convertDateTime pattern="#{bindings.InvDateModified.format}"/>
    </af:inputDate>
    </af:panelFormLayout>
    </af:panelBox>
    </f:facet>
    </af:panelStretchLayout>
    </jsp:root>

    This is too much code to digest, and it's not formatted (read the FAQ https://forums.oracle.com/forums/help.jspa to find out how to do this).
    So some general remarks: as it runs on your embedded WLS but not on a stand alone server it might be a configuration mismatch. Have you made sure that the standalone WLS runs the exact adf runtime libraries our jdev is using?
    Any errors in the log file on the standalone server?
    Have you tried to switch the tab order to find out if the problem is still on the not working jsff?
    Timo

  • Is there a way to add rows to a table in a fillable PDF?

    I have created a fillable form, but the table I've created only has 9 rows. I'd like to be able to expand the rows on demand. If they're needed, then the user could add rows to the table as needed. It's an expense form, so the rows need to be there when there are multiple expenses, but not there when there are only a few expenses. Any/all help is appreciated. Thanks!

    here's more background infomation... I have some audits setup on my database for one of my users. Every quarter I have an automated job that runs that creates a usage/statics report for this person using data in aud$. at the end of the job I export the aud$ table and truncate it. However last quarter I found that there was a mistake in my report and my export did not run properly thus my audit data was gone. i also have full datapump exports that run daily but found that aud$ was not there. so that is why I thought I'd like to include sys.aud$ in the full datapump exports.
    i understand why other sys tables would be left out of a full export but aud$ data cannot be reproduced so to me it makes sense to include it in a full export.
    don't worry, we run our true backups using rman which is eventually how I got the aud$ data back by creating a copy of my database up until the time of the truncate. however this was quite time consuming.

  • Focusing a field/column in the new row of adf table

    Hi all,
         I am using JDeveloper 11.1.2.4.0. and UI-Shell Template in Main application and sub applications are added to this master application as ADF library jar files. Application is working fine.
    I am trying to focus to make focus on a column in the newly created row in one of the sub application by referring the below link
    http://adfnbpel.wordpress.com/2013/08/14/focusing-a-fieldcolumn-in-the-new-row-of-adf-table/
    I created a single application and found that its working
    But in my application focus is not working.
    When i checked the java script by using FireBug console it is found that comp = AdfPage.PAGE.findComponent(‘”+inputId+”‘); is getting as "undefined" , where inputId = table.getClientId(facesCtx) + “:” + rowId + “:” + “it3″; I am getting the exact row id also. When i tried with by passing the table id as input id like inputId = table.getClientId(facesCtx) ; the fire bug console then showing the table id. So its sound strange.
    What may be the cause of not able to find the input text it3 by using findComponent ?
    Is any body can suggest a solution for this.
    Thanks in advance,
    Gijith

    Hi,
    read up about "findComponentByAbsoluteLocator" in http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
    or check ...
    AdfPage JS doc
    Frank

  • Fixed number of rows in ADF table

    Can we specify fixed number of rows for ADF table so even no rows displayed it will still show 10 empty rows.

    the rangesize property determines how many rows will be displayed and controls paging. If there are no rows to begin with (if I understand the question correctly) rangesize won't have any effect.

  • How to set a row as default row in adf table

    Hi,
    I have a requirement: when page is launched there are multiple records with different status displayed on the page and i had to make the first record with Status = XXX as default selected row in adf table. How to code it?
    Thanks!
    Susan

    Hi Frank,
    Thanks a lot for your quick response!
    We are using Jdev 11g. After received your response, i went through all of your responses in ADF coner and OTN for the related topics (setting detail row) and got some ideas(Specially, i got your detail coding for moving makeCurrent expression into selection listener method into backing bean, etc ) and was ready for coding this function. But our PM changed their mind and we dont need this function. So, I had to move to another area......
    Your articles and your responses really help me!
    Thanks again for your help!
    Susan

  • Adobe Form (add row to  flowed table )

    Hi, experts
    I have a problem.
    I need add a row to subform flowed table , but when i  want to see preview a get an error:
    "Invalid inumerated value: indexChange
    the fault occured on line 1532.
    Script failed ( language is formalic; context is xfa[0].form[0].data[0].#subform[0].SubFormTable[0].Table1[0].Row1[0])
    script =
    ERROR: no expression encountered -- script result is undefined
    How can i solve this problem or how add row to flowed table  in different way.
    Thanks
    Larissa

    Larissa,
    Did you drag the Table element from standard library and used the first option of Create Simple Table? This should make the table static and you cannot add a row. Select the second option while creating a table and choose "Body Rows vary depending on data".
    Now drag-drop a button element from the standard library and in the click event make sure you have following code in JavaScript:-
    Table1.Row1.instanceManager.addInstance(1);
    Chintan

  • How to add new row to adf table progrmatically

    Hi,
    I have a bean with a list and correspoding getter & setter methods inside it.
    I created a datacontrol out of the bean and I am displaying af:table in the ui
    binded to this list.
    Ex:
    public class StudentBean {
    private List<Student> students;
    // getter & setter methods.
    jsp
    <af:table value="#{bindings.students.collectionModel}" var="row"
    rows="#{bindings.students.rangeSize}"
    emptyText="#{bindings.students.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.students.rangeSize}"
    rowBandingInterval="0"/>
    How to add a new row programitically to this adf table.
    I dragged and dropped 'Create' from operations menu on to jsp.
    But on click of that.no new row is being added to the current table.
    On click of a button in u.i I want to add a new row to the table.
    Thanks,
    Praveen

    Hi,
    The source code is as below.
    <af:table value="#{bindings.students.collectionModel}" var="row"
    rows="#{bindings.students.rangeSize}"
    emptyText="#{bindings.students.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.students.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.rscGroupsQuery.queryDescriptor}"
    queryListener="#{bindings.rscGroupsQuery.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.rscGroups.collectionModel.selectedRow}"
    selectionListener="#{bindings.rscGroups.collectionModel.makeCurrent}"
    rowSelection="single" id="t1"/>
    <af:commandButton actionListener="#{bindings.Create.execute}"
    text="Create" disabled="#{!bindings.Create.enabled}"
    id="cb1" partialTriggers="t1"/>
    Please let me know where am I doing wrong?
    On click of this button,it is not adding a row dynamically.
    Thanks,
    Praveen

  • Display and edit currently selected row of ADF Table in ADF Form

    I have an ADF Read-only Table and ADF Form, which were created from the same Data Control.
    I need to be able to edit the selected row of the table in the form (just like in "Binding Data Controls to your JSF page" part of "Developing RIA Web Applications with Oracle ADF" Tutorial). However, I can't figure out how to do this :(
    I found the following solution on the Web: #{bindings.DeptView1.currentRow.dataProvider.dname} - but it doesn't work, since "the class oracle.jbo.server.ViewRowImpl does not have the property dataProvider".
    Sorry for the newbie question.
    Thanks in advance for any help!

    Hi,
    AFAIK, dataProvider is not supported on ADF BC, hence the error.
    If you have created ADF Read only table and form from the same data control you just need to refresh the form based on table selection to show up the selected record, to do which you just need to add partialTriggers property to the panelFormLayout and set its value to the id of table
    Sireesha

  • Is it possible to programaticaly change active row in ADF table?

    JDev 11.
    I have a table which is filled with data programaticaly.
    When I add new row, it appears in table and I want to make this row active automatically, so last insert row should become active.
    Is it possible?

    Hi Julian, thanks for your response, but your example is different from my case
    My source:
    public String SaveCompany() {
    // get company details from input fields
    GetCompanyDetails();
    // save changes to DB
    SaveCompanyToDB(com);
    //refresh company list
    AdfFacesContext.getCurrentInstance().addPartialTarget(table);
    return null;
    I'am adding new entry into DB and I want to populate table after that action, and automatically select that new row (new row should become lighted).
    I have found that there is a atribute First(), I have tried to use it, but it didnt help.
    So question is, does ADF table have atribute to define active table row from code?

  • How to limit no of rows in ADF table

    Hi all,
    i want to limit the number of rows displayed in ADf table. I tried using range size, but it didn't work. In the post
    Limiting ADF table number of rows is not working
    it was stated that it is a bug. Is it fixed now or is there any work around to fix this.
    Thanks in advance,
    Nad

    Hi Nad..
    Hope this would help you..
    Suppose you have these..
    Jspx Page - RangeTable.jspx
    Backing Class - RangeTable.java
    Iterator used to load Table in page definition - ViewObjTableData
    First of all In your pagedefinition page change the RangeSize value to -1 to display all rows in your table like
    <iterator id="ViewObjTableDataIterator" RangeSize="-1"
                  Binds="ViewObjTableData" DataControl="AppModuleDataControl"/>Now Goto your Backing bean and there put the setter getter method to limit your Table to show data as you want.. Like..
    public static int rangeSize = 10;   
        public void setRangeSize(int rangeSize) {
            this.rangeSize = rangeSize;
            AdfFacesContext.getCurrentInstance().addPartialTarget(table1);
        public int getRangeSize() {
            return rangeSize;
        }Line having this is your default no of rows which you will get on table load..
    public static int rangeSize = 10;and
    this will forcely refresh your table according to your choise
    AdfFacesContext.getCurrentInstance().addPartialTarget(table1);Now come to Your Jspx page and
    Add af:selectOneChoice to Action facet of your table and add some selectItem having value of *10*,*20*, and *30* According to your choise
    <af:selectOneChoice label="Row Limit" autoSubmit="true"
                                          binding="#{backing_RangeTable.selectOneChoice1}"
                                          id="selectOneChoice1"
                                          value="#{backing_RangeTable.rangeSize}">
               <af:selectItem label="10" value="10"
                                       binding="#{backing_RangeTable.selectItem1}"
                                       id="selectItem1"/>
               <af:selectItem label="20" value="20"
                                       binding="#{backing_RangeTable.selectItem2}"
                                       id="selectItem2"/>
               <af:selectItem label="30" value="30"
                                       binding="#{backing_RangeTable.selectItem3}"
                                       id="selectItem3"/>
    </af:selectOneChoice>set its autoSubmit property to true and bind the value property to the rangeSize of your backing beans
    now in your table change binding property of Rows to your backingbean's rangeSize like
    rows="#{backing_RangeTable.rangeSize}"and also set this
    partialTriggers="selectOneChoice1"That all dear..
    Now check it out and let me know that you got your solution or not?
    and if you got your right answer then dont forget to put \[SOLVED\] tag with your subject line. and mark this answer as correct and helpful.. :-)
    Thanks,
    Fizzz...

  • How can I insert one row in ADF Table in JDeveloper 10.1.3

    Hi all,
    How can I add new row ADF Table in JDeveloper 10.1.3
    NOTE : I tried using create button still not working
    thanks

    If you are using ADF BC - try replacing the binding of the operation from Create to CreateInsert.
    See Re: A simple JSF Table CRUD - How To

  • Delete operation is not working to delete selected row from ADF table

    Hi All,
    We are working on jdev 11.1.1.5.3. We have one ADF table as shown below. My requirement is to delete a selected row from table, but it is deleting the first row only.
    <af:table value="#{bindings.EventCalendarVO.collectionModel}" var="row"
    rows="#{bindings.EventCalendarVO.rangeSize}"
    emptyText="#{bindings.EventCalendarVO.viewable ? applcoreBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET : applcoreBundle.TABLE_EMPTY_TEXT_ACCESS_DENIED}"
    fetchSize="#{bindings.EventCalendarVO.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.EventCalendarVO.collectionModel.selectedRow}"
    selectionListener="#{bindings.EventCalendarVO.collectionModel.makeCurrent}"
    rowSelection="single" id="t2" partialTriggers="::ctb1 ::ctb3"
    >
    To perform delete operation i have one delete button.
    <af:commandToolbarButton
    text="Delete"
    disabled="#{!bindings.Delete.enabled}"
    id="ctb3" accessKey="d"
    actionListener="#{AddNewEventBean. *deleteCurrentRow* }"/>
    As normal delete operation is not working i am using programatic approach from bean method. This approach works with jdev 11.1.1.5.0 but fails on ver 11.1.1.5.3
    public void deleteCurrentRow (ActionEvent actionEvent) *{*               DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    // Get an object representing the table and what may be selected within it
    ViewObject eventCalVO = dcItteratorBindings.getViewObject();
    // Remove selected row
    eventCalVO.removeCurrentRow();
    it is removing first row from table still. Main problem is not giving the selected row as current row. Any one point out where is the mistake?
    We have tried the below code as well in deleteCurrentRow() method
    RowKeySet rowKeySet = (RowKeySet)this.getT1().getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.getT1().ggetValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
    rowData.getRow().remove();
    The same behavior still.
    Thanks in advance.
    Rechin
    Edited by: 900997 on Mar 7, 2012 3:56 AM
    Edited by: 900997 on Mar 7, 2012 4:01 AM
    Edited by: 900997 on Mar 7, 2012 4:03 AM

    JDev 11.1.1.5.3 sounds like you are using oracle apps as this not a normal jdev version.
    as it works in 11.1.1.5.0 you probably hit a bug which you should file with support.oracle.com...
    Somehow you get the first row instead of the current row (i guess). You should debug your code and make sure you get the current selected row in your bean code and not the first row.
    This might be a problem with the bean scope too. Do you have the button (or table) inside a region? Wich scope does the bean have?
    Anyway you can try to remove the iterator row you get
    public void deleteCurrentRow (ActionEvent actionEvent) { DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    dcItteratorBindings.removeCurrentRow();Timo

  • How to delete a selected row from adf table

    Hi
    I am using a ADF Table to get data from the database, i need to select a specific row and then delete it how to get
    this done.
    Thanks in Advance.

    Or try this code:
    In your backing bean:
        public void deleteRows(ActionEvent actionEvent) {
            ((AppModuleImpl)getApplicationModuleForDataControl()).deleteRowEmp();
        public static Object resolveExpression(String expression)
                try
                    FacesContext facesContext = FacesContext.getCurrentInstance();
                    Application app = facesContext.getApplication();
                    ExpressionFactory elFactory = app.getExpressionFactory();
                    ELContext elContext = facesContext.getELContext();
                    ValueExpression valueExp =
                        elFactory.createValueExpression(elContext, expression, Object.class);
                    return valueExp.getValue(elContext);
                catch (Exception e)
                   ;// log you message here
                return null;
             * Get application module for an application module data control by name.
             * @param name application module data control name
             * @return ApplicationModule
            public static ApplicationModule getApplicationModuleForDataControl()
                return (ApplicationModule) resolveExpression("#{data.AppModuleDataControl.dataProvider}");
            }In your AppmoduleImpl:
        public void deleteRowEmp(){
            this.getEmpView1().removeCurrentRow();
            this.getDBTransaction().commit();
        }And another option is to expose the appmodule method as a client and bind to the jspx as a button.

  • Need sample code to get handle of Selected rows from ADF Table

    Hi,
    I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
    If anybody is having sample code to do this then please share with me.
    Thanks,
    ashok

    wow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
    also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
    Thanks,
    ashok

Maybe you are looking for