How to update multiple records checked by check box

I have list of items in my jsp pages and that are being generated by the following code
and I want to be able to update multiple records that have a checkbox checked:
I have a method to update the status and employee name that uses hibernate that takes the taskID
as a paratmeter to update associated status and comments, but my issue is how to do it with multiple records:
private void updateTaskList(Long taskId, String status, String comments) {
TaskList taskList = (TaskList) HibernateUtil.getSessionFactory()
               .getCurrentSession().load(TaskList.class, personId);
taskList.setStatus(status);
taskList.setComment(comments);
HibernateUtil.getSessionFactory().getCurrentSession().update(taskList);
HibernateUtil.getSessionFactory().getCurrentSession().save(taskList);
<table border="0" cellpadding="2" cellspacing="2" width="98%" class="border">     
     <tr align="left">
          <th></th>
          <th>Employee Name</th>
          <th>Status</th>
          <th>Comment</th>
     </tr>
     <%
          List result = (List) request.getAttribute("result");
     %>
     <%
     for (Iterator itr=searchresult.iterator(); itr.hasNext(); )
          com.dao.hibernate.TaskList taskList = (com.dao.hibernate.TaskList)itr.next();
     %>     
     <tr>
          <td> <input type="checkbox" name="taskID" value=""> </td>
          <td>
               <%=taskList.empName()%> </td>           
          <td>          
               <select value="Status">
               <option value="<%=taskList.getStatus()%>"><%=taskList.getStatus()%></option>
                    <option value="New">New</option>
                    <option value="Fixed">Fixed</option>
                    <option value="Closed">Closed</option>
               </select>          
</td>
          <td>               
               <input type="text" name="Comments" MAXLENGTH="20" size="20"
               value="<%=taskList.getComments()%>"></td>
     </tr>
<%}%>
_________________________________________________________________

I solved it by making changes in the occurrence  parameter of data type ...:-)

Similar Messages

  • How to update multiple records in Oracle ?

    Hi Guys,
    <b>I have to update multiple records from a file into Oracle Table...</b>
    I can successfully insert the multiple records into the table but can't update the multiple records into the table.
    when i am using UPDATE_INSERT only my first record of the file is getting updated in th e table..
    Please share your views with me.
    Regards,

    I solved it by making changes in the occurrence  parameter of data type ...:-)

  • How to update multiple records in the table using POST parameters:

    i got this idea from this website:http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-s ingle-sql-query/comment-page-1/#comment-5409. Basically i am trying to update all the status in the results page, and by adding $i in front of the id in the text fields, and checkboxes, i can name the different inputs with different names:
    The image of how it takes the inputs is shown here:http://forums.adobe.com/thread/709034?tstart=0
    I tried this but got this error:Parse error: syntax error, unexpected T_IF, expecting ')' in C:\xampp\htdocs\Database Query\results_change.php on line 51
    will not work in the update code section:
    for($i=0;$i<$maxRows_Recordset1;$i++)
    {$a=sprintf("%s",GetSQLValueString($_POST['changeid $i'],"int"));
    $b=sprintf("%s",GetSQLValueString($_POST['checkbox $i'],"text"));
    $display_order .= array(
        $a => $b
    if($i<$maxRows_Recordset1-1)
    $ids = implode(',', array_keys($display_order));
    $updateSQL = "UPDATE `change` SET Status = CASE Change_id ";
    foreach ($display_order as $a => $b) {
        $updateSQL .= sprintf("WHEN %d THEN %s ", $a,$b);
    $updateSQL .= sprintf("END WHERE `Change_id` IN ($ids)");

    Hi,
    Try
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
        UPDATE xx_test
        SET checkbox = 'Y'
        WHERE rec_no = APEX_APPLICATION.G_F03(i);
      END LOOP;
    END;Code loops all checked checkbox. You do not need commit on page process.
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • How to update multiple records in custom table using checkbox in APEX 4.1?

    Hi,
    I have a SQL report which brings up all the data records using the following query.
    select
    "REC_NO" AS hidden_rec_no,
    "REC_NO",
    APEX_ITEM.CHECKBOX (3,rec_no) AS edit,
    "MEETING_TYPE",
    "PAGE_NO",
    "CHECKBOX"
    from "XX_TEST" m
    WHERE page_no = :p_page_no
    Out of all records, any records which are checked, I only want to update their flag to 'Y' on the database column "Checkbox". For this, I have a SUBMIT button on the report region. The processing code on pressing the SUBMIT button is:
    DECLARE.
    l_row NUMBER := 1;
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
    LOOP
    FOR j IN l_row..APEX_APPLICATION.G_F01.COUNT
    LOOP
    IF APEX_APPLICATION.G_F01(j) = APEX_APPLICATION.G_F03(i) THEN
    UPDATE xx_test
    SET checkbox = 'Y', -- APEX_APPLICATION.G_F03(j)
    WHERE rec_no = APEX_APPLICATION.G_F03(i);
    l_row := j + 1;
    EXIT;
    END IF;
    END LOOP;
    END LOOP;
    COMMIT;
    END;
    However, that is not happening. Please help me with this. Any solutions/suggestions are most welcome.
    Regards.

    Hi,
    Try
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
        UPDATE xx_test
        SET checkbox = 'Y'
        WHERE rec_no = APEX_APPLICATION.G_F03(i);
      END LOOP;
    END;Code loops all checked checkbox. You do not need commit on page process.
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • How to update multiple records in a table created in view (web dynpro)

    Here is my coding......
    *coding to get the district value
    DATA lo_nd_district TYPE REF TO if_wd_context_node.
        DATA lo_el_district TYPE REF TO if_wd_context_element.
        DATA ls_district TYPE wd_this->element_district.
        DATA lv_district_txt LIKE ls_district-district_txt.
      navigate from <CONTEXT> to <DISTRICT> via lead selection
        lo_nd_district = wd_context->get_child_node( name = wd_this->wdctx_district ).
      get element via lead selection
        lo_el_district = lo_nd_district->get_element(  ).
      get single attribute
        lo_el_district->get_attribute(
          EXPORTING
            name =  `DISTRICT_TXT`
          IMPORTING
            value = lv_district_txt ).
    *coding to diplay records when clicking a button(Submit)
    DATA lo_nd_table TYPE REF TO if_wd_context_node.
    DATA lo_el_table TYPE REF TO if_wd_context_element.
    DATA ls_table TYPE wd_this->element_table.
      DATA lv_district LIKE ls_table-district.
    navigate from <CONTEXT> to <TABLE> via lead selection
      lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
    get element via lead selection
      lo_el_table = lo_nd_table->get_element(  ).
    get single attribute
      lo_el_table->set_attribute(
        EXPORTING
          name =  `DISTRICT`
       " IMPORTING
          value = lv_district_txt ).
    The above coding updates only one record to that
    table created in view.
    If i enter 2nd district value means then the first record
    in the table is overwritten.
    So my need is the record should not be overwritten.
    it(2nd record ) should be displayed after the 1st record.
    Any one can help me and send the coding plz....

    instead of using set attribute you should use bind table method to display/update the records in table view.
    step1 ) collect all the data in a local table
    step2 ) and the bind that lacal table with your node
    search1 = wd_context->get_child_node( name = `TABLE1` ).
    search1->bind_table( lt_detail)
    here lt_detail is your local table and TABLE1 is node which is bound with table ui element.

  • How to update multiple records in a table using procedure?

    Dear All,
    1 am using 11.1.2.1.0
    my question is i have a table like
    emp id(primary key), empname,location
    1                             damby      blore
    2                             rocky       kormangala
    3                              biswa     india
    my question  is i need to write one procure that at a time i can update empname and location(wat the value are there in empname and location i  need to change at a time).
    thanks
    Damby

    Hi, Damby,
    That sounds like what the UPDATE statement does, exactly.  Just use an UPDATE statement to change any number of columns in existing rows.  You don't need a procedure, but, if you're using a procedure for some other reason, you can do the UPDATE in the procedure.  UPDATE works the same in SQL or PL/SQL.
    Sometimes MERGE is more convenient than UPDATE.  Like UPDATE, it can change any number of columns, either in SQL or PL/SQL.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to update multiple records using for loop

    Hi I want to update a particular column of few rows in database i had written followin code after that few lines of code and calling action from the task which having commit return ,still it's not updating particular colum.I had debug the code loop is running fine but still changes are not reflecting to database.Let me know if there is any prob with following code snippet.
    RealEstatePropertyUnitDetailsVOImpl realEstatePropertyUnitDetailsVO = RealEstatePropertyUnitDetailsVOImpl)realEstateService.getRealEstatePropertyUnitDetailsVO();
    for(Row row : realEstatePropertyUnitDetailsVO.getAllRowsInRange())
    if("N".equalsIgnoreCase((String)row.getAttribute("RlstdSellYn"))
    || "false".equalsIgnoreCase((String)row.getAttribute("RlstdSellYn")))
    row.setAttribute("RlstdAvlblYn", "Y" );
    System.out.println("RlsthId "+row.getAttribute("RlstdRlsthId"));
    System.out.println("AvlbYN "+row.getAttribute("RlstdAvlblYn"));
    System.out.println("RlstdUnitId "+row.getAttribute("RlstdUnitId"));
    }

    Vishwesh,
    I'd start with something along the lines of ...
        RowSet vo = (RowSet)getRealEstatePropertyUnitDetailsVO();
        vo.reset();
        while (vo.hasNext())
          Row row = vo.next();
          row.setAttribute("Attribute", value);
        }getAllRowsInRange() may exclude some rows outside the "range". Also, the vo.reset is needed since your View Object currency may not be at the beginning of your RowSet.
    Hope that helps.
    Will

  • Update multiple records from a list

    Just trying to find some tutorials on how to update multiple
    records from 1
    page of checkboxes
    easiest example is hotmail
    i would like to be able to give my clients the ability to
    delete or update
    multiple records from 1 page... mind you that this type of
    update woudl only
    be for simple status changes, flags that need to be changed
    and so on...
    Delete... well if they made it to this page they are already
    sure and have
    been warned that they are going to delete the records..
    where can i find such a tutorial on how to complete multiple
    record updates
    or deletes from 1 form...
    thanks

    Server model and software below.
    And hotmail has nothing to do with anything.. its an example
    of what i would
    like to be able to do...
    If you log into hotmail. you have the option to check all the
    emails you
    want to delete.
    well thats what i want to do with my clients sites...
    Each record would have its own checkbox, they select the
    records they want
    to delete or update and they hit submit to process there
    request.
    Using ASP, SQL2005 and DW8
    "bregent" <[email protected]> wrote in
    message
    news:f21upb$nop$[email protected]..
    > >Just trying to find some tutorials on how to update
    multiple records from
    > >1
    >>page of checkboxes
    >
    > What server model?
    >
    >>easiest example is hotmail
    >
    > What does hotmail have to do with this.

  • Updation/insertion of multiple records simultaneously using check box

    Hi,
    I am using Jdev11.1.1.2.0 version. I have the following scenario.
    There is a table in the view.At run time, I need to select multiple records and update those records in the database. So i took check Box as a column in the table.*(I did not associate check box to any of the attributes (columns) in the table.)* After running the application, I selected multiple records using checkbox and submitting them. The check box is returning value as 'false' even for the selected records also instead of 'true'. Because of this we are facing the issue in updating only the selected records. Please suggest your valuable inputs.
    I have written the following code in the backing bean to get the selected rows.
    BindingContainer bindings =BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcIter= (DCIteratorBinding) bindings.get("PttDeliverabvleTrackerEOView2Iterator");
    RowSetIterator depRSIter = dcIter.getRowSetIterator();
    depRSIter.setRangeSize(depRSIter.getRowCount());
    Integer key = depRSIter.getRowCount();
    System.out.println("No of rows is "+ key);
    int rowIndex =0;
    for(int i =0; i<key; i++){
    PttDeliverabvleTrackerEOViewRowImpl row = (PttDeliverabvleTrackerEOViewRowImpl) depRSIter.getRowAtRangeIndex(i);
    System.out.println("Check box value2 "+ this.getSbc1().isSelected());
    if(this.getSbc1().isSelected()){
    rowIndex = i;
    System.out.println("Row Index: "+ rowIndex);
    Please let me know if it is it possible to associate a checkbox to any of the attributes while dragging and dropping the table in the view and update the records?
    I tried selecting the option 'Row Selection' while dragging and dropping the table and changed the property RowSelection->multiple. But it is not serving the purpose of updating multiple records.
    Please suggest if there is any other solution to update multiple records.
    Regards,
    Sreelatha.

    Hi,
    if you added checkboxes to a table, then at runtime the checkbox is stamped, which means that a call to this.getSbc1().isSelected() just returns the state of the last checkbox that is rendered. I don't want to go into the details of ADF Faces table rendering here, but point yu to a blog article that does what you are aiming for using ADF BC: http://sameh-nassar.blogspot.com/2009/12/use-checkbox-for-selecting-multiple.html
    Frank

  • Update multiple records on one page

    I have a page that displays records based on a varible that
    is selected on
    the previous page.
    So on this page i have displaying 3 columns
    Store # Allowance Total
    They have asked now instead of clicking on each indivual
    record to mark it
    as completed, they would like to just place a check next to
    each one and let
    it update those records for that store....
    Ex.
    Store 20 has a total of 7 records and has an allowance of
    $6000.00 then
    they would place 1 check mark next to that store and hit
    submit and it would
    update all 7 records with a status of completed.
    I have read thru some not all but some of the example links i
    found for
    updating multiple records. But they seem more complex than
    what im trying to
    do. Since this page is populated dynamically how can i code
    it so it
    understands when there is new stores listed and records.
    Is there any links or tutorial that anyone would recommend
    that will explain
    the process for creating this functionality?

    My bad....
    ASP and Access is what im using DWMX
    "bregent" <[email protected]> wrote in
    message
    news:ei5srh$6uv$[email protected]..
    > What scripting model are you using? You may be able to
    find a datagrid for
    > your model which will simplify this for you.

  • Update multiple records with update button???

    I was wondering if someone could explain how I can use the developer tool box to update multiple records at once.
    I have a repeat region with a title and a check box if the item is active. I would like to update all records of the table at once. I have see folks state the developer tool box can do this. However I am not sure how..
    I am using php with mysql dreamweaver cs3

    Hi Chris,
    that can be done with first creating an ADDT "dynamic list", means to apply ADDT´s "Dynamic List Wizard" to an empty page -- this list will provide checkboxes for all displayed records, and here´s where you can select the to-be-updated (or deleted) records.
    Besides creating the list, this wizard will also be creating a blank "form" php page in the same directory, which is by default "tied" to the created list -- you´ll just need to open this blank document with DW and apply ADDT´s "Create Dynamic Form Wizard" to it. However, this form will contain all required routines for single and multiple updates, depending on how many records you select in the list.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • How to update multiple telephone numbers of a customer in ADR2 table?

    Can anyone please help on how to update multiple telephone numbers of a customer. Is there a function module available for the same?
    Does SD_CUSTOMER_MAINTAIN_ALL Func Mod. update only the default telephone number in adr2?

    Hi,
    check this link
    link:[Customer tel number change.;
    hope u'll get some idea.
    Regards,
    Sneha.

  • How to update multiple calling hours based on business partner

    Hi All,
    please help me in this issue : how to update multiple calling hours based on business partner in SAP CRM.
    Regards,
    Siva kumar.

    Check maintainance view V_TB49, add new scheduling type.

  • How to select multiple records from a TREE in the table

    HI,
    I have a tree structure which is in the table.When I open the node of the tree,all the subnodes are coming as one-one records in the table.I want to slect multiple record from this table.I applied onLeadSelect for this table,I can select only 1 record from the table.
    Can any one plz suggest me how to select multiple records from the table so that I can get all the data of those selected record.
    Regards
    -Sandip

    Rashmi/Kukku,
    First of all, Thanks for your help!
    Is there any other way in which we can access tables other than using BAPIs or RFCs?
    In my case, there is a table structure which has to be updated with values after validating a key. i don't think there is any RFC available now. do i need to create bapi/rfc for that?
    Krishna Murthy

  • Update Multiple records using NW CE WebDyn Pro 7.2 interface ITEMDETAILS

    We are trying to use SAP Netweaver CE 7.2 and NetWeaver Design Studio 7.2 with the Web Dynpro application interfaces configured to connect to our MDM 7.1 SP06 repositories to develop web screens that allow our end users the ability to maintain MDM repository data without the use of DataManager.
         Our first application was to be a simple one to show the business the benefit of SAP Netweaver. Itu2019s very easy to use the interfaces for SEARCH, RESULTSET, ITEMDETAILS, MATCH and MERGE if you plan to maintain one record at a time. We would like to update many records at the same time.
    Using the configuration described previously, I find that I am able to select multiple records at one time using the RESULTSET interface and the Context folder of u201CSelectedRecordsu201D but I am not able to pass multiple records at one time to the context u201CIODatau201D used by the ITEMDETAILS interface and allow my end users to see and update multiple records at one time.
    If I can pass multiple records from RESULTSET to ITEMDETAILS for display and update would you please provide me with an example of how I would do this in NetWeaver Design Studio for NW CE 7.2..
    If I can NOT pass multiple records from RESULTSET to ITEMDETAILS for display and update, Would I then have to write my own wrapper application to read multiple records selected using the RESULTSET interface and the develop my own UPDATE view to display and update more than one record at a time. This would be time consuming since I would also have to write my own back out procedures and validation of update procedures that already happen within ITEMDETAILS.  Do you happen to have any CE application examples that show how this is done for a NW CE MDM repository that I can see? The current documentation u201CHow to Build Web Applications Using MDM Web Dynpro Components. pdfu201D falls short in the area of updating multiple records.
    Thank you in Advance

    Bugs aside, if it's VERY noisy, that might just be the out-of-sync problem (something I'm very familiar with now).
    Search the forum for "aggregate sync" and you should get some clues, if this is indeed the problem.
    Short of it is, you need to sync the two devices together. Easiest way seems to be to connect the two devices via S/PDIF and set Clock Source to S/PDIF for the "slave" device (set in Audio Midi).
    You can also just set the Clock Source as the "master" device in the drop down, bypassing the need for the S/PDIF cable altogether, but I haven't tried this myself.
    Macbook Pro CD / iMac C2D   Mac OS X (10.4.8)  

Maybe you are looking for

  • Proxy to SOAP with an attachment

    Hi all, we have a scenario proxy to soap,and the volume of data sending from proxy to soap is more than 20 mb. as the third party system can't receive 20MB of data in one single soap message and we can't split this message as the whole data is relate

  • IP address unknown "show authentication session interface"

    Hi, I have the following issue: Several hosts on a specific VLAN cannot reach a VNC server which is located in the same VLAN. All the ports are running 802.1X and hosts are authenticated based on certificate. The hosts that have the issue are always

  • IMG - View maintenance - How to define generic length of a field?

    Hi there, within a viewcluster I want to define one field length generic dependet of an entry within another view of the viewcluster. Have anybody an idea how to solve this issue of generic field length? Kind regards, Kathrin

  • Suggestion_New Feature of iPad

    Hi, As one of Apple holic, I'd like to suggest a new idea for iPad. Maybe someone could imagine once but it'll be great and useful if iPad has got a new feature, external monitor. Apparently, it doesn't look very difficult to add it... or not. Just p

  • Overflow text scroll bar

    Is it possible to creat overflow scrollbar for tables? I have seen many references to creating scrollbar for frames and layers but I need to creat one for a table. Is this possible and how. Thanks