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

Similar Messages

  • How can I incorporate new backing beans into a Webcenter Spaces Server?

    I am using the WebCenterSpaces application in Customization Developer Role to make changes to some taskflows for a customer. In order to implement a desired change in the Nav Model for the customer, I had to write 3 very small backing beans. They compiled fine, the taskflow let me add them as managed beans. It even new about these backing beans, presumably because I compiled them. I made changes to the .jsff file to use them and that worked fine. However the metadata.mar created when I deploy the application does not have these new classes, so they will not get put into the WC_Spaces server when I use WLST to import the metadata. Can anybody tell me how to get new backing beans into WebCenter Spaces?
    I cant be the only one who has had to do this.
    Thanks.

    I don't know if you can import as part of the metadata import but an alternative will be to create a shared library out of your java classes and referencing the shared lib in spaces.

  • 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?

  • How to get value in backing bean from application module

    Hi all.. I'm new in jdeveloper and adf..
    I need to use value from backing bean and use that value in application module.
    But I don't know how to get it.
    Do you a have any solution?

    suppose you have myMethod(String argumentName1,String argumentName2) in your Application Module
    then to access a method binding from a managed bean, use the following code,
      BindingContext bctx = BindingContext.getCurrent();
      BindingContainer bindings = bctx.getCurrentBindingsEntry();
      OperationBinding operationBinding =
           bindings.getOperationBinding("name_of_method_binding");
      //Here you can pass the parameters value to the AM method
      operationBinding.getParamsMap().put("argumentName1",value1);
      operationBinding.getParamsMap().put("argumentName2",value2);
      //invoke method
      operationBinding.execute();
      if (!operationBinding.getErrors().isEmpty()) {
         //check errors
         List errors = operationBinding.getErrors();
      //optional
      Object methodReturnValue = operationBinding.getResult();

  • How to show popup from backing bean code immediately?

    Hi,
    I'm using JDeveloper 11.1.2.1.0 and have problems with showing popups. I have a button with an action on my page and a method in backing bean.
    I want to rise up few popups from this method in backing bean (for example just an anouncement that something will happen) or a dialog
    (for example a question if you want to continue).
    I understand how to get a dialog response to deal with it in code, but the problem is that the popup doesn't show up immediately, but only when
    this method called on button finishes. I'd like to handle dialog responses in the middle of the action and then the code to continue with the execution.
    Here is my backing bean code:
    private RichPopup popup;
    public String test() {
    //Some code...
    RichPopup.PopupHints hints = new RichPopup.PopupHints();
    popup.show(hints);
    //Here is the place for code which I want to be executed after popup closes,
    //but is executed before the popup shows...
    return null;
    And here is part of my jssf:
    <af:commandButton text="Test" id="cb1"
    action="#{popupBean.test}"/>
    <af:popup id="popup" binding="#{popupBean.popup}">
    <af:dialog id="dialog" type="yesNo"
    title="Dialog"
    dialogListener="#{popupBean.onDialogAction}"
    binding="#{popupBean.dialog}" clientComponent="true">
    <af:outputText value="Do you want to continue?" id="ot1"/>
    <af:clientListener method="onDialogCancel" type="dialog"/>
    <af:serverListener type="DialogCancelHandlerEvent" method="#{popupBean.onDialogCancel}"/>
    </af:dialog>
    </af:popup>
    Can someone give me some answer how to show the popup from backing bean code immediately?
    Thanks in advance,
    Tina

    If you want to execute code after popup closes, then put this code in PopupCanceledListener or in DialogListener(you can't block method execution).
    Dario

  • How to update Row Object in JSP Page? urgent!!!

    HI,
    I have a JSP Page and I have used jbo:DataSource and jbo:ApplicationModuleTags.
    Step 1: I have created a oracle.jbo.ViewObject view using
    view = ds.getRowSet().getViewObject(); and executed query using view.executeQuery()
    Step 2: I access the Row Object for this view like this
    Row rs = ds.getRowSet().getCurrentRow().
    Step 3: I try to set the attributes for this Row using setAttribute methods like this
    rs.setAttribute("empName","James");
    Step 4: Now I want to update this row. How to update this???
    If i need to get a Transaction object, which object's getTransaction I should use?
    Note: Please note that I haven't used <jbo:Row > tags to access my row. I simply get the Row object from view and want to update certain attributes and commit to database.
    Thanks
    Hari

    Hi Harihara!
    I think the record pointer is still before the first row, because you just executed the query.
    Try one the following statements instead of 'Row rs = ds.getRowSet().getCurrentRow()':
    Row rs = view.first();
    or
    Row rs = ds.getRowSet().first();
    And don't forget to commit your changes if the master process doesn't take care of it already!
    Good Luck!
    Rolf van Deursen.

  • How to call popup from backing bean

    Hi,
    I have an application under jdev 11.1.1.1.0
    I am using the explorer template.
    I have my popups in one page and from another page i need to call these popups.
    I cannot use the <af:showPopupBehavior> because i am using the <af:setActionListener> in my command button.
    So in the action attribute I called my backing bean
    public String showDelBoxPopup() {
       FacesContext context = FacesContext.getCurrentInstance();
       ExtendedRenderKitService extRenderKitSrvc =
         Service.getRenderKitService(context,ExtendedRenderKitService.class);
       extRenderKitSrvc.addScript(context,"AdfPage.PAGE.findComponent('delBoxPopup').show()");
       return null;
    }But i always receive a null error.
    How can i call a popup in one page from another page using backing bean.
    Thank you in advance.
    Emile BITAR

    Hi,
    You can use <af:setActionListener> with <af:showPopupBehavior>, if you set triggerType="click" on the showPopupBehavior and contentDelivery="lazyUncached" on the popup to ensure the popup will be raised after setActionListener.
    I also don't understand what you mean by calling the popup from another page (is that page included as a region?), but if you say it works then your other option could be to bind the popup to the backing bean and use popup.getClientId() in your javascript.
    String script = "var popup = AdfPage.PAGE.findComponent(\"" + popup.getClientId(fc) +  "\"); popup.show();";Pedja

  • How-to remove a jsf backing bean from session?

    How can I find the reference to a backing bean (with session scope) and then remove the bean?
    I may have painted myself into a corner. When most of my pages are navigated to, they get key info from session and then initially populate the page fields. I populate the fields in the constructor with values from the database based on the keys found in session. So the second time a particular page is called the values may be stale or completely unrelated to the page navigated from because the bean already exists and, naturally, the constructor is never called.
    I'm thinking if I could remove the backing bean, jsf wouldn't find it so it would be recreated on subsequent navigations. Since the constructor would be called with every navigation to the page, the values would not be stale or unrelated.
    Any help would be greatly appreciated.
    TIA,
    Al Malin

    //To reset session bean
    FacesContext
         .getCurrentInstance()
         .getApplication()
         .createValueBinding( "#{yourBeanName}").setValue(FacesContext.getCurrentInstance(), null );
    //To get session bean reference
    Object obj = FacesContext
              .getCurrentInstance()
              .getApplication()
              .createValueBinding("#{yourBeanName}")
              .getValue(FacesContext.getCurrentInstance());
    YourSessionBean bean = (YourSessionBean)obj;

  • How to DBTransaction - AppModule versus Backing Bean?

    Hallo,
    is there a way to work with getDBTransaction in a backing bean or is the right place for this in the AppModule?
    Any help is appreciated.

    I belive ApplicationModule is the correct place to write this code.
    --Neelmani jaiswal                                                                                                                                                                                   

  • SelectOneMenu: How can I fire a backing bean method just when click

    I want that when just I click one option of Dropdown list it fires a backing bean method.
    The method must take the new value of dropdown, to execute a SQL to populate a new (another one) dropdown list and refresh the page.
    My code
                            <h:commandButton id="button1" style="left: 216px; top: 216px; position: absolute" value="Cancelar"/>
                            <h:commandButton id="button2" style="left: 312px; top: 216px; position: absolute" value="Generar"/>
                            <h:outputLabel for="componentLabel5" id="componentLabel5" style="left: 120px; top: 0px; position: absolute">
                                <h:outputText id="componentLabel5Text" value="Título de la Página"/>
                            </h:outputLabel>
                            <h:selectOneMenu immediate="true" value="#{fgstb.ctoId}"  valueChangeListener="#{fgstb.cambiaValorCtos}" id="dropdown1" style="left: 264px; top: 72px; position: absolute; width: 120px">
                                <f:selectItems id="dropdown1SelectItems" value="#{fgstb.ctos}"/>
                            </h:selectOneMenu>
                            <h:selectOneRadio id="radioButtonList1" layout="pageDirection" style="left: 48px; top: 48px; position: absolute" value="#{fgstb.modo}">
                                <f:selectItem id="radioButton1" itemLabel="Generar Campeonato" itemValue="1"/>
                                <f:selectItem id="radioButton2" itemLabel="Generar desde Campeonato" itemValue="2"/>
                                <f:selectItem id="radioButton3" itemLabel="Generar Todos Campeonatos" itemValue="3"/>
                            </h:selectOneRadio>It works fine but when I push a button and I would like it works when I click over dropdown list.
    Thank you

    Hi,
    You can simply add onchange="submit()" attribute to your component to allow form to be submited when the coomponent value is changed, and add also a value change listener to allow JSF to be notiifed for component value change event :
    <h:selectOneMenu onchange="submit()"  valueChangeListener="#{fgstb.cambiaValorCtos}"
                              immediate="true" value="#{fgstb.ctoId}"   id="dropdown1" style="left: 264px; top: 72px; position: absolute; width: 120px">
                                <f:selectItems id="dropdown1SelectItems" value="#{fgstb.ctos}"/>
    </h:selectOneMenu>

  • How to update row by row  in   Jdbc Adapter sender  ?

    Hi friends ,
                      No i am reading data from a table using select query and resulting data i am keeping in the FTP folder as XML File.
                      I want to
                     1. to  know how many rows i read ? 
                     2. Update the  read completed time in each row of the sender side table . 
               (   I am  using <b>select * from a table where tag='n'  </b> . I am giving this in <b>Query SQL Statement</b> of JDBC Sender adapter processing parameter .
    I am writing update query as update table set tag='y' where tag='n' .
                         Will it perform row by row ?
                     3. Insert in to another R3 System  table  the rows which i read  as a log  .
                          Can  you please give  procedure to do that .
                        Expecting your reply asap .
                        Thank you
    Best Regards.,
    V.Rangarajan

    Hi raj ,
                 Thanks for ur reply .   I am new to xi . Just i am doing a scenario . I can able to read  the ms-sql server table data using jdbc Sender  adapter .
                   Can i use RFC Adapter to insert the values to R3 table ?   
                    If  i have mapped  to rfc fields will it store into the table once we read  the data from ms_sql server table using select query of JDBC Sender  Adapter ?
    Best Regards
    V.Rangarajan

  • How to update row when data contains single quote  ?

    Hi,
    Please see this query:
    update query_tab set  title='It's common knowledg' where
    id='1121';I have this update query coming from .NET, but abviously this is error since single quote in the text (title column) given by user gives wrong meaning to sql parser. So, how to solve this problem ?
    Edited by: bootstrap on Dec 25, 2010 9:53 AM

    Hi,
    To include a single-quote in a string literal, use two of them in a row:
    update      query_tab
    set       title     = 'It''s common knowledge'
    where      id     = '1121';The method above works in any version of Oracle.
    Starting in Oracle 10, you can also use Q-notation, like this:
    update      query_tab
    set       title     = Q'[It's common knowledge]'
    where      id     = '1121';For details, look up "Text Literals" in the SQL Language manual:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements003.htm#sthref337

  • Backing bean properties not getting updated

    I have an input text in my JSP page and it is component-bound to backing bean. The problem is that when I change value of the InputText in the JSP, the value is not getting updated in the backing bean.
    Here is the InputField definition in JSP page.
    <h:inputText binding="#{backing_employeeEdit.firstName}"
    id="firstName"/>
    and here is the setter in backing bean
    public void setFirstName(HtmlInputText inputText1) {
    this.firstName = inputText1;
    Pls note that there is no validation errors because the page navigates successfully. The only problem is that new value is not updated.

    I don't know, wht exactly u wants to do... Here is java code and is working fine for me...
    Emp.java
    public void action() {
         System.out.println(inputText.getValue());
         Emp tt = new Emp();
         inputText.setValue(inputText.getValue().toString()+"bilal");
         tt.setInputText(inputText);
         System.out.println(inputText.getValue());
    JSP...
    <f:view>
    <h:form>
    <h:inputText binding="#{emp.inputText}" />
    <h:commandButton value="submit" action="#{emp.action}" />
    </h:form>
    </f:view>
    faces-config file contents....
    <managed-bean>
              <managed-bean-name>emp</managed-bean-name>
              <managed-bean-class>
                   com.nous.application.Emp
              </managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    Here scope has to be session, otherwise u will lose old value...

  • How to update the PHP Class Service back in Flash Builder 4

    I'm not sure if my post title makes any sense or not but let me explain.  I've been working on an application in Flash Builder 4 using the ZendFramework and PHP services and everything is work great. the problem I have is after I make changes to my services PHP class (edit php file that has my functions in it), how to I updated those functions in the Flash builder application?
    For example, I needed to pass a second object into one of my function in my PHP class and after I edited the file and saved it, I don't see the changes in the Flash builder 4 application. Is there a button I can run to update the PHP class back in Flash Builder?
    Thanks,
    John Baranowski

    How do you use Flash Builder to regenerate the code for the same PHP service I connected to prior? When I first connected to the PHP service Flash Builder automatically built a package with all kinds of actionscript functions in it. I added a function to my PHP Class file server side and I need help on how to update the package back in Flex to see my new function. Can anyone help me??
    -John

  • ADF BC how to access session backing bean value in servlet

    Hi everyone,
    How do I access session backing bean value in a servlet?

    Frank, thanks for your reply.
    I'm not sure how I can incorporate this example into my situation. Let me explain more detail about my problem.
    "servlet" in my post here actually means a custom servlet I wrote for rendering an image that is stored in db as ordimage. In this servlet, I get hold of my appmodule by using Configuation.createRootApplicationModule(). By doing so (If I'm not wrong) a new database session/connection is created. What I'm going to achieve is set application context for this new session/connection in db with the data stored in a session backing bean in the view layer.
    I can pass the required data to the servlet thru url parameter, but I don't want to do it this way for the reason that the data may contains sensitive information.
    I hope I have explained myself well.
    Message was edited by:
    bsmt

Maybe you are looking for

  • Attachment for Purchase Order and Purchasing Requisition

    Dear All, At the moment we are on ECC6 EHP 4 and would like to use Document Management in SAP. Now att the PO and PR line item we need to click the Documents icon to see the if the is any document that is being attached to the line item . Is there an

  • Auto font size for textfield by javascript

    Hi there.  I got the following script for a textfield in a fillabe PDF.  Th length of the textfield is 150.  It is required that if the text is > 100, the text size will be set to point 8, otherwise it will be point 12. var tf = this.rawValue; if (tf

  • Error with cursor position on Chart

    Hello I'm getting an error with a simple Chart.  I'm trying to show the chart position (using labels and a crosshair) and I'm getting an exception ONLY (it seems) when the program starts up with the cursor above the chart.  If I move the cursor off t

  • Spry UI Image Slideshow preview in IE8

    Hello, sorry to re-ask a tired question, but I've scoured the forums and can't get  a handle on the answer. My issue: I have inserted the Spry Image Slideshow 7.1 widget in my dreamweaver (CS5) doc (thank you Widget Browser!), and made the necessary

  • New Cars with Line-in in

    For those of us wanting to play our various players in the car, it appears some of the car makers are catching on and making a standard "line-in" input in their new models. I just got something in the mail from Chevrolet about the Impala and all thei