Dynamically deleting row in struts

Hi All,
Can any one suggest me how to delete a row by highlighting it. I am using struts frame work and my home page consists of a table with the data populated from the database, my requirement here is to give an option to the user to delete a row by highlight it. I do not have any idea of doing this. Do we have any specific functionality in struts to do this??
Please help me out.
Thanks.

Hi ,
Sorry if the previous link was of no use to you. May be this will help you to add/ remove table rows from html using js.
http://www.mredkj.com/tutorials/tableaddrow.html
and add/remove html elements using js
http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/
Not sure , how to highlight a row and delete it , but you can have onClick,onKeyDown,ondblclick ..... events on TR which may be used to trigger the deletion.

Similar Messages

  • Delete rows from Tabular form

    Hi,
    Anyone knows how dynamicly delete rows from Tabular Form (on button click, button is as item)?
    Thanks.

    I am in a great fix. We had a test instance.. and we had a version apex 3.2.. But when the same application has been uploaded to prod.. we used apex 4.0.Why on Earth would you do this? The whole point of the testing is to verify that the application will work in the production environment: the first requirement for this is that the test and production environments are equivalent.
    has any body is facing the same issue as mine..Yes, as is easily discovered by searching the forum...see Delete button doesn't work in tabular form after upgrade from APEX3.2 to 4.

  • BPM Object Presentation - array items - (add / delete rows dynamically)

    Hi,
    We have a BPM Object presentation which uses a 'group' inner object to display ROWS of data. The presentation has an 'array0' created by default to handle the 'group' of rows. It also has the '+' and '-' buttons by default.
    There is a field at the upper level which shows the 'sum' of values in individual rows. It needs to 'REFRESH' when an add (+) or deletetion (-) or rows happen.
    But we see that all the controls (text boxes etc which are wired to the 'inner' bpm object of the group and the +/- buttons are one unit 'array0'. And the only method if at all, is an 'Event Listner' which is not showing any methods related to BPM Object.
    Can anyone help us with a clue as to how to handle the '+' and '-' events or wire the 'array/group' events to code - any clue with 'events'?
    This is a little urgent as it is an issue and we need to fix the same. Appreciate any quick responses/clues.
    Thanks in advance,
    -user8702013.

    The SUM field needs refresh() method to be called to reflect the new value whenever we are adding/deleting rows.
    To call this method for to show the reflection we have to declare a method on BPM object level which receives a argument of type ‘Fuego.Util.GroupEvent’, then in this method you can have your logic(here refresh() method is required to show new value on deletion/addition, hence this method is being called). This method can then be wired (it shows up) to the 'Event Listener' of the group/array.
    The newly created method will be called whenever a new row is added/deleted (Event will be fired hence method call).

  • Dynamic form processing in struts

    Hi all,
    I need your help regarding dynamic form elements form processing.
    Here is my JSP Script,
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <html:html>
    <HEAD>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <TITLE>Processing Dynamic Forms</TITLE>
    <script type="text/javascript">
    //function which adds new row
    function AddRow()
         tb=document.getElementById("demo");
         // attach counter
         lnrows = tb.rows.length;
         //alert(lnrows);
         newrow = tb.insertRow(lnrows);
         var fourth_col = "amt"+lnrows;
         cell3=newrow.insertCell(0);
         cell3.innerHTML="<center><input type='text' id='"+fourth_col+"' name='"+fourth_col+"' size='10'/></center>";
         document.getElementById("cntr").value = lnrows;
    // function to delete row
    function DeleteRow()
         tb=document.getElementById("demo");
         lnrows = tb.rows.length;
         //alert(lnrows);
         if(lnrows > 2)
              tb.deleteRow(lnrows-1);
              document.getElementById("cntr").value = tb.rows.length - 1;
    </script>
    </HEAD>
    <BODY>
    <html:form action="/dynaActions">
    <TABLE id='demo' align='center' width='80%' border='1'>
    <TR>
         <TH width='25%'>Party Name</TH>
    </TR>
    <TR>
         <TD align='center'><input type='text' id="party1" name="party1" size="30" /></TD>
    </TR>
    </TABLE>
    <TABLE align='center' width='80%' border='0'>
    <TR align="right">
    <td>
         <html:button property="Add" value="Add" onclick="AddRow();" ></html:button>
         <html:button property="Remove"  value="Remove" onclick="DeleteRow();"></html:button>
    </td>
    </TR>
    <TR align="center">
    <td>
         <input type='hidden' id="cntr" name="cntr" value="1" />
         <html:submit/>
    </td>
    </TR>
    </TABLE>
    </html:form>
    </BODY>
    </html:html> As you seen there is dynamically form elements generated as many as required. Now how do I process this with ActionForm & Action?
    Regards,
    Mahesh

    Hi rrhegde,
    Thanks for response.
    Ok, So instead of making it party1, party2, party3, party4, .............................
    if I make it party[1], party[2], party[3], party[4],.............................
    But then how do I process this array. Since the array length will not be fixed, it depends upon users.
    If possible pls provide me some example code on this.
    Thanks & Regards,
    bonzy

  • Delete row in report........

    i have report, i have to delete row without page loading. i have wrote the application process(on demand). but i dont know how to write the javascript for htmldb items...
    my req is when i click the delete button the checked row(using check box) should delete without page load. i use ajax to call the javascript to process the plsql code.
    can any one pls help me to modify the below javascript coding....
    application process
    begin
    for i in 1..htmldb_application.g_f01.count
    loop
      delete from service
      where service_code = htmldb_application.g_f02(htmldb_application.g_f01(i));
    end loop;
    end;
    javascript
    function get_repd(){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=REP_D',0);
    }thanks and regard.
    skud.

    Hi Skud,
    I will have to say your observation is incorrect. The whole purpose of doing the DML via Application Process using ajax technique is to avoid a page refresh, otherwise it would simply be a page level after submit process.
    I have just tested and its working as expected, i.e
    1. You select one or more records
    2. Use the delete button to delete
    3. Records get deleted from DB, you get a message
    4. Only the report region get refreshed. (However this could delay for a few seconds if the dataset is larger and server is very busy)
    If you are however using APEX 4.x you could use dynamic actions to get it done. My work environment is still on 3.x so my solution is using classic method.
    If you are still having issue could you please let me know which browser you are using?
    Cheers
    Ligon

  • Add row / delete row in PDF Form

    Alright so I am really struggling here and no one has been able to provide me a solid answer to date.
    1. I am creating a PDF form I want users to be able to fill and remit via email
    2. I have created the form in Acrobat 9 Pro via the form Wizard and in some combination with MS Word 2007 for text and table fields to get the forms wizard to auto-populate Adobe form fields.
    3. Some of the tables, i.e. In the first table for "Full Time" and "Part Time" should have check boxes - works fine to date. While others should have drop downs, i.e. platform build, etc - works fine to date.
    4. This is the pressing issue. As they exist today there is a large table as you can clearly see. I want users to be able to simply click an "Add Row" or "Delete Row" button to add another row to the table (or delete) without having to have a massive table.
    I've watched demos on Lynda.com (all of which are irrelevant and provided 0 value), tried to work with what people have responded with previously but all are mainly sample documents and I don't know where to start. In short, I open my form and other forms in LifeCycle Designer ES, take a look at the buttons people have created, the scripts, the XML source, etc. but no idea where to go. If the button needs to be in the table. How it should be scripted. etc. I cannot find a video tutorial anywhere on the web and all the responses simply provide a sample but no idea how to make it a reality in terms of translating their sample into a working dynamic form in PDF. Any help is greatly appreciated. Thanks.

    For a dynamic table you have to design a new XFA-form in Designer.
    Here's a little tutorial how to create dynamic tables.
    http://forms.stefcameron.com/2009/02/25/expandable-table-with-totals/
    Just a little correction.
    You can inport Docx-Files with tables and add / remove rows in a dynamic PDF.
    But, this is not handy, if the table contains more than one row when it is imported because Designer gives every detected row the same name (Row).
    Delete all row excepting the first one and set it to repeatable in the binding tab.
    Then you can use the addInstance() and removeInstance() methods to add/remove row to the table.
    Here an example file I made from a docx file.
    https://acrobat.com/#d=k8XbQWmqu6bhfrrwui93pw

  • Dynamic Table Row Removal

    I'm using LiveCycle Form Designer 8 and Acrobat Reader 7.09
    I've created a simple dynamic table that has an ADD ROW button that uses _Row1.addInstance(1); to add a new row and that works great. I then added the Delete Row button in a SubForm to the first cell of the row with the JavaScript _Row1.removeInstance(this.parent.index).
    The problem is that the Delete Row button always deletes the first row instead of the row that the button is in. So that indicates that this.parent.index = 0. If I force the value it does remove that specific line but I want the removeInstance to remove the line that has been selected.
    How do I get the index to reflect the value of the row that the removeInstance button is in? I must be missing something very basic.

    I'm having the same problem. I tried removeinstance(this.index) but that seems to resolve to index 0 no matter how many instances there are.
    Cheers,
    Al

  • Dynamicly insert rows in a table

    I wanna know if it is possible to dynamicly insert and delete rows into a table. So I want to have a table with a column with only "add-buttons" and a column with only "delete-buttons". If you click on an add, after that row an extra row would be inserted. If you click on a delete-button, the row would be deleted.

    Yes, this is called a client-side dynamic PDF form. Have a look at the dynamic interactive Purchase Order sample in C:\Program Files\Adobe\Designer 7.1\EN\Samples\Purchase Order\Dynamic Interactive\Forms

  • Add/delete row in JTable

    I went through the tutorial of JDK about how to programming JTable, i can NOT find a way to add/delete row into/from JTable.
    I immagine it would be a difficult task because the data set it takes 'Object data[][]' is NOT dynamically grow/shrinkble.
    Can we make it take ArrayList[] as input dataset so that the dataset can dynamically grow/shrink?
    Any other way around to add/delete row?
    THANKS for your consideration.

    You have to write your own TableModel like extending AbstractTableModel. In that class add custom methods to add and remove rows. From those methods call fireTableRowsDeleted(..) and fireTableRowsInserted(..) to update UI.

  • How to add or delete rows in tablecontrol?

    Hi,
    I am using a tablecontrol to enter data records.
    I want to use 2 buttons, one to insert a row into a tablecontrol and another to delete a selected row of a tablecontrol.
    How do I insert or delete rows of a tablecontrol?
    Thanks.

    Hi Kumar,
    Please look at the below sections......
    ADDING BLANK LINES
    To add blank lines to table control we do not need to change any of the fields of the structure CXTAB_CONTROL simply adding blank lines to the internal table will do.
    INSERT INITIAL LINE INTO itab.
    DELETING SELECTED ROWS
    Deletion of selected rows is simple. To delete selected rows first we will determine the rows which have been selected through selection column .
    FOR SINGLE ROW SELECTION
    IF mark EQ 'X' .             "mark is the name of selection column field
    DELETE itab FROM workarea . 
    ENDIF.
    FOR MULTIPLE ROW SELECTION
    *To deetermine the rows selected we will use the selection column field to loop
    *through the internal table.
    LOOP AT itab WHERE mark EQ 'X'.  "mark is the name of selection column field
    DELETE itab                                    " and is part of the internal table .
    ENDLOOP.
    Thanks,
    Ravi Kanth

  • Design problem with dynamically added row in datatable

    Hello all,
    I have a dataTable and have developped a method that dynamically adds rows to the dataTable. Each row is made up of two form controls. The problem I have now is that I don't know how to retrieve the values from the mutiple rows. Ideally I would need the values to be stored into a list.
    Can anyone help?
    Thanks in advance,
    Julien.
    Here is my code:
    <h:dataTable var="line" binding="#{TradeClientsAndQuantitiesBean.clientsAndQuantities}"  value="#{TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers}">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="S�lectionnez un client"/>
                    </f:facet>
                    <h:selectOneMenu value="#{TradeClientsAndQuantitiesHelperBean.selectedClientTemp}">
                        <f:selectItems value="#{TradeClientsAndQuantitiesHelperBean.concatenatedLabelMap}"/>
                    </h:selectOneMenu>
                </h:column>   
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Renseignez une quantit�"/>
                    </f:facet>
                    <h:inputText value=""/>
                </h:column>   
            </h:dataTable>

    The values will just be put in the same row object you added to TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers.
    It might be worth to read this article: http://balusc.xs4all.nl/srv/dev-jep-dat.html

  • Delete Rows from T1 which are Not in T2

    Hi
    I've 2 Tables like below
    T1
    N1
    N2
    2
    11
    2
    22
    3
    33
    8
    44
    8
    88
    T2
    N1
    N2
    2
    22
    8
    88
    If I Run Delete query, I must delete Rows from T1 which are Not in T2
    For example, I must delete Rows 1,3,4 from T1
    So how to write that delete query? Please advice

    Delete from T1
    Where not Exists (select * from T2 Where t1.N1=t2.N1 and t1.N2=t2.N2)
    --or
    Delete t
    From t1 t
    left JOIN t2 m
    ON m.N1=t.N1 and m.N2=t.N2
    WHERE m.N1 is null and m.N2 is null
    --Or
    ;With mycte as
    select N1,N2 from T1
    Except
    select N1,N2 from T2
    Delete t
    From t1 t
    INNER JOIN mycte m
    ON m.N1=t.N1 and m.N2=t.N2

  • Cannot DELETE rows from LOV on running...is it a bug ??

    One of the features I appreciated in the new version of JHeadstart is that we can now insert, modify and delete rows on LOV (even in the database).
    We have just to check on Lookup properties :
    Multi-row insert allowed
    Multi-row update allowed
    Multi-row delete allowed
    I cheked all of them and on runnig I could insert and update records in LOV.
    When I tried to delete records from LOV the system display information message "nothing to save" and in fact no records were deleted.
    Normally since I checked the delete property it should be possible to delete rows from LOV
    thanks for any Help

    Monta,
    I could reproduce this, it is a bug. Added to the fix list for the next release.
    Thanks for reporting,
    Steven Davelaar,
    JHeadstart Team.

  • Unable to delete rows from Target.

    Hello everyone,
    I am unable to delete rows from target data store. Here is what I have done.
    Source Oracle 10g - staging 11g - Target Oracle 11g
    I have implemented consistent set CDC on data model in staging and added 2 tables to CDC and turned on the journals . Both tables A and B are joined together via Column E (primary key of table A). Table A is the master table(has foreign key). Table B is child table. Target column consists of all the columns of both table A and B.
    Following is what I am able to do and not to do
    ABLE TO DO. If data is inserted into both or any of journalized tables I can successfully load the same in target by performing following steps. 1. Extend the consistency window at model level. Lock subscriber. Run the interface with any source table marked as Journalized data only. Unlock subscriber and purge journal.
    ABLE TO DO. If data is updated in any of the journalized table, along with the steps mentioned above I can execute two interfaces. In one Interface table A marked as journalized data only Joined with table B and in second interface table B marked as Journalized data only joined to table a.
    NOT ABLE TO DO If data is deleted from one or both tables it shows up as journalized data in JV$D<tablename> marked as D with date and subscriber name but when i run the interface by extending the window , locking subscriber executing both interfaces, unlock subscriber purge journals. no change takes place is Target. After unlocking subscriber step, journalized data gets removed from JV$D view. Please let me know what I am doing wrong here. How can rows delted from source can also be deleted from TARGET?
    NOTE : In the flow table SYNC_JRNL_DELETES is YES
    In moel under jounalized table tab Table have following order Table A folloed by Table B
    Thanks in advance
    Greenwich

    Sorry I still do not get it. when you say "Its a legacy app", are you talking about the VB.NET app ?
    If so then I repeat my self :-) Why not to connecting to the SQL server directly?
    * even if you need information from several databases (for example ACCESS + SQL Server), in most cases, it is much better to connect directly and get each information to the app. Then in your app you can combine the information and analyse it
    [Personal Site] [Blog] [Facebook]
    Access app is the legacy app. 

  • Database, Dataset, Table Adaptors Error "Unable to load, Update requires a valid DeleteCommand when passed DataRow collection with deleted row"

    Microsoft Visual Basic 2010 Express.
    I am new to Visual Basic programing and i am trying to understand the relationships between Datasets, database, table Adaptors. I have to following code that is is giving me the following error" Unable to load, Update requires a valid DeleteCommand
    when passed DataRow collection with deleted rows". 
    I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    It seems that i can delete the data on the DataGridView Table and it only displays the correct data. but my database is not updating, even though the data grid displays differently.I can determine this because, when i save the offset database, i have all
    the previous uploads and all the rows that i wanted to delete are still there.
    My final goal is to be able to import offset data from a CSV file, save this data on the pc, send a copy of this data to a NuermicUpDown so the customer can modify certain numbers. From here they download all the date to a controller.  IF the customer
    needs to modify the imported data, they can go to a tab with a data grid view and modify the table. They will also have to option to save the modified data into a csv file.  
    Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    CODE:
    Private Function LoadOffSetData()
            Dim LoadOffsetDialog As New OpenFileDialog 'create a new open file dialog and setup its parameters
            LoadOffsetDialog.DefaultExt = "csv"
            LoadOffsetDialog.Filter = "csv|*.csv"
            LoadOffsetDialog.Title = "Load Offset Data"
            LoadOffsetDialog.FileName = "RollCoaterOffset.csv"
            If LoadOffsetDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then  'show the dialog and if the result is ok then
                Try
                    Dim myStream As New System.IO.StreamReader(LoadOffsetDialog.OpenFile) 'try to open the file with a stream reader
                    If (myStream IsNot Nothing) Then 'if the file is valid
                        For Each oldRow As MaterionOffsetDataSet.OffsetTableRow In MaterionOffsetDataSet.OffsetTable.Rows
                            oldRow.Delete()                       
    'delete all of the existing rows
                        Next
                        'OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        Dim rowvalue As String
                        Dim cellvalue(25) As String
                        'Reading CSV file content
                        While myStream.Peek() <> -1
                            Dim NRow As MaterionOffsetDataSet.OffsetTableRow
                            rowvalue = myStream.ReadLine()
                            cellvalue = rowvalue.Split(","c) 'check what is ur separator
                            NRow = MaterionOffsetDataSet.OffsetTable.Rows.Add(cellvalue)
                            Me.OffsetTableTableAdapter.Update(NRow)
                        End While
                        Me.OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        MainOffset.Value = OffsetTableTableAdapter.MainOffsetValue          'saves all the table offsets
    to the offset numericUpDown registers in the main window
                        StationOffset01.Value = OffsetTableTableAdapter.Station01Value
                        StationOffset02.Value = OffsetTableTableAdapter.Station02Value
                       myStream.Close() 'close the stream
                        Return True
                    Else 'if we were not able to open the file then
                        MsgBox("Unable to load, check file name and location") 'let the operator know that the file wasn't able to open
                        Return False
                    End If
                Catch ex As Exception
                    MsgBox("Unable to load, " + ex.Message)
                    Return False
                End Try
            Else
                Return False
            End If
        End Function

    Hello SaulMTZ,
    >>I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    This error usually shows that you do not initialize the
    DeleteCommand object, you could check this
    article to see if you get a workaround.
    >> Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    If you are working CSV file, you could use OleDB to read it which would treat the CSV file as a Table:
    http://www.codeproject.com/Articles/27802/Using-OleDb-to-Import-Text-Files-tab-CSV-custom
    which seems to be easier (in my opinion).
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Screen turns black suddenly, then re-emerges within a second

    Hi, here's a new strange issue with my new Asus Eee PC: Recently, and perhaps it's because some updated packages, the screen turns black totally without warning, and shows up again as if nothing has happened. That is, no matter what I currently do, a

  • Forms 10.1.2.0.2 application with ie7 and Jvm 1.5_11 unstable.

    Hi, We are running a 10.1.2.0.2 forms application, using the sun jvm, version 1.5.0_11-b03 . Since we started using IE7, some users experience sudden "hangs" or a total crash of IE& + JVM when starting the application. A log file appears with the fol

  • Autodocking the window at maximum size in an application

    How is it possible to dock the window of an application at the borders of the screen - and the task bar - in Windows? When setting the size ( setSize() ) to the screen size (eg. 1024, 768), I'm enduring a couple of problems; 1. Even though I set the

  • 802.1X IAS Switch 3750

    Hi, I am configuring authentication 802.1X in my Access Switchs. The switchs are WS-C3750G-24PS running C3750-IPBASEK9-M, Version 15.0(1)SE2, RELEASE SOFTWARE (fc3). The Radius server is a IAS server, in the IAS there is a Remote Policy with the Wind

  • Interactive Image: Text Styles?

    Is there a standard text style we can edit to modify what shows up in the text boxes when an interactive image zooms in? According to the Style menu it's "Body Bullet" text, which just by looking at it you know that's not right. I don't see an "Inter