How to update the table value in the valuechange event?

I have an input field in the datatable with the valueChangeListener
<rich:dataTable id="cart" value="#{cart.cartList}" var="item">
<h:inputText value="#{item.cost}" id="qty" valueChangeListener="#{items.updateCost}" onchange="submit()">
<h:outputText value="#{item.errorMsg}"> </h:outputText>
in the backing bean
     Item item = (Item) model.getRowData();
// do some update, if the cost too larger, change to max_cost
     item.setCost(max_cost);
     item.setErrorMsg("Error Msg");
After calling the valuechange method, the screen output doesn't update the cost.
How to update the table value in the valuechange event?

As you're misusing the valueChangeListener to set another input field, you need to skip the update model values phase. Otherwise the value set in the valueChangeListener will be overridden by the submitted value. You can do this by calling the FacesContext#renderResponse() inside the valueChangeListener method. This will shift the current phase immediately to the render response phase, hereby skipping the update model values and invoke application phases.

Similar Messages

  • How to update Spry-table and present the updated table in a div element?

    Hello!
    I am using a very interesting AJAX-framework called Spry when designing a web page. Here the web page is: Link.
    I need some help.
    Every time a new project or shift is added, the changes are written to an xml-file. When the page is reloaded, Spry reads data from xml-files.
    This is caused by this code:
    dsProjects = new Spry.Data.XMLDataSet("timetable/projects.xml", "projects/project");
    dsShifts = new Spry.Data.XMLDataSet("timetable/{dsProjects::url}", "project/shift"); //look inside projects.xml and //extrac xml-file. url
    dsName = new Spry.Data.XMLDataSet("timetable/{dsProjects::url}", "project");
    I call this function that I have written: loadProjectsIntoDivElement ().
    This function does the following: [See attached code.]
    It iterates through the Spry-datastructure and puts the data in a table inside of the div-element called 'projectsList'.
    Now, when I add a new project, I want it to be inserted into the Spry-datastructure and then cause the new data to be written into the div element called 'Specials_DIV'.
    I have found out how to update a Spry-datastructure (e.g. dsProjects above), but I don't know how to update the table containing the data without refreshing the page. This should be done using Spry.
    Some code:
    1:
    2:
    3:
    function loadProjectsIntoDivElement () {
    $('#projectsList').html('');
    $('#projectsList').append('<table id="Specials_Table"><tr><th spry:sort="id">ID</th><th spry:sort="NAME">Name </th><th spry:sort="hoursestimated">Nr. of hours estimated</th><th spry:sort="hoursworked">Nr. of hours worked</th><th spry:sort="costperhour">Cost per hour.</th></tr>{function::init_hours}<tr spry:repeat="dsProjects" onclick="chooseProject({ds_RowID})"><td>{id}</td><td>{NAME}</td><td>{hoursestimated}</td><td>{hoursworked}</td><td>{costperhour}</td></tr></table><br/>{function::get_hours}<br/>');
    I have tried to accomplish this in various ways but I don't succeed.
    I want to do it without refreshing the page.
    Update: I found some code here that I will try: Link
    Thanks in advance!
    Anders Branderud
    My blog

    Hello!
    Thanks!
    I don't succeed with the implementation in any browser.
    I have found a way to it, but I would like a way that updates the data quicker and without reloading all of the page. After all, I am only adding one row on the end of the data structure, so there should be no need to read in all data again.
    Now I do it like this:
    When a project is added, do this:
    1. Store a new row in the project file through a php script.
    2. When the post-call to the php-file returns, do refresh of the whole page.
    Then the newest version of the xml file will be read in.
    However, I don't want to read the data from a xml file each time that a new project is created.
    I know how to add the new data to a Spry-datastructure [in my code 'dsProjects'], but I don't know how to display the updated data without reloading the whole page.
    I have tried some various ways to do it, but haven't succeded.
    Thanks!
    Anders Branderud

  • How to update standard table based on the custom table

    Hi,
    I have requirement , I have custom table whatever changes done to the custom table must be updated in the standard table
    i have tried the table maintenance events but unable to handle delimit , what is the base solution for this.
    1) create
    2) change
    3) delimit
    4) delete
    6)copy

    the table im updating is t710
    the custom table is same as the standard table except for one field . whatever the user maintains the values in custom table except for the one field everything should update back to the standard table. Im able to update when we create delele but the problem is delimition. when im delimiting the record in custom table its just changing the startdate and it is not actually delimiting the record itself .I want both records the latest one and previous one and should be update back into the standard table same as the custom table

  • How to update a table (CUSTOMER) on a Report Server with the data from the same table (CUSTOMER) from another server Transaction server?

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) From another server ex: Transaction server?
    Set up steps so inset, update or delete operation takes place across the servers.
    It would be great if someone please enlighten me in details about this process in MS SQL Server 2008 R2.
    Also please describe would it be different for SQL Server 2012?
    If so, then what are the steps?

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) from another server ex: Transaction server?
    Set up steps so that inset, update or delete operation gets done correctly across servers.
    I was not sure about the answer, it would be great if someone please put some light on this and explain in details about this process in MS SQL Server 2008 R2.
    Also it would be very helpful if you please describe would it be different for SQL Server 2012? If so, then what are the steps?

  • Intrastat - The statistical value of the document is zero - how to update?

    Dear gurus,
    I have a problem in Intrastat and maybe you can help me.
    When running VE01, I have incomplete billing documents with the message EIP020 'The statistical value of the document item is zero'.
    How can I update these billing documents? How can I prevent it from happenning in the future?
    Thank you in advance for your help

    Please.....anybody knows the answer for this issue?

  • How to update many tables using the same code

    <%@ page language = "java" import = "java.sql.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.text.*" %>
    <%
    String custname1=request.getParameter("custname");
    session.setAttribute("custname",custname1);
    String custtin1=request.getParameter("custtin");
    session.setAttribute("custtin",custtin1);
    %>
    <%
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn;
    conn=DriverManager.getConnection("jdbc:odbc:loginval");
    Statement stat=conn.createStatement();
    String stmt="insert into custdetails values('"+custname1+"','"+custtin1+"')";
    stat.executeUpdate(stmt);
    stat.close();
    conn.close();
    %>
    <jsp:forward page = "success.html"/>
    <%
    catch(Exception e)
    %>
    <jsp:forward page = "tinerror.jsp"/>
    <%
    %>---------------------------------------------------------------
    this is my code, now this code will be used by many users to update their corresponding tables. so my problem is based on the username i need to change the table name in the insert query, for example if the username is sai, then the table name has to be saicustdetails and if the user name is ram then the table name in the query has to be ramcustdetails. and so on.
    please help

    *<%@ page language = "java" import = "java.sql.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.text.*" %>
    <%
    String tin1=request.getParameter("tin");
    session.setAttribute("tin",tin1);
    tin1=tin1+"custdetails";
    String custname1=request.getParameter("custname");
    session.setAttribute("custname",custname1);
    String custtin1=request.getParameter("custtin");
    session.setAttribute("custtin",custtin1);
    //String tin2;
    %>
    <%
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn;
    conn=DriverManager.getConnection("jdbc:odbc:loginval");
    Statement stat=conn.createStatement();
    String tin2;
    tin2=tin1;
    String stmt="insert into "+tin2+"values('"+custname1+"','"+custtin1+"')";
    stat.executeUpdate(stmt);
    stat.close();
    conn.close();
    %>
    <jsp:forward page = "success.html"/>
    <%
    catch(Exception e)
    %>
    <jsp:forward page = "tinerror.jsp"/>
    <%
    %>i tried what u have said but still it does not work, anyother way?????

  • How to pass line item values in the table paramer of FM

    Hi all,
    When i will give the import of  the FM as VBELN"sales order number.
    I want to display all the line items for "PO Quantity in the out put of the FM.
    For this i thnk i have to pass the line item values in the table parameter of the FM.
    Can any body please tell me how to pass the values for the line items in the table parameter fo teh FM.
    Please give a example.
    Thanks

    Sub pLoopThroughPivotFields()
    Dim oItem As Excel.PivotItem
    Dim oField As Excel.PivotField
    Set oField = ThisWorkbook.Worksheets("Sheet1").PivotTables("Pivot Table name").PivotFields("field name")
    For Each oItem In oField.PivotItems
    oField.CurrentPage = oItem.Name
    'Put your copy code here
    DoEvents
    Next oItem
    End Sub
    Felipe Costa Gualberto - http://www.ambienteoffice.com.br

  • How to update JTable when clicking outside the table?

    Hi
    (Sorry if this has been asked before but I can't seem to see exactly how to do this from previous posts.)
    I have a JTable which sits on a jPanel which itself is part of a frame.
    When I click anywhere outside the table when I'm editing a cell in the table, how do I end the edit mode of the table (so that the cell is updated with the new contents).Currently I can only update a cell's contents during edit when hitting 'enter' or by clicking on another cell within the table.
    It seems that the following code is used in the process but I'm sure that I'm still missing something:
    if(table1.getCellEditor()!=null)
    table1.getCellEditor().stopCellEditing();
    If anyone out there knows how to do this,I'd really appreciate hearing how.
    Thanks a lot
    LGS

    Thanks for your comments but I'm still having problems.
    When I add the following code:
    table1.addFocusListener(new java.awt.event.FocusAdapter()
    public void focusLost(java.awt.event.FocusEvent evt)
    if (table1.getCellEditor() != null)
    table1.getCellEditor().stopCellEditing();
    and then try to edit my table,as soon as I double click on any cell in the table,my setValueAt method in my Table Model is being called before I even edit the cells contents. The above code is in the same method in which I actaully create table1 i.e.createTable().
    Can anyone help?

  • How to print the table values in fastest way?

    Dear Friends,
    I'm having table in my application and i need to print the table values. For that I used print() method to print the table values.
    boolean complete = tableObj.print(mode, header, footer, showPrintDialog, null, interactive,
                                  null);But, the time taken for displaying print dialouge box so late and printing operation is done very slowly.
    Could anyone please tell me is there any better way and fastest way to print the table values?
    Thanks in advance

    Hi,
    In the Module pool you will have fields. For those fields you have created the name also. Assign those name to work area and from there to internal table.
    And for your requirement viceversa you need to done.
    With Regards,
    Sumodh.P

  • How to use the prompted value in the filter expression

    Hi
    Is it possible to use the prompted value in the filter expression?
    My requirement is that user will be prompted for a date field and I need to filter the records such that the records are displayed for the last 5 weeks from the date entered by the user.
    If somehow I know how to use the prompted value in the filter expression then this requirement is easy to be done. If this is possible, please guide me?
    If there are other ways to acheive the desired results then please suggest.
    Thanks
    -Jaz

    Edit: example added
    SQL> create table tb_test
      2  ( id number(5)
      3  , tot number(5)
      4  , mon_tot number generated always as (tot*15) virtual
      5  );
    Table created.
    SQL> insert into tb_test (id, tot) values (1, 5);
    1 row created.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1          5         75
    1 row selected.
    SQL> update tb_test
      2  set    tot = 15
      3  where  id = 1;
    1 row updated.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1         15        225
    1 row selected.

  • How to Update some column values in some rows in an advanced table

    Hi Gurus,
    Can any body help on this issue.
    I am having a results table which is showing all the queried parties data queried in a seeded page in OCO module.
    Lets assume the table contains 10 rows with the below columns
    Party Name, Registry ID, Address Country, Match Percentage, Certification Level, Certification Reason, Internal Indicator, Status .
    Certification Level, Certification Reason and Internal Indicator are the dropdowns.
    The user want to update some of these fields values for some rows randomly.
    After doing this if he click on Save button, Only thosed changed rows need to get update using a Custom Procedure.
    But here all the rows irrespective of the change getting updated.
    So  how to capture the modified rows.
    Appreciate any inputs..
    Thanks
    Palepu
    Edited by: Palepu on 9 Aug, 2012 4:25 PM

    Not sure if you got the answer. You need to capture the row which got changed using the below and get the column value using the getAttribute method. This works for single selection row, if it is multi selection then you will have to loop through all selected rows and find the VO attribute value.
    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Row currentRow = am.findRowByRef(rowReference);
    String param1= (String)currentRow.getAttribute("VOAttribute");
    Let me know if there are any issues.
    Thanks
    Shree

  • F4IF_INT_TABLE_VALUE_REQUEST - how can I return all values from the line?

    Hi,
    I'm using FM F4IF_INT_TABLE_VALUE_REQUEST to show a pop-up with my internal table values.  The internal table has 3 fields, ATINN, ATZHL and a description field ATWTB.  ATINN and ATZHL are needed to complete the unique table key, however this FM will only return the value of one field in any line I select.
    How can I see all the values in the line I select in the return table?
    My code is as follows:
      DATA: tbl_cawnt LIKE cawnt OCCURS 0,
            wa_cawnt LIKE cawnt,
            BEGIN OF tbl_list OCCURS 0,
              atinn LIKE cawnt-atinn,
              atzhl LIKE cawnt-atzhl,
              atwtb LIKE cawnt-atwtb,
            END OF tbl_list,
            wa_list LIKE tbl_list,
            tbl_return LIKE ddshretval OCCURS 0,
            wa_return LIKE ddshretval,
            tbl_fields LIKE dfies OCCURS 0,
            tbl_dynp LIKE dselc OCCURS 0.
      REFRESH: tbl_list, tbl_cawnt.
      SELECT atinn atzhl atwtb
        FROM cawnt
        INTO CORRESPONDING FIELDS OF TABLE tbl_cawnt
        WHERE spras EQ sy-langu.
      LOOP AT tbl_cawnt INTO wa_cawnt.
        CLEAR wa_list.
        MOVE: wa_cawnt-atwtb TO wa_list-atwtb,
              wa_cawnt-atinn TO wa_list-atinn,
              wa_cawnt-atzhl TO wa_list-atzhl.
        APPEND wa_list TO tbl_list.
      ENDLOOP.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ATWTB'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          value_org       = 'S'
        TABLES
          value_tab       = tbl_list
          return_tab      = tbl_return
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Thanks!

    Hi,
      Use the structure DYNPFLD_MAPPING
    With this internal table you can easily define that you want to return
    other columns of the hit list in addition to field RETFIELD to the
    screen.
    In this IT you can MAP the screen fields to the serch help screen fields this has three fields
    FLDNAME this is the field anme from the search help
    FLDINH This has to be blank which would be field with the field value that you want to map
    DYFLDNAME THis is the screen field name.
    So here you can get the values for the other fields that you want which are on the search help just populate the name of the fields in FLDNAME.
    Regards,
    Himanshu

  • How can I access the Attribute Values from the Search Region

    Hi all,
    I have a table which contains Company id, department id, and PositonId. For a particular Company and Department there may be multiple records.
    I have to pupulate a table which contains the position and other details that comes under a particular Department and Position based on the selection in the Three comboBoxes.
    Also I have to populate a select many Shuttle to add new postions and records under a particular Department.
    I created a query panel *(Search Region)* for the serch and a table to display the data. That is working fine.
    Now the issue is I am using a view criteria to populate the shuttle with two bind variables ie, DepartmentId and CompanyId.
    If the serach will return a resuktant set in the table it will also pupulate the correct records, otherwise ie, if the if the serch result is empty the corresponding iterator and the attribute is setting as null.
    SO I want to access the attribute values from the Search Region itsef to populate the shuttle.
    I don't know how can I access the data from the Search Region.
    Please Help.
    Regards,
    Ranjith

    you could access the parameters entered in search region by the user as follows:
    You can get handle to the value entered by the user using queryListener method in af:query.
    You can intercept the values entered as described
    public void onQueryList(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    List<Criterion> searchList = qdes.getConjunctionCriterion().getCriterionList();
    for ( Criterion c : searchList) {
    if (c instanceof AttributeCriterion ) {
    AttributeCriterion a = (AttributeCriterion) c;
    a.getValues();
    for ( Object o : a.getValues()){
    System.out.println(o.toString());
    //call default Query Event
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    public void onQueryTable(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    private void invokeQueryEventMethodExpression(String expression, QueryEvent queryEvent){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
    MethodExpression me = efactory.createMethodExpression(elctx,expression, Object.class, new Class[]{QueryEvent.class});
    me.invoke(elctx, new Object[]{queryEvent});
    Thanks,
    Navaneeth

  • How can i add two values under the same property?

    Hi all,
    How can i add two values under the same property name in a
    prop list? For example:
    [question1: "item1","item2", question2: "item3","item4"]
    To be more precise, i am creating a property list and I want
    whenever a two values have the same property name to be added int
    he list under the same property. For example:
    gMyList.AddProp (#""&question&"" & x,
    member("input").text)
    question is a variable that is updated fromt he user's input.
    Now, whenever somethign like this happens:
    question = "question1"
    member("input").text = "five"
    question = "question1"
    member("input").text = "six"
    I want to output list to be:
    [question1: "five","six"] and so on
    Any ideas?

    Maybe you could make each property a list (so you have a
    property list full
    of lists), and add multiple values to the list held in a
    particular
    property?
    Cheers
    Richard Smith

  • How to capture the selected values of the filter?

    Hi Everybody
    I have created a dashboard using a 4 column filter. It all works well - no problem.
    I now need to enhance the functionality of the dashboard which needs the selected values of each of the parameters of the filter. As far as I know, the selections of the fiilter columns are not "Inserted In" any cell, only the data values of the corresponding row not including the filter columns are inserted in the "Inserted In" row, is there a way to capture the values of the filter column selections in some cells on the spreadsheet?
    An early response from you all shall be highly valued.
    Also, does anyone know which is the current equivalent version of Xcelsius to the old Xcelsius Workgroup version. This Xcelsius Workgroup version supported the "XML Integration Dynamic Refresh" wherein you didn't have to reinserted the updated Excel spreadsheet into Xcelsius have an updated dashboard - as long as the corresponding XML files were updated with the latest data, the exported dashboard would refresh.
    Best regards
    Deepak Agarwal

    Along with the PBO and PAI event, add a POV event in the flow logic of the screen
    DEMO_DROPDOWN_LIST_BOX -is a good demo example.
    PROCESS ON VALUE-REQUEST.
    FIELD structure_name-field_name MODULE create_dropdown_box.
    In the report :
    MODULE create_dropdown_box INPUT.
      SELECT carrid carrname
                    FROM scarr
                    INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'CARRID'
                value_org       = 'S'
           TABLES
                value_tab       = itab_carrid
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.
    ENDMODULE.
    In the layout, assign a Function Code , for eg : 'SELECTED' to the listbox and lets say name of the field is SDYN_CONN-CARRID. So in the PAI module,
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'SELECTED'.
          MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
      ENDCASE.
    ENDMODULE.
    sdyb_conn-carrid will contain your selected field

Maybe you are looking for

  • Links do not work for me

    I posted this on the JDeveloper forum The links on this page (and many others) are broken. They are all missing the /forums/ I clicked the reply button and got an unknown page error. I had to paste in the correct URL Re: More on broken links To get t

  • How to caluculate buffer size for import/exports in oracle

    Hi DBAS, how to caluculate buffer size for import exports,here is the formula but how can we use if there is a 100 of tables and datatypes,is the any query to find out rows_in_array ,maximum_row_size total schema and datbase buffer_size = rows_in_arr

  • Drawing in CS Applications

    Colleagues, My most recent post on the CS SDK blog is about drawing--specifically, it provides routines that make drawing paths work the same way in Illustrator, InDesign, and Photoshop. (Basically, I added routines that make AI and PS work the way t

  • Re: College Student Deals: No confirmati​on email!

    I too am having the same issue. My son submitted his .edu email 3 days ago and he still has not received the email. I've verified his college inbox doesn't block marketing emails. Please help! Thanks.

  • HT5622 Unable to send and receive iMessages, help!

    For some reason, I am suddenly unable to send and receive Imesages? Iv rang Vodafone customer services, who were no,help at all. Iv tried lots of suggestions on the internet, but no luck! Any help would be appreciated Thanks