Problem in creating a row in backing bean for a view object..

hi,
i've created a view object and am trying to create multiple rows in my backing bean. but am not able to do that one. my 1st row is getting inserted and all the other values am not able to do. can anyone reply to this as soon as possible.
Thanks in advance,

Can you post your code?

Similar Messages

  • Problem in creating new row

    Hi,
    I am facing a strange problem. i have created many new rows and inserted the data, but now i am facing a strange problem.
    This is my requirement.
    I have table with table action button as create.
    when i click create it is not at all creating new row for the view object but instead it will take the row at the top of the table and replace that line with new data.
    Below is the code :
    In CO
    In PR
    if (!pageContext.isBackNavigationFired(false))
    TransactionUnitHelper.startTransactionUnit(pageContext, "RVSchematicAttributeCreateTxn");
    if (!pageContext.isFormSubmission())
    System.out.println("control entered create block");
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    System.out.println("before calling ");
    am.invokeMethod("createRVSchematicAttribute",null);
    System.out.println("after calling ");
    else
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "RVSchematicAttributeCreateTxn", true))
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    IN PFR
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if(pageContext.getParameter("Apply")!=null)
    System.out.println("apply button is clicked");
    OAViewObject vo = (OAViewObject)am.findViewObject("xxczVAGCSSchematicAttributeVO1");
    String schematicId = (String)vo.getCurrentRow().getAttribute("SchematicId");
    String msg= "SchematicId "+schematicId+"has been added";
    am.invokeMethod("apply");
    System.out.println("returned back to create CO");
    OAException confirmMessage = new OAException(msg,OAException.CONFIRMATION);
    pageContext.putDialogMessage(confirmMessage);
    pageContext.forwardImmediately("OA.jsp?page=/va/oracle/apps/xxcz/gcs/maintenance/webui/xxczVAGCSRVSchematicAttributeResultsPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    in AM
    public void createRVSchematicAttribute()
    System.out.println("entered createRVSchematicAttribute ");
    xxczVAGCSSchematicAttributeVOImpl vo = this.getxxczVAGCSSchematicAttributeVO1();
    // OAViewObject vo = (OAViewObject)this.getxxczVAGCSSchematicAttributeVO1();
    vo.setMaxFetchSize(0);
    vo.clearCache();
    if (!vo.isPreparedForExecution())
    vo.executeQuery();
    /* Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    System.out.println("Row.STATUS_INITIALIZED");*/
    int rowCount = vo.getRowCount();
    Row row = vo.createRow();
    vo.insertRowAtRangeIndex(rowCount, row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Please help me i don't know where i am going wrong. i have checked so many times but didn't find any bug.
    -Mithun

    Hi Zafar,
    Ok i will explain my problem with an example.
    I have employee table with following fields.
    Empname
    Empnumber
    Salary
    Table data
    Empname EmpNumber Salary
    Jack 10 1000
    sam 20 2000
    joe 30 3000
    Above is the table structure for which i need to add another row
    I have two page one results page and another create page
    In Results page i will show the above table structure with table action button "Create" in order to insert new record to table.
    When i click Create button it will navigate to create page
    In Create page i will get the below data
    Empname : Jack
    Empnumber :10
    Salary :1000
    Instead of
    Empname :
    Empnumber :
    Salary :
    suppose now if i change the jack to jack1 , 10 to 11 , or 1000 to 10001 and click submit
    Now the result page will show
    Empname EmpNumber Salary
    Jack1 11 1001
    sam 20 2000
    joe 30 3000
    No fourth row is created it is actually behaving like update functionality and updating the top most row.
    -Mithun

  • Need example of backing bean for selectBooleanCheckbox and dataTable

    Does anyone have an example backing bean for selectBooleanCheckbox and dataTable combination?
    I am trying to figure out how to create a dataTable with one column of checkboxes, when the checkboxes are selected, need to get a collection of all records that were selected.
    Also need to identify one of the columns in the records that were selected and send it to the EJB services to do update.
    columns in dataTable are userid and name. Both are string values.

    What is the difference between myDataItem, myDataItems and myDataList in MyBean.java?
    Where did myDataItem and myDataList come from? It isn't declared or initialized in MyBean.java

  • Shoul I have my backing beans extend my domain objects?

    Hi,
    In our JSF application, most of our backing beans have the same properties that a corresponding domain object.
    In order to have a clear separation between layers, we have a set of view objects and a separate set of domain objects. Once we populate the backing bean, we copy the value of properties to the domain object.
    Since all the properties of my domain object are duplicated in my backing beans, we were wondering if it is a good (or bad) idea to extend (inherit) my backing beans from my domain objects, and pass the backing beans to my persistence and business layers. This will save us some work.
    Thanks a lot for the advice.
    Mauricio L.

    I think I've solved my own issue though I'm not sure if it is the correct way to accomplish the task at hand.
    When the button for login is clicked and the logginButton_action() method is called inside of my login_jsp_backing class I do the following:
    User user = new User();
    FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("User", user);
    return user.doLogin(this.getInputUsername().getValue().toString(), this.getInputPassword().getValue().toString());
    (The String return of this method in User is a navigation rule I've setup in my faces-config)
    So my new question is that "Is this best practice?" or should I be doing it differently?
    Message was edited by:
    Steve Carlson

  • Setting bind variable for a view object from the Managed Bean

    Hi,
    i am using JDeveloper 11g, i have to create LOV in the JSF. To show the LOV, it has to populate data using View object and its query parameter need to be sent from the Managed Bean.
    For the View object i want to set the bind variable parameter from the managed bean value. bename is stored in a managed bean (session scope)
    #{beantest.bename}
    But it gives the following exception.
    JBO-29000: Unexpected exception caught:
    org.codehaus.groovy.control.MultipleCompilationErrorsException,msg=startup failed, Script1.groovy: 1: expecting '!',found '{'@ line1, column 2.
    I have followed the link http://kr.forums.oracle.com/forums/thread.jspa?threadID=615474 like Frank wrote on 8.2.2008:
    But steps are not clear.
    How to input the VO bind parameter with Managed bean variable?
    Any Help
    Regards
    Raj
    Edited by: user9928180 on Dec 17, 2008 9:51 AM

    Hi,
    a bind variable in a VO needs to be exposed as an executeWithParams operation in the pageDef file. Just add a new action binding to the pageDef file (context menu) and select the executeWithParams operation on teh VO. Then in the argument field, reference the managed bean property for the value
    Frank

  • Problem in Creating new row & inserting data using CreateInsert and Commit

    Hello All,
    I have created a page there are few input text and i want to insert the data into a database table. I have created an Application Module I am using CreateInsert and Commit operation but there is one problem.
    At first it created a row in database after that it is not creating the new row instead it is updating the same row with the new values.
    In bindings of my jspx page I have created two binding for action (1) CreateInsert for the VO of that Application Module (2) Commit operation of that Application Module.
    Here is the code snippet of my application:
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
    Object result = operationBinding.execute();
    *if (!operationBinding.getErrors().isEmpty()) {*
    return null;
    OperationBinding operationBinding1 = bindings.getOperationBinding("Commit");
    Object result1 = operationBinding1.execute();
    *if (!operationBinding1.getErrors().isEmpty()) {*
    return null;
    I have tried using Execute+Commit and Insert+Commit case also in every case it is updating the same row and not inserting a new row.
    Is there anything I am missing?
    Please Help.

    hi user,
    i dono. why are trying with codes. adf provides zero lines codes.
    a wonderful drag and drop functionality provide by the framework.
    while double click the button the codes are  registered in your bean
        public String cb6_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb8_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Commit");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb7_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Delete");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb14_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding =
                bindings.getOperationBinding("Delete4");   // some different here. after deleting usually do commit
            OperationBinding operationBinding1 =  
                bindings.getOperationBinding("Commit");    // so here commit operation.
            Object result = operationBinding.execute();
            Object result1 = operationBinding1.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            if (!operationBinding1.getErrors().isEmpty()) {
                //add error handling here
                return null;
            return null;
        }if am not understud correctly. please some more explanation need.

  • Binding an object tag value / Creating HTML via a backing bean

    I have a task flow that sets some properties in my backbean. I've bound the "classid" of an <object> tag to one of these values. However, the first time i load the JSFF page, the object tag isnt created, but if i refresh the page, its loaded correctly.
    This would lead me to believe that the binding isn't being done before the JSFF is rendered, so the question is. Does anyone know how to fix this? and if not, i have thought about creating a backing bean that would add the <object> tag to the page with the bind value, but have no idea how i would go about this.
    Does anyone know of any good tutorials on adding HTML via a backing bean before the page is rendered?

    After further investigation and talking to a colleague, It seems it might not be binding related, since if I print out the bind in a text field, it displays correctly. I think the problem is because I am trying to inject an object tag (hosts a .NET control) into a fragment, but this is never picked up and rendered. Thus, when I do a full page refresh, the object tag is added and all goes well.
    If I attempt to bind/add a ADF Faces component this way, it works correctly.
    Do you know how to inject code for a fragment?, I am very stuck at the moment - don't have that much knowledge on ADF, so any links/help would be appreciated.
    My scenario is this:
    I am using a task flow that has 2 fragments.
    Fragment 1: set properties - has two input fields and a next button which are bound to a bean that saves the input fields
    Fragment 2: display object tag using step ones properties.

  • How to Create ADF table from backing Bean

    Currently I am working on Jdeveloper11g.
    I have a requirement to create Table dyanamically .For that i will get info about table from config file.
    <?xml version="1.0" encoding="UTF-8"?>
    <Pages>
              <page1>
              <Type sortable = "false">TYPE</Type>     
                   <Decription sortable ="true">Description</Decription>
                   <Date sortable = "true" >Date</Date>
                   <Amount sortable ="false">Amount</Amount>
              </page1>
              <page2>
                   <Type sortable = "false">Account Number</Type>     
                   <Decription sortable ="true">Account Name</Decription>
                   <Date sortable = "true" >Creation Date</Date>
                   <Amount sortable ="false">Current Balance</Amount>
              </page2>
    </pages>
    Can you guide me what classes i have to use in backing bean.any sort of code or usefull Links will be highly appriciated.
    Thanks
    Jaydeep

    Hi Jaydeep,
    you can create ADF table using this code,
    RichTable table = new RichTable();
    table.setEmptyText("no rows yet");
    table.setVar("row");
    // add columns
    RichColumn column = new RichColumn();
    column.setHeaderText("Name");
    column.setId("id_column1");
    column.setAlign("right");
    column.setWidth("100");
    // Set output.
    RichOutputText output = new RichOutputText();
    output.setValue("value", "John M.");
    // Add output into column.
    column.getChildren().add(output);
    // Add column into table.
    table.getChildren().add(column);
    Good Luck.

  • How to update row in backing bean?

    Hallo,
    i want to do the following things ina backing bean of Jdev 10.1.3.3:
    - positioning to a special row, it has an Id
    - change the value of an attribute
    - update the row
    never before i have done that. any help is appreciated.

    Hi,
    If you're using ADF/BC you need to find the iterator to the view object that you want to update.
    To get the iterator you must first get your data bindings. This is how I get the binding container
    Map myMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
    DCBindingContainer dcbc = (DCBindingContainer)myMap.get("bindings");You can get the iterator using this:
    dcbc.findIteratorBinding("nameOfIterator");You can then set the current row with setCurrentRowWithKeyValue("someKey"), get the current row with getCurrentRow(), change an attribute on the Row with setAttribute(int,String) and you're all set.
    Hope this works for you,
    Mark

  • Problem to create multiple rows in adf table.

    Hi All,
    i am using jdev version 11.1.1.5.0. i have facing very strange problem to create row on table.
    In my use case i have create row on table under loop statement. so no of rows created based on loop condition. each time on loop we supply diffrenet value for column like subpkgid,sno but row created with same value.
    code is following-
        public void createRowOptHdr()
                  boolean flag=false;
                ViewObject reqhdrvo= getService().getView("StmReqhdrView1Iterator");
               Row reqhdrrow= reqhdrvo.getCurrentRow();
                ViewObject pkglist= getService().getView("PkgListOptHdr1Iterator");         
               ViewObject tskcdvo= getService().getView("GetTskSubtskCd1Iterator");
                System.out.println("Subtype===>"+reqhdrrow.getAttribute("Subtype"));          
                tskcdvo.setNamedWhereClauseParam("stype",reqhdrrow.getAttribute("Subtype"));
                Row tskrow=tskcdvo.first();
                int count =pkglist.getRowCount();
                ViewObject opthdr= getService().getView("StmOpthdrView2Iterator");
                           opthdr.executeQuery();
                Row optrow=null;
                Row pkgrow=null;
                for(int i=1;i<=count;i++)
                    if(i==1)
                    pkgrow=pkglist.first();
                    else
                        pkgrow=pkglist.next();
                    if(pkgrow.getAttribute("Mark")!=null)
                 flag=(Boolean)pkgrow.getAttribute("Mark");
                    else
                        flag=false;
                    if(flag)
                        optrow = opthdr.createRow();  
            optrow.setAttribute("Reqdt",reqhdrrow.getAttribute("Reqdt"));
            System.out.println("Pkg Id====>"+pkgrow.getAttribute("Id"));
            String id=(String)pkgrow.getAttribute("Id");
            System.out.println("id val==>"+id);
            optrow.setAttribute("Pkgid",reqhdrrow.getAttribute("V_Pkgid"));
            optrow.setAttribute("Subid",id);
            optrow.setAttribute("Sno",opthdr.getRowCount());
            optrow.setAttribute("ReqStatus","WAIT");
            optrow.setAttribute("LHier",reqhdrrow.getAttribute("LHier"));
            optrow.setAttribute("Subtype",reqhdrrow.getAttribute("Lanweb"));
            optrow.setAttribute("Divn",reqhdrrow.getAttribute("Divn"));
            optrow.setAttribute("Status","Y");
            optrow.setAttribute("TaskCd",tskrow.getAttribute("TaskCd"));
            optrow.setAttribute("SubtaskCd",tskrow.getAttribute("SubtaskCd"));
            opthdr.insertRow(optrow);
            try
            optrow.validate();
            catch(Exception e)
                System.out.println("Error to validate opt hdr row===>"+e);
            //opthdr.executeQuery();
                } i have called this method on a button click so no of row selected on pkglist vo same no of row created. and these row are different pkgid but when i again select some row from pkglist and click on button thease row created with same sno ,subpkgid as first row.

    Have you used the debugger and dropped through the code?
    Have you checked that opthdr.getRowCount() returns a different value each time?
    Using the method isn't optimal as it will iterate over the towards each time. Next you'll get duplicate numbers if more then one user works with the application and end up clicking the button. You should use a sequence for this.
    Timo

  • Where should backing bean for bounded-task-flow be declared?

    I have a bounded-task-flow that is used inside a dynamic region.
    I declared a managed bean to be used by activities (method/view) using the "backingBean" scope managed bean.
    There are two possible places that I can register the managed bean:
    1. adfc-config.xml
    2. the bounded-task-flow-definition.xml
    What are the differences between declaring the "backingBean" scope bean in "adfc-config.xml" and in the bounded-task-flow definition?
    What is the best practice for registering "backingBean" scope bean?
    If I understand correctly, registering the bean in adfc-config.xml is for one or more bounded-task-flow that use the same Bean class for instantiating their own backing bean. If the backing bean java class is only use by specific bounded-task-flow then it should make no difference to register the bean in either xml files.
    Am I correct?

    It should be registered within the bounded task flow for a couple reasons:
    1) Help maintain the encapsulation of the bounded task flow for reuse
    2) Managed bean definition metadata residing in adfc-config.xml or bootstrap configuration file will be preloaded when the ADF application is started. The actual managed beans will be instantiated the first time they are referenced. Therefore, to avoid the preload place them in the bounded task flow.
    thanks.

  • How to add a backing bean for an existing jsp

    Hi You Experts,
    I am fixing an application built by someone else. In the application, some jsps do not have the associated backing beans. Now I want to add a backing bean to go with a particular jsp so that I can write codes there. How can I do this, please?
    Thanks in advance,
    ZD

    Hi Shay (and Others),
    As such a newbie, I cannot seem to find the "little arrow" or "binding property" you mentioned. I am using jdev 10.3.3.0. After I click on a component (an af:inputText), all I see is an "Edit Binding" link at the bottom of the Property Inspector. That link actually takes me to the binding of the component and attribute in the ViewObject.
    Also, when I followed your second suggestion (Design menu -> page properties->auto bind), I got a new backing file, but it's empty. i.e., it did not capture any existing components on the jsp.
    Please help me more. Thank you very much.
    ZD

  • To find out the last row that is updated in a View Object

    Hi OAF Gurus,
    I have requirement like,
    I have to find out the last row that is updated on a particular View Object and I have send a mail to the users about the change.
    JegSAMassMobVOImpl vo = getJegSAMassMobVO1();
    JegSAMassMobVO is the View Object Name and it displays certain rows that has already been added to the VO in the Page.
    Now the issue is when a user updates a particular row,I have to find which row gets updated and have to send a email to that particular employee about the change.
    Just want to know,how to find out the last updated row in a particular VO.
    Any Help would be appreciated as this a immediate requirement.
    Regards,
    Magesh.M.K.
    Edited by: user1393742 on May 4, 2011 1:06 AM

    Hi Magesh
    It shoud be a Advanced table ,so when user will update the row ,the specific row will fire the PPR and on that event u can capture the row using row reference ,this is the sample code below
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean); OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    262
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    Thanks
    Pratap

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • I'm facing a problem while creating Apple ID without credit card for iTunes, I'm living in Pakistan and facing a problem while creating Apple ID without credit card for iTunes

    When I tried to create a Apple ID without credit card information from my IPad  I did not find the "none" option.can anyone tell me something useful about this problem?

    How to Get Apps From the App Store Without a Credit Card
    http://ipadhelp.com/ipad-help/how-to-get-free-apps-from-the-app-store-without-a- credit-card/
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    http://support.apple.com/kb/ht2534
    If None is not available - On your computer launch iTunes and click "iTunes Store" in the left navigation pane. Click the "down arrow" next to your name at the top right side of the page and click "Account." Enter your username and password and click "View Account" to log into your account information. Next to your Payment Type, click "Edit." Select the "None" button and click "Done." Confirm that your card has been removed by returning to the Apple account information screen. Under Payment Type, it should say that there is no credit card on file.
    iTunes Store Accepted Forms of Payment
    http://support.apple.com/kb/HT5552
     Cheers, Tom

Maybe you are looking for