JTable filled from a database.

Hello everyone,
I have defined a TableModel which gets the information from a database. The information is put in a two-dimensional array from which i have column 0 reserved for the primary key. I don't want to show this column, but I do want to retrieve this key when a row is clicked. How can I manipulate the event behaviour of the table so, that the listener returns my primary key instead of the number of the row which is clicked?

Hello everyone,
I have defined a TableModel which gets the information
from a database. The information is put in a
two-dimensional array from which i have column 0
reserved for the primary key. I don't want to show
this column, but I do want to retrieve this key when a
row is clicked. How can I manipulate the event
behaviour of the table so, that the listener returns
my primary key instead of the number of the row which
is clicked?Which listeners?
Why no just add a method to your TableModel
something like getPrimaryKeyForRow(int row) and
call it when needed.

Similar Messages

  • Insert into dropdown list filled from database

    Hi,
    I have a dropdownlist which is filled from a database. I want to insert an empty/dummy option at index 0. I couldn't find when the rowset execute in the code( the autogenerated constructor have datasorce and command setup but no execute()), and don't how to modify the data from the database. Any help or suggestions? thanks.
    John

    It doesn't work if the selectOneMenu uses a converter. (I assume it works if the used values are just strings.)
    Then you get on selecting the extra added selectItem a
    Validation Error: {0}Value is not validJSP source:
    <h:selectOneMenu binding="#{main.ddlReps}" converter="#{main.ddlRepsConverter}" id="ddlReps" styleClass="blackfont7">
      <f:selectItem itemLabel="Alle reps" itemValue="0"/>
      <f:selectItems binding="#{main.ddlRepsSelectItems}" id="ddlRepsSelectItems" value="#{main.hdusersRowSet.selectItems['SID,USERNAME']}"/>
    </h:selectOneMenu>SID is a number(3) type field in an Oracle table
    Converter used:
    private BigDecimalConverter ddlRepsConverter = new BigDecimalConverter();
    public BigDecimalConverter getDdlRepsConverter() {
        return ddlRepsConverter;
    public void setDdlRepsConverter(BigDecimalConverter bdc) {
        this.ddlRepsConverter = bdc;
    }I thought I could outsmart this but no:
    <f:selectItem itemLabel="Alle reps" itemValue="#{main.dummy}"/>With the following code in the java code of the page:
    private int dummy = 0;
    public int getDummy() {
        return this.dummy;
    }But then the converter starts giving errors.
    Roland

  • Giving input to jtable from a database in runtime

    friends
    previously i have posted an query asking how to intilize the row size of jtable in run time for which i got good rewsponce to direct me to an page in sun/components,i read the jtable page in specifie link provided in sun,but i could not figure out how to give input to jtable from a database on runtime.In that page they have used by giving input in an array and then displaying it, by that they set the no of rows in the table ,but i want to set the row size based on number of records fetched from the oracle database.kindly guide me
    Arjun

    What you need is to develop a table model which uses a database as the data source.
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data

  • Deleting records from a Database using JTable

    Hello!
    I have a JTable that displays records from a database and a Jbutton .
    If i press the button i want that the record coresponding to selectedRow(from the JTable) to be erased from the database.How can i manipulate selectedRow from JTable to do that?
    Pls any suggestions (and if it's possible +code)?
    Thanks!

    Hi Margot,
    Let's assume that you have created a table using vectors. Simply remove the element from the vector at row selected and redraw. Maybe not the greatest solution but should work.
    Vector rowData = new Vector();
    //read in values for each row
    Vector headers = new Vector();
    //add your headers
    JTable table = new JTable(rowData, headers);
    int row = table.getSelectedRow();
    rowData.removeElementAt(row);
    table = new JTable(rowData, headers);HTH,
    Chris

  • Fetching data from a database to a JTable

    Can anyone please help me out in this topic. I have created an application in NetBeans 5.5.1 which has a table with only the same columns names as the database,but has null data values. Now I want that on click of a "Search" button the data will be fetched from the database and sorted out in the table under the respective column names. I really need help on this one.

    In the future, Swing related questions should be posted in the Swing forum.
    What keywords did you use to search the forum before you posted? Keywords like "jtable resultset" should find other postings on this topic. I've posted a solution in the Swing forum so you could also add my id to the keyword list if you want.

  • Database filling from XML report of TS3

    Does NI have a tool to fill-up an Oracle database from a XML report of TS3? The idea is to fill up the database during the night.

    I can't answer your question about NI having a tool, but we are facing a similar problem so I will share some of our ideas.
    1. You could write your own XML parser that would read the file and load it into the database. Since it is a standard format, you should be able to find software that will make the parsing relatively easy.
    2. You could load the file directly into an Oracle 9i database, passing it as a LOB parameter. You would need to write the code for loading the file (examples can be found on the internet) and you would probably need an Oracle expert to implement the XML parsing on the database side.
    3. You could save the results container as a file, then later load the file into TestStand and use the standard database logging sequence. We tried a
    dding the results container to StationGlobals, but have had problems saving all the data to disk.
    4. You could modify the text report so that it creates the SQL statements required to enter your data into the database. Then the file can be loaded into the database as "dynamic SQL".
    5. You could log the data to a local database, then later load it into the main database, as suggested by Dennis (http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000E13B0000&UCATEGORY_0=_8_&UCATEGORY_S=0).

  • JDBC:  Filling a combobox or listbox from a database

    How would I go about populating a combobox or listbox from a database query?
    What would the basic steps be? Do I need to create vectors?
    Is there a good reference place for this stuff on the Web?
    Thanks!

    What would the basic steps be? Do I need to create
    vectors?possible (not so clean):
    1. retrieve a resultset
    2. create a model with the set
    3. set the model of the listbox or the combobox
    4. call repaint
    Is there a good reference place for this stuff on the
    Web?http://developer.java.sun.com/developer/onlineTraining/
    Thanks!

  • Getting specific values From a database in Java

    Hey,
    I'm using XE and building an application in Java to do basic CRUD operations on the database.
    One of these operations is searching for a customer by last name (which runs fine) and the result of the query (a customer ID, a first name, and a last name) is displayed in a JTable. I want to be able to click on the record I need and use the customer ID to do an insert on another table CUSTOMER_PURCHASES which maps purchases to customers.
    How do I go about doing this knowing that customer ID is an auto-incremented number (using a SEQUENCE)?
    I thought about creating a variable in Java of type String called customerID and initialize it like this: String customerID = "CUSTOMER_SEQUENCE.nextval"
    But by doing this, I suspect that I'll be getting the next available customerID, not the one from the record I selected.
    Can anybody suggest a workaround or lead me in the right direction?
    Thank you in advance for the help and sorry about the long post, but I'm a newvbie to this field.

    As per raychen's advice, I was able to get the image from the database and bring it over into JavaFX.
    In my java class I retrieved the image as follows:
            BufferedImage image = null;  //Buffered image coming from database
            InputStream fis = null; //Inputstream
            try{
                ResultSet databaseResults;  //Returned results from DB
                stmt = conn.createStatement(); //Create the SQL statement
                databaseResults= stmt.executeQuery("SELECT * FROM mydb.`user` WHERE userID = 'username';"); //Execute query
                fis = blah.getBinaryStream(3);  //It happens that the 3rd column in my database is where the image is stored (a BLOB)
                image = javax.imageio.ImageIO.read(fis);  //create the BufferedImaged
            } catch (Exception e){
                     //print error if caught
           return image  //My function returns a BufferedImage objectSo in JavaFX, depending on how you have it set up, you essentially get the returned BufferedImage and create the image as follows:
    var bufferedImage : BufferedImage = theJavaFunctionThatReturnsABufferedImage();
    var newImage : Image = javafx.ext.swing.SwingUtils.toFXImage(bufferedImage);  //BufferedImageCheers and Happy New Year.

  • Form does not show "new" records from SQL Database

    I have a PDF form that pulls data from a SQL Server.  The fields in
    the PDF are populated from the database after selecting a specific
    record from a drop down and then clicking on a button labeled "Fill".
    The problem is that the dropdown does not display new records that
    have been recently added to the database.  I have to open the form up
    in designer then save it, (*note - I change nothing at this point.)
    Then when the form is opened back up in Adobe the dropdown show all
    the records including the new ones.  I even put a manual refresh on
    form to try and fix this an it did not help. Seriously stumped.
    Any help is greatly appreciated.
    Here is my code for the dropdown.
    ++++++++++++++++++++++++++++
    topmostSubform.Page1.JobSelect::initialize - (JavaScript, client)
    var sDataConnectionName = "BBCC"; // example - var sDataConnectionName
    = "Test";
    var sColHiddenValue = "ContractAdmin_Key"; // example - var
    sColHiddenValue = "Dept_ID";
    var sColDisplayText = "JobDescription"; // example - var
    sColDisplayText = "Dept_ID"
    // Search for sourceSet node which matchs the DataConnection name
    var nIndex = 0;
    while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
    nIndex++;
    var oDB = xfa.sourceSet.nodes.item(nIndex);
    oDB.open();
    oDB.first();
    // Search node with the class name "command"
    var nDBIndex = 0;
    while(oDB.nodes.item(nDBIndex).className != "command")
    nDBIndex++;
    // Backup the original settings before assigning BOF and EOF to stay
    var sBOFBackup =
    oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");
    var sEOFBackup =
    oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF",
    "bofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF",
    "eofAction");
    // Clear the list
    this.clearItems();
    // Search for the record node with the matching Data Connection name
    nIndex = 0;
    while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)
    nIndex++;
    var oRecord = xfa.record.nodes.item(nIndex);
    // Find the value node
    var oValueNode = null;
    var oTextNode = null;
    for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)
    { if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)
    { oValueNode = oRecord.nodes.item(nColIndex); } else
    if(oRecord.nodes.item(nColIndex).name == sColDisplayText) { oTextNode
    = oRecord.nodes.item(nColIndex); } }
    while(!oDB.isEOF())
      this.addItem(oTextNode.value, oValueNode.value);
       oDB.next();
    // Restore the original settings
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup,
    "bofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup,
    "eofAction");
    // Close connection
    oDB.close();
    ++++++++++++++++++++++
    Here is code for the refresh button
    +++++++++++++++++++++
    topmostSubform.Page1.Button27::click - (JavaScript, client)
    sourceSet.BBCC.requery();
    +++++++++++++++++++++

    pguerett wrote:
    The other thing that might be happening is a refresh issue on the DropDownList. Try adding the command xfa.layout.relayout() after the database connection has been closed.
    Paul
    Good catch Paul!  Would you believe that I have been trying to get this resolved for almost two years! Works perfect now.
    Thank you,
      - Eric

  • How can I generate a real-time highchart from my database data?

    I have looked several links; however, I couldn't find a working demo showing how to implement a highchart using data from a database.
    Objective: I want to generate a real time highchart line graph getting data from my database. What I want is very similar to the
    HighChart Demo which provides a real-time highchart with randomly generated values. It is also similar by X-axis and Y-axis, for I want my x-axis to be "Time" (I have a DateTime column in my database) and y-axis to be an integer (I have
    a variable for that as well in my database).
    Please I need help in sending the model data to my razor view.
    Note that I am already using SignalR to display a realtime table. I also want to know if it can be used to automatically update the highchart as well.
    Below is the code snippet of my script in the view. I have used the code provided in
    HighChart Demo link for generating the highchart. Please tell me where should I apply the changes on my code.
    @section Scripts{
    <script src="~/Scripts/jquery.signalR-2.2.0.js"></script>
    <!--Reference the autogenerated SignalR hub script. -->
    <script src="~/SignalR/Hubs"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    // Declare a proxy to reference the hub.
    var notifications = $.connection.dataHub;
    //debugger;
    // Create a function that the hub can call to broadcast messages.
    notifications.client.updateMessages = function () {
    getAllMessages()
    // Start the connection.
    $.connection.hub.start().done(function () {
    alert("connection started")
    getAllMessages();
    }).fail(function (e) {
    alert(e);
    //Highchart
    Highcharts.setOptions({
    global: {
    useUTC: false
    //Fill chart
    $('#container').highcharts({
    chart: {
    type: 'spline',
    animation: Highcharts.svg, // don't animate in old IE
    marginRight: 10,
    events: {
    load: function () {
    // set up the updating of the chart each second
    var series = this.series[0];
    setInterval(function () {
    var x = (new Date()).getTime(), // current time
    y = Math.random();
    series.addPoint([x, y], true, true);
    }, 1000);//300000
    title: {
    text: 'Live random data'
    xAxis: {
    type: 'datetime',
    tickPixelInterval: 150
    yAxis: {
    title: {
    text: 'Value'
    plotLines: [{
    value: 0,
    width: 1,
    color: '#808080'
    tooltip: {
    formatter: function () {
    return '<b>' + this.series.name + '</b><br/>' +
    Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
    Highcharts.numberFormat(this.y, 2);
    legend: {
    enabled: false
    exporting: {
    enabled: false
    series: [{
    name: 'Random data',
    data: (function () {
    // generate an array of random data
    var data = [],
    time = (new Date()).getTime(),
    i;
    for (i = -19; i <= 0; i += 1) {
    data.push({
    x: time + i * 1000,
    y: Math.random()
    return data;
    function getAllMessages() {
    var tbl = $('#messagesTable');
    var data = @Html.Raw(JsonConvert.SerializeObject(this.Model))
    $.ajax({
    url: '/nurse/GetMessages',
    data: {
    id: data.id,
    contentType: 'application/html ; charset:utf-8',
    type: 'GET',
    dataType: 'html'
    }).success(function (result) {
    tbl.empty().append(result);
    $("#g_table").dataTable();
    }).error(function (e) {
    alert(e);
    </script>

    Hi Sihem,
    Thank you for contacting National Instruments.  Using the LabVIEW Real-Time module, you can do development without actually having a target.  While viewing the project explorer window, you can do the following steps:
    Right click on the project
    Select New >> Targets and Devices
    Select the "New Target or Device" radio button
    Select the target you would like to develop on.Information about the LabVIEW Real-Time Module can be found here.
    Regards,
    Kevin H
    National Instruments
    WSN/Wireless DAQ Product Support Engineer

  • How to fetch records from the database into a combo box?

    Hi:
    I&acute;m really new with ABLBPM and I&acute;m trying to fetch records from the database to display them into a combo box as valid values for a presentation but I&acute;m using a dynamic method with this code:
    <em>for each row in SELECT campo1, campo2 from TABLE</em>
    <em>do</em>
    <em>solicitudes[] = [row.campo1, row.campo2]</em>
    <em>end</em>
    <em>return solicitudes
    </em>And the debugger says that SQL instructions can be used only in fuctions and procedures that are executed on the server.
    Do you know another way to do it?
    P.D. Sorry for my terrible english
    Greetings

    Hi Steve,
    Thank you, your idea is perfect, but when I try to run the screenflow where the combo should be filled I get this error:
    fuego.lang.ComponentExecutionException: No se ha podido ejecutar correctamente la tarea.
    Motivo: 'java.lang.NullPointerException'.
         at fuego.web.execution.InteractiveExecution.setExecutionError(InteractiveExecution.java:307)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:166)
         at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
         at fuego.webdebugger.servlet.DebuggerServlet.redirect(DebuggerServlet.java:136)
         at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:85)
         at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at fuego.web.execution.servlet.ServletExternalContext.forwardInternal(ServletExternalContext.java:197)
         at fuego.web.execution.servlet.ServletExternalContext.processAction(ServletExternalContext.java:110)
         at fuego.webdebugger.servlet.DebuggerExecution.dispatchComponentExecution(DebuggerExecution.java:64)
         at fuego.web.execution.InteractiveExecution.invokePrepare(InteractiveExecution.java:351)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:192)
         at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:223)
         at fuego.webdebugger.servlet.DebuggerServlet.doDebug(DebuggerServlet.java:148)
         at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:82)
         at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    Any ideas??
    Thanks and greetings

  • How to display data from a database to a  JComboBox  JTextField

    Hello
    I was wondering I have a database called "PAYTYPE" and have a colums called
    EMPLOYEETYPE     PAYBASIC     PAYSUNDAY     PAYHOLIDAY     PAYPERIOD
    What i want to do is display the list of EMPLOYEETYPE in a combo box(Which i got this part working),
         try{
              ResultSet rs = db.getResult("Select * FROM PAYTYPE");
              while(rs.next())
                   payTypeField.addItem(rs.getString(2));
              }catch(SQLException e)
              }When an item is selected from the combo box then the information thats in PAYBASIC,PAYSUNDAY,PAYHOLIDAY, PAYPERIOD will be displayed in textfields
    this is the problem im trying to solve
    Any Ideas ??????

    What im trying to do is the following
    on my Gui i have 1 JComboBox and 3 JtextFields
    The Jcombo box is populated by the data base
    try{     
              ResultSet rs = db.getResult("Select * FROM EMPLOYEEPAYTYPE");
              while(rs.next())
                   payTypeField.addItem(rs.getString(2));
              }catch(SQLException e)
              }Now that i have the JComboBox filled I want the other 3 JTextField to be populated with the information that been selected by the JComboBox
    I under stand there needs to be a .addActionListener(this) to the JComboBox
                    payTypeField = new JComboBox();
                payTypeField.setBounds(130, 10,100,20);
                payTypeField.addActionListener(this);
                payTypeField.addItemListener(this);
                 c.add(payTypeField);I would just like the steps that i need to take in order to fill the JTextBoxes in pudoscode
    The information that i need will need to be pulled from the database - EMPLOYEEPAYTYPE
    Thanks
    Jon

  • How can i retrieve documents(.doc,.pdf, .txt) using forms from the database.

    How can i retrieve documents(e.g .doc,.pdf, .txt etc) using forms from the database.
    i inserted the documents using sql*loader, below is the control and data files.
    -- control file
    LOAD DATA
    infile 'load.txt'
    INTO TABLE husman
    APPEND
    FIELDS TERMINATED BY ','
    (id integer external,
    fname FILLER CHAR(50),
    docu LOBFILE(fname) TERMINATED BY EOF)
    --data file
    1,../husman/dell.doc,
    2,../husman/me.pdf,
    3,../husman/export.txt,
    in the form i have a text field to display the id and an OLE container to display the document as an icon. but when i execute query, i only get the id number and not the document.
    any help will be appreciated.
    Thanks
    Hussein Saiger

    Step by step
    1. Erase all contents and settings
    2. You'll be asked twice to confirm
    3. You'll see Apple logo and progress bar
    4. You'll see a big iPad logo on screen
    5. Configuration start
    6. Set language
    7. Set country
    8. Enable Location Service
    9. Select network, enter password and join network
    10. You'll be given 3 options (a) Setup as New iPad (b) Restore from iCloud Backup (c) Restore from iTune Backup
    11. Selected Restore from iCloud Backup
    12. You'll be required to enter Apple ID and Password
    13. Agree to Terms and Conditions
    14. Select Backup file
    15. You'll see progress bar
    16. Red slider will appear; slide to unlock; step #1 to #16 is fast
    17. Pre-installed apps will be restored first
    18. Message: Purchased apps and media will now be automatically downloaded
    19. You'll see a pageful of apps with Waiting/Loading/Installing
    20. Message: Some apps cannot be downloaded, please sync with computer

  • Selecting a one row from the database is not working

    Hi all I am having a small problem with getting a row from my database to show up. Here is the code for the search that I want to do
                            String item; String columnName; String result; columnName = (String)searchBox.getSelectedItem(); item = searchField.getText().trim(); String tableName = "employee"; if(item == null || item.equals("")){ System.out.println("No Text entered"); }else{ try { result = sql.retrieve_From_Database(columnName, tableName, item); System.out.println(result); } catch (SQLException e1) { sql.displayErrors(e1); }
    Here is the code for the retrieve_From_Database function.
    protected String retrieve_From_Database(String columnName, String tableName, String item) throws SQLException{ ResultSet rs = null; Statement sm = null; sm = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); rs = sm.executeQuery("select * from " + tableName + " where " + columnName + " = " + item); result = rs.getString(columnName); if(result == null){ System.out.println("Error in retrieve"); return new String("No results in DB"); }else{ System.out.println(result); return result; } }
    When I run the first code I get an error of SQL Exception: Unknown column 'anthony' in 'where clause'. But yet when I run the query of
    Select * from employee where FirstName = 'anthony'
    within the mysql commandline I get the proper result. So my question is why when running this in the command line do I get the proper result but when running the code I do not?

    jo**** wrote:
    Hi. The problem is clear in the original post. The OP is trying to use PreparedStatement
    parameters to fill out general portions of the SQL query, instead of only data values.
    He is hoping to put in a column name. That will never work. Only data values are settable.
    HTH,
    Joe WeinsteinActually, no. There's no PreparedStatement there at all. It appears that his problem is that, while the working query entered directly in the client is
    Select * from employee where FirstName = 'anthony'the query he's constructing in his code is
    Select * from employee where FirstName = anthonySince there are no quotes around anthony, it's treated as a column name.
    If he had properly used PreparedStatment as suggested in reply 1, that would not be an issue. My guess, however, is that when he claims he's using PS, it's as Tolls suggested a couple of posts ago--he's simply replacing the Statement with a PreparedStatement, but not using the parameters as suggested.
    The wrong thing for OP to do at this point is see my above comment about the quotes and explicitly add them in the query string. The right thing to do, of course, is to actually use PS's parameters.
    Edited by: jverd on Oct 11, 2010 10:08 AM

  • ADF BC - How to get validation picked up from the database.

    Is there a way the ADF BC can be created so it contains the check constraints from the database?
    I assume if it did, it would pre-fill the "validation" branch in the Entity Object Editor.

    Frank,
    Thank you very much for your reply. I've set "valuePassThrough" property of the dropdownlist to true. In the valueChangeListener, my code looks like this.
    public void TD_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    System.out.println("+++++++++");
    System.out.println("TD_valueChangeListener");
    Number n = null;
    BindingContainer bc = this.getBindings();
    if(bc != null){
    System.out.println("bc is not null");
    //get the selected TD
    FacesCtrlListBinding TdIter = (FacesCtrlListBinding)bc.get("LandLegalView1Td");
    if(TdIter != null){ 
    System.out.println("TdIter is not null");
    if(valueChangeEvent.getNewValue() != null)
    try{n = new Number(valueChangeEvent.getNewValue());}
    catch(Exception e){
    e.getMessage();
    System.out.println("selected TD index="+n);
    //Object td = TdIter.getAttributeFromRow(n.intValue(), "Td");
    Object td = TdIter.getAttribute(n.intValue());
    System.out.println("real value of td=" + td);
    }else{
    System.out.println("TD is null");
    }else{
    System.out.println("TdIter is null");
    My question here is: I tried two ways of getting the real value of the new selected value. One is "Object td = TdIter.getAttributeFromRow(n.intValue(), "Td");". The other is "Object td = TdIter.getAttribute(n.intValue());". None of them give me the new selected value but the old value. Did I do anything wrong?
    Regards,
    Annie

Maybe you are looking for

  • Hide Column in Cross Tab

    Hi, depending on my previous thread (RTF Cross Table like Analyzer I tried now to hide one if the columns, when the total of is is 0. I used the <if@cell:sum (current-group()/SUM_X.MYVALUE)>0?> ... and <if@column:sum (current-group()/SUM_X.MYVALUE)>0

  • Problems with repainting in new JD 9.0.4.0

    I just installed new JD 9.0.4.0 . I think that from this moment I have problems with painting java graphics objects (for example Application Module tests or simple login dialogs). When I move that window, its remains are left on the screen until I ov

  • No Device backup in iTunes 10

    I have iTunes 10 synced with my iPad and iPodT but there is no device backup in the iTunes Preferences Devices window. How do I get it to do a backup of my devices so in an emergency I may restore from backup?

  • LDAP Report Generation

    Hi, I am currently using Perl Module "use Net::LDAP" to generate LDAP Reports in csv Format. However, I am confronted with two issues : 1) Users are inserting extra quotes in the field which makes csv file non-conform with RFC 4180. *" RFC 4180 state

  • Need some help in QR Code generation process

    Hi All, Actually I placed this query before. But I have not got usefull messages. But When I go through the below link I got hopes that I can crack this QR Code requirment but https://www.sounderp.com/index.php/howto/38-faq/53-2dmatrixbarcodes I need