Java Swing-how do I get the value of a JTable to display dynamically in a JPanel

I need the sum of the values from the values entered in the JTable to be included in the text of the partition field in the adjoining JPanel.
Also posted here - http://www.coderanch.com/t/512189/GUI/java/value-JTable-show-up-dynamically.
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
import javax.swing.table.DefaultTableCellRenderer;

import java.awt.*;
import java.util.*;
import java.awt.color.*;
import java.awt.event.*;

public class TableandPanel extends JFrame
{
     public static void main(String[] args)
     {
          JFrame frame = new JFrame("Table and Panel");
                                       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                                       frame.setSize(100, 300);
        
                                        frame.setVisible(true);
              String colHdrA = "Some Values";                    
              TableofSums tableofSums = new TableofSums(10, colHdrA);
              int sumValue = tableofSums.getSumValues();
              String sumValueS = String.valueOf(sumValue);
              SumValuesPanel newPanel = new SumValuesPanel( "Score", sumValueS, "Rank");
              JPanel thePanel = new JPanel();
              thePanel.add(new JScrollPane(tableofSums));
              thePanel.add(newPanel);
              frame.add(thePanel);
              frame.pack();
          frame.setVisible(true);
     }
}

//---------table class starts here---------------------------

public class TableofSums extends JPanel implements TableModelListener
{
    public static void main(String[] args)
     {          
         SwingUtilities.invokeLater(new Runnable() 
            {
                public void run() 
                  {               
         JFrame frame = new JFrame("Table");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setSize(208, 230);
         //frame.add(new JScrollPane(table));
            frame.setVisible(true);
            String colHdrA = "Some Values";                    
            TableofSums tableofSums = new TableofSums(10, colHdrA);
             frame.setContentPane(tableofSums);
              //frame.add(new JScrollPane(timerepTable));
           frame.pack();
           frame.setVisible(true);
                   
               }
            });
     }
     
     private int noOfRows = 0;
     private JTable table;
     private String colName = null;
     private int sumValues = 0;
     
     public TableofSums(int noOfRows, String colName)
     {
          this.noOfRows = noOfRows;
          this.colName = colName;
          makeTable();          
     }
     
     private void makeTable()
     {
          Object columns[] = new Object[] {"<html><center>" + this.colName + "</center></html>"};
          
         Object[][] data = new Object[noOfRows][1];
         
         for (int i = 0; i<noOfRows; i++)
            {                
                data[0] = new Integer(0);          
     }
     DefaultTableModel model = new DefaultTableModel(data, columns);
     model.addTableModelListener(this);
     table = new JTable(model)
     {
     @Override
     public boolean isCellEditable(int row, int column)
     {
     switch (column)
     {
          case 0: return true;
     }
     return false;
     }
     
     @Override
     public Class<?> getColumnClass(int columnIndex)
     {
     switch (columnIndex)
     {
     case 0: return Integer.class;
     }
     return null;
     }
     };
     table.setRowHeight(25);
     table.setDefaultRenderer(Integer.class, new SomeCellRenderer());
     this.add(new JScrollPane(table));
     }

///--------------------------------tablemodellistener---------------------------------
//gets the values entered in the table and calculates the sum
//-------------------------------------------------------------------------------------------
     public void tableChanged(TableModelEvent e)
{
     System.out.println(e.getSource());
     if(e.getType() == TableModelEvent.UPDATE)
     {
          int row = e.getFirstRow();
          int column = e.getColumn();
          TableModel model = table.getModel();
          sumValues = 0;
          for (int i=0; i<noOfRows; i++)
          {
               int intValue = (Integer)model.getValueAt(i, column);
               sumValues += intValue;
          }
          System.out.println ("row modified: " + row + " sumValues: " + sumValues);
     }
     
}
//--------------------------------------cell renderer------------------------------------------------------
     
     public class SomeCellRenderer extends JLabel implements TableCellRenderer
     {
          
     public SomeCellRenderer()
     {
          setOpaque(true);      
     }

     public Component getTableCellRendererComponent(JTable table, Object
               value, boolean isSelected, boolean hasFocus, int row, int column)
          {
          String cellValue = String.valueOf(value);
          this.setText(cellValue);
          this.setBackground(Color.LIGHT_GRAY);
          this.setHorizontalAlignment(SwingConstants.CENTER);
     return this;
          }
     }
     public int getSumValues()
     {
          return sumValues;
     }
}


//-------------------------Panel Class Starts here-------------------------------------

public class SumValuesPanel extends JPanel
{
     /**
     * @param args
     */
     public static void main(String[] args)
     {
          JFrame.setDefaultLookAndFeelDecorated(true);
          JFrame frame = new JFrame("SumValuesPanel");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          SumValuesPanel newContentPane = new SumValuesPanel( "Score", "XX.XX", "Rank");
          
          frame.setContentPane(newContentPane);
          frame.pack();
          frame.setVisible(true);
     }
     
//------Variables declaration
private JPanel thePanel;
private JLabel scorejLabel;
private JTextField ScorejTextField;
private String scoreLabel;
private String scoreValue;
private JLabel rankLabel;
private String rankLabelTxt;
private JTextField rankTextField;
private String rankText;
//-------End of variables declaration

public SumValuesPanel (String setScoreLabel,String setScoreVal, String rankLabel)
{
     scoreLabel = setScoreLabel;
     scoreValue = setScoreVal;
     this.rankLabelTxt = rankLabel;
          
     createSumValuesPanel();
}

private void createSumValuesPanel()
{         
thePanel = new JPanel();

rankLabel = new JLabel();
rankTextField = new JTextField();
     scorejLabel = new JLabel();
ScorejTextField = new JTextField();

thePanel.setBackground(new Color(235, 233, 230));
thePanel.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
thePanel.setPreferredSize(new Dimension(200, 180));

scorejLabel.setHorizontalAlignment(SwingConstants.CENTER);
scorejLabel.setText(scoreLabel);
scorejLabel.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
scorejLabel.setPreferredSize(new Dimension(40, 20));

ScorejTextField.setEditable(false);
ScorejTextField.setHorizontalAlignment(JTextField.CENTER);
ScorejTextField.setText(scoreValue);
ScorejTextField.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
ScorejTextField.setMaximumSize(new Dimension(60, 25));
ScorejTextField.setMinimumSize(new Dimension(35, 15));
ScorejTextField.setPreferredSize(new Dimension(55, 20));

rankLabel.setHorizontalAlignment(SwingConstants.CENTER);
rankLabel.setText(rankLabelTxt);
rankLabel.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
rankLabel.setPreferredSize(new Dimension(90, 20));

rankTextField.setEditable(false);
rankTextField.setBackground(new Color(255,255,0));
rankTextField.setHorizontalAlignment(JTextField.CENTER);
rankTextField.setText(rankText);
rankTextField.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
rankTextField.setPreferredSize(new Dimension(55, 20));

thePanel.add(scorejLabel);
thePanel.add(ScorejTextField);
thePanel.add(rankLabel);
thePanel.add(rankTextField);

this.add(thePanel);
}

}
Edited by: 799076 on Oct 1, 2010 8:50 AM

Edited by: 799076 on Oct 2, 2010 3:59 AM - added the code tags.

Edited by: 799076 on Oct 2, 2010 4:01 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

OK, here's my "simple" example Say you have a class, TablePanel, that extends from JPanel that holds a JTable and this table contains two columns of integers in a DefaultTableModel and you want to get and display the sum of the columns of numbers whenever they are changed:

class TablePanel extends JPanel {
   public static final String[] COL_HEADERS = {"A", "B"};
   private static final Integer[][] DATA = {{1, 2}, {3, 4}, {5, 6}};
   private DefaultTableModel model = new DefaultTableModel(DATA, COL_HEADERS) {
      @Override
      public Class getColumnClass(int columnIndex) {
         return Integer.class;
      }
   };

   public TablePanel() {
      JTable table = new JTable(model);
      setLayout(new BorderLayout());
      add(new JScrollPane(table));
   }
//....

A way to listen for changes to the table is to provide a method that allows outside classes to add a TableModelListener your JTable model:

   public void addTableModelListener(TableModelListener listener) {
      model.addTableModelListener(listener);
   }

You could also give him public methods to enable this class get the money and return:

   public int getSumA() {
      int sum = 0;
      for (int i = 0; i < model.getRowCount(); i++) {
         sum += (Integer) model.getValueAt(i, 0);
      }
      return sum;
   }

   public int getSumB() {
      int sum = 0;
      for (int i = 0; i < model.getRowCount(); i++) {
         sum += (Integer) model.getValueAt(i, 1);
      }
      return sum;
   }
}

While you have another class, SumPanel, that displays two JLabels, one to hold the sum of column A and one for the sum of column B:

class SumPanel extends JPanel {
   private JLabel sumA = new JLabel(" ", SwingConstants.RIGHT);
   private JLabel sumB = new JLabel(" ", SwingConstants.RIGHT);

   public SumPanel() {
      setLayout(new GridLayout(1, 0));
      add(sumA);
      add(sumB);

      //....
   }
   //.....

You'd give public methods to allow outside classes to set the text for the JLabels that class:

   public void setTextSumA(String text) {
      sumA.setText(text);
   }

   public void setTextSumB(String text) {
      sumB.setText(text);
   }

Then, you might have your own class TableModelListener, ModelListener, which has references to both of the above classes:

class ModelListener implements TableModelListener {
   private TablePanel tablePanel;
   private SumPanel sumPanel;

   public ModelListener(TablePanel tablePanel, SumPanel sumPanel) {
      this.tablePanel = tablePanel;
      this.sumPanel = sumPanel;

      //...
   }
//....

who will set the SumPanel labels whenever its tableChanged method is called by the model:

   @Override
   public void tableChanged(TableModelEvent e) {
      int sumA = tablePanel.getSumA();
      int sumB = tablePanel.getSumB();

      sumPanel.setTextSumA(String.valueOf(sumA));
      sumPanel.setTextSumB(String.valueOf(sumB));
   }

}

Then you can link everything together in your main graphical interface as follows:

      TablePanel tablePanel = new TablePanel();
      SumPanel sumPanel = new SumPanel();
      ModelListener myModelListener = new ModelListener(tablePanel, sumPanel);
      tablePanel.addTableModelListener(myModelListener);

All assembled, it could look as follows:

import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.DefaultTableModel;

public class TableAndPanel2 {

   private static void createAndShowUI() {
      TablePanel tablePanel = new TablePanel();
      SumPanel sumPanel = new SumPanel();
      ModelListener myModelListener = new ModelListener(tablePanel, sumPanel);
      tablePanel.addTableModelListener(myModelListener);

      JFrame frame = new JFrame("Table And Panel 2");
      frame.getContentPane().add(tablePanel, BorderLayout.CENTER);
      frame.getContentPane().add(sumPanel, BorderLayout.PAGE_END);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.pack();
      frame.setLocationRelativeTo(null);
      frame.setVisible(true);
   }

   public static void main(String[] args) {
      java.awt.EventQueue.invokeLater(new Runnable() {
         public void run() {
            createAndShowUI();
         }
      });
   }
}

class TablePanel extends JPanel {
   public static final String[] COL_HEADERS = {"A", "B"};
   private static final Integer[][] DATA = {{1, 2}, {3, 4}, {5, 6}};
   private DefaultTableModel model = new DefaultTableModel(DATA, COL_HEADERS) {
      @Override
      public Class getColumnClass(int columnIndex) {
         return Integer.class;
      }
   };

   public TablePanel() {
      JTable table = new JTable(model);
      setLayout(new BorderLayout());
      add(new JScrollPane(table));
   }

   public void addTableModelListener(TableModelListener listener) {
      model.addTableModelListener(listener);
   }

   public int getSumA() {
      int sum = 0;
      for (int i = 0; i < model.getRowCount(); i++) {
         sum += (Integer) model.getValueAt(i, 0);
      }

      return sum;
   }

   public int getSumB() {
      int sum = 0;
      for (int i = 0; i < model.getRowCount(); i++) {
         sum += (Integer) model.getValueAt(i, 1);
      }

      return sum;
   }

}

class SumPanel extends JPanel {
   private JLabel sumA = new JLabel(" ", SwingConstants.RIGHT);
   private JLabel sumB = new JLabel(" ", SwingConstants.RIGHT);

   public SumPanel() {
      setLayout(new GridLayout(1, 0));
      add(sumA);
      add(sumB);

      sumA.setBorder(BorderFactory.createLineBorder(Color.black));
      sumB.setBorder(BorderFactory.createLineBorder(Color.black));
   }

   public void setTextSumA(String text) {
      sumA.setText(text);
   }

   public void setTextSumB(String text) {
      sumB.setText(text);
   }
}

class ModelListener implements TableModelListener {
   private TablePanel tablePanel;
   private SumPanel sumPanel;

   public ModelListener(TablePanel tablePanel, SumPanel sumPanel) {
      this.tablePanel = tablePanel;
      this.sumPanel = sumPanel;

      tableChanged(null);
   }

   @Override
   public void tableChanged(TableModelEvent e) {
      int sumA = tablePanel.getSumA();
      int sumB = tablePanel.getSumB();

      sumPanel.setTextSumA(String.valueOf(sumA));
      sumPanel.setTextSumB(String.valueOf(sumB));
   }

}

Tags: Java

Similar Questions

  • ICF custom connector; How can I get the values of the parameters of the recon calendar task?

    I'm trying to create a custom connector icf with progressive reconciliation. My recon schedule a task, I have the settings "attribute of Date additional Recon ' and 'last token" that should be used for gradual reconciliation.

    How can I get the values of the parameters ' attribute of Date additional Recon ' and 'last token "?

    ICF should handle this for you.

    The value of "attribute of Date additional Recon ' must be filled in the OperationOption (e.g. executeQuery() and PROCESSES of FilterTranslator has this as a method parameter).

    For the "last counter", you need to implement ' createGreaterThanExpression (GreaterThanFilter, filter, is not Boolean) ' in your filter translator class. You can get the attribute of the filter object. Look for a description here: http://docs.oracle.com/cd/E37472_01/apirefs.1112/e28159/oracle/iam/connectors/icfcommon/recon/SearchReconTask.html

  • How can I get the value of the element checked a box to tick LOV?

    Hi all

    I need to insert rows into a table when a checkbox element is checked.
    The checkbox element is a LOV in a form.
    -----------------------
    Select the DESCRIPCIÓN display_value, ID_DOCUMENTO return_value
    of DOCUMENT
    order by 1
    ------------------------------

    Source
    ------------------------------
    DECLARE
    CURSOR C_REG_DOC IS SELECT ID_DOCUMENTO FROM REGISTRO_DOCUMENTO WHERE ID_REGISTRO =: P6_ID_REGISTRO;
    v_id_documento documento.id_documento%TYPE;
    v_results VARCHAR2 (50);
    Boolean v_first_loop: = true;
    BEGIN
    for this loop C_REG_DOC
    If v_first_loop then
    v_results: = it.ID_DOCUMENTO;
    v_first_loop: = false;
    on the other
    v_results: = v_results |': ' | it.ID_DOCUMENTO;
    end if;
    end loop;
    Return v_results;
    END;
    --------------------------

    I need to create a process to insert rows in a relational table, but I do not know how...
    ------------------
    FOR *? *
    LOOP
    INSERT INTO registro_documento (id_reg_documento, id_registro, id_documento)
    VALUES(null,:P4_ID_REGISTRO,???);
    END LOOP;
    ---------------

    How can I get the value of the active element (id_documento) to insert it?

    Thank you!

    Alex

    Hello:

    You can use the apex_util.string_to_table function to retrieve the values of the LOV as shown in the example

    declare
    arr wwv_flow_global.vc_arr2;
    begin
    arr:= apex_util.string_to_table(:P_CHECKBOX_LOV_ITEM)
    for x in arr.first..arr.last loop
    // insert statement
    iNSERT INTO registro_documento( arr(i) ,.........id_reg_documento,id_registro,id_documento)
    end loop;
    end;
    

    CITY

  • How can I get the 'secure site' (padlock) icon to display when you access a web page secured with Firefox 4?

    The "secure" (lock) icon no longer appears on the status bar (or anywhere else I can find) when you go to a secure web page. How can I get the 'secure site' (padlock) icon to display when you access a web page secured with Firefox 4?

    You can add a 'lock' the b-I-S with this extension.

    https://addons.Mozilla.org/en-us/Firefox/addon/padlock-icon/

  • Hi, I have a PDF form that has multiple check boxes. Some boxes have values (off, yes) that others have just (Yes). How can I get the value of "Off" to all of the other boxes as well. Any help is greatly appreciated.

    Hi, I have a PDF form that has multiple check boxes. Some boxes have values (off, yes) that others have just (Yes). How can I get the 'Off' the value assigned to all the other boxes as well. Any help is greatly appreciated.

    'Off' is the default value of any box when it is not checked. It can not

    be changed.

  • How can I get the value of the element with the namespace?

    I tried to get an element of value in xml a namespace, but I can't.
    I removed the namespace, I get a value of the element.

    How can I get a value of the element with the namespace?

    -1. Error ----------- xml ------------------------------
    <? XML version = "1.0" encoding = "UTF-8"? >

    * < TaxInvoice xmlns = "" urn: kr: or: kec:standard:Tax:ReusableAggregateBusinessInformation:1:0 "xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"xsi: schemaLocation =" urn: kr: or: kec:standard:Tax:ReusableAggregateBusinessInformation:1:0 http://www.kec.or.kr/standard/Tax/TaxInvoiceSchemaModule_1.0.xsd "> *"
    < ExchangedDocument >
    < IssueDateTime > 20110810133213 < / IssueDateTime >
    < ReferencedDocument >
    < ID > 318701 - 0002 / < ID >
    < / ReferencedDocument >
    < / ExchangedDocument >
    < TaxInvoiceDocument >
    < IssueID > 201106294100 < / IssueID >
    < > 0101 TypeCode < / TypeCode >
    < IssueDateTime > 20110810 < / IssueDateTime >
    < PurposeCode > 02 < / PurposeCode >
    < / TaxInvoiceDocument >
    < TaxInvoiceTradeLineItem >
    < SequenceNumeric > 1 < / SequenceNumeric >
    < > 200000000 InvoiceAmount < / InvoiceAmount >
    < TotalTax >
    < CalculatedAmount > 20000000 < / CalculatedAmount >
    < / TotalTax >
    < / TaxInvoiceTradeLineItem >
    < / TaxInvoice >


    -2. success - xml - remove namespace.
    <? XML version = "1.0" encoding = "UTF-8"? >
    < TaxInvoice >
    < ExchangedDocument >
    < IssueDateTime > 20110810133213 < / IssueDateTime >
    < ReferencedDocument >
    < ID > 318701 - 0002 / < ID >
    < / ReferencedDocument >
    < / ExchangedDocument >
    < TaxInvoiceDocument >
    < IssueID > 201106294100 < / IssueID >
    < > 0101 TypeCode < / TypeCode >
    < IssueDateTime > 20110810 < / IssueDateTime >
    < PurposeCode > 02 < / PurposeCode >
    < / TaxInvoiceDocument >
    < TaxInvoiceTradeLineItem >
    < SequenceNumeric > 1 < / SequenceNumeric >
    < > 200000000 InvoiceAmount < / InvoiceAmount >
    < TotalTax >
    < CalculatedAmount > 20000000 < / CalculatedAmount >
    < / TotalTax >
    < / TaxInvoiceTradeLineItem >
    < / TaxInvoice >




    -program-
    procedure insert_table
    (
    l_clob clob,
    OK, Boolean.
    Error out varchar2
    )
    is
    l_parser dbms_xmlparser. Analyzer;
    xmlDoc xmldom.domdocument;

    l_doc dbms_xmldom. DOMDocument;
    l_nl dbms_xmldom. DOMNodeList;
    l_n dbms_xmldom. DOMNode;
    l_root DBMS_XMLDOM.domelement;
    l_node DBMS_XMLDOM.domnode;
    l_node2 DBMS_XMLDOM.domnode;
    l_text DBMS_XMLDOM. DOMTEXT;

    buf VARCHAR2 (30000);

    XMLParseError exception;

    TYPE tab_type is Table of xml_upload % ROWTYPE;
    t_tab tab_type: = tab_type();
    pragma exception_init (xmlparseerror,-20100);
    l_node_name varchar2 (300);

    Start
    l_parser: = dbms_xmlparser.newParser;
    l_doc: = DBMS_XMLDOM.newdomdocument;
    dbms_xmlparser.parseClob (l_parser, l_clob);
    l_doc: = dbms_xmlparser.getDocument (l_parser);
    l_n: = dbms_xmldom.makeNode (l_doc);

    l_nl: = dbms_xslprocessor.selectNodes (l_n, ' / TaxInvoice/TaxInvoiceDocument ');

    FOR cur_tax in 0.dbms_xmldom.getLength (l_nl) - 1 LOOP
    l_n: = dbms_xmldom.item (l_nl, cur_tax);

    t_tab.extend;

    t_tab (t_tab.last) .ed_id: = '5000000';

    dbms_xslprocessor.valueOf (l_n, ' IssueID / text () ', t_tab (t_tab.last) .tid_issue_id);
    dbms_xslprocessor.valueOf (l_n, ' TypeCode / text () ', t_tab (t_tab.last) .tid_type_code);

    END LOOP;

    FORALL i IN t_tab.first... t_tab. Last
    INSERT INTO xml_upload VALUES t_tab (i);

    COMMIT;

    dbms_xmldom.freeDocument (l_doc);
    correct: = true;

    exception
    When xmlparseerror then
    -xmlparser.freeparser (l_parser);
    correct: = false;
    error: = sqlerrm;

    end insert_table;
    l_nl := dbms_xslprocessor.selectNodes(l_n, '/TaxInvoice/TaxInvoiceDocument');
    

    try to change as follows

    l_nl := dbms_xslprocessor.selectnodes(l_n,'/TaxInvoice/TaxInvoiceDocument','xmlns="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0"');
    

    Published by: Alexandr on August 17, 2011 12:36 AM

  • How can I get the sum of my variables and display the total?

    I wrote on a quiz and have each button by setting a variable, example: http://www.kreativitydesigns.com/Clients/Globus/Monograms/MBA_Test/deliverables/MBA_Quiz.h tml? mode = preview

    However, when it hits the frame of "Rank" to calculate and display the total, it does not appear.

    I do not have the text box named "Grade" on stage and variables have all received a value before entering this framework

    Here is the code used to calcualte and output the result:

    get the value of a variable and store

    var FinalScoreHolder is q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10 + q11 + q12 + q13 + q14 + q15 + q16 + q17 + q18 + q19 + q20 + q21 + q22 + q23 + q24 + q25 + q26 + q27 + q28 + q29 + q30 + q31 + q32 + q33 + q34 + q35 + q36 + q37 + q38 + q40 + q39;.

    View rank

    SYM. $("Grade") .html ("you scored" + FinalScoreHolder + "%");

    See the result Page

    If (FinalScoreHolder > = 89) {}

    read the chronology of the given position (ms or label)

    SYM. Play ("Pass");

    } else {}

    read the chronology of the given position (ms or label)

    SYM. Play ("fail");

    }

    Any help would be greatly appreciated.

    Thank you!

    Your code is fine, but it seems that he can not do the values of your questions because if you put the values as below I get the expected result.

    Q1 = 20;

    Q2 = 63;

    Q3 = 12;

    get the value of a variable and store

    var FinalScoreHolder = q1 + q2 + q3;

    View rank

    SYM. $("grade") .html ("you scored" + FinalScoreHolder + "%");

    See the result Page

    If (FinalScoreHolder > = 89) {}

    read the chronology of the given position (ms or label)

    SYM. Play ("Pass");

    } else {}

    read the chronology of the given position (ms or label)

    SYM. Play ("fail");

    }

  • Starting from two data tables, how do you get the values in two columns using values in a column (values get col. If col. A is not null values and get the pass. B if col. A is null)?

    Two tables provided, how you retrieve the values in two columns using values in a column (the pass get values. If col. A is not null values and get the pass. B if col. A is null)?

    Guessing

    Select nvl (x.col_a, y.col_b) the_column

    from table_1 x,.

    table_2 y

    where x.pk = y.pk

    Concerning

    Etbin

  • How can I get the value of a comboBox element in a grid?

    Hi all

    I have a DataGrid with some comboBoxes in two of its columns.

    What I need to do, is get these boxes of bombo values when a user highlights the line of the grid NOT when user use the comboBox control. I understand how to extract the values once the change handler is called on the drop-down list, but I don't see a way to get to the comboBoxes that belong to the gridRow highlighted.

    I'm sure it's really simple, but I'm not able to find a reference on how it's done. Any help much appreciated.

    Copy the following code shows how you can do it if you know the dataProvider for ComboBox data fields.

    If this post has answered your question or helped, please mark it as such.


    http://www.Adobe.com/2006/mxml '.
    Initialize = "initData ()" > "
      
       Import mx.events.ListEvent;
    Import mx.collections. *;
    private var DGArray:Array =]
    {Artist: 'Pavement', Album: 'Slanted and Enchanted' price: 11.99, combo1: [1,2,3], combo2: [100,200,300]},
    [{Artist: 'Pavement', Album: 'Brighten the corners', price: 11.99, combo1: [2,4,6] combo2: [200,400,600]}] ;
            
    [Bindable] public var initDG:ArrayCollection;
    public function initData (): void {}
    initDG = new ArrayCollection (DGArray);
    }
         
    private void dgChangeHandler(event:ListEvent):void {}
    var ac:ArrayCollection = event.currentTarget.dataProvider;
    txt. Text = "";
    txt. Text += ac.getItemAt (event.rowIndex) .combo1 + "\n";
    txt. Text += ac.getItemAt (event.rowIndex) .combo2;
    }
    ]]>
      


    dataProvider = "{initDG}" change = "dgChangeHandler (event); » >
         
            
            
            
            
             
              
               
                
               

              

             

            

            
             
              
               
                
               

              

             

            

         

      
      

  • How can I get the value of the attribute LogFileSize of C application

    Hi all!
    Now I have implemented monitoring of enforcement. I want to calculate the diff between the replication LSN and current LSN. For this calculation, I need to know LogFileSize attribute of sys.odbc.ini. How can I get a real value inside the C application? Now I analyze output form of connection string SQLDriverConnect, but this not very good method.

    Discover the "ttConfiguration", built in the procedure described in the reference Guide TimesTen. This should give you what you want.

    Chris

  • How can I get the value of list of multiple selection in javascript?

    Hello

    If I want to show the list of colon delimited in an alert box JS what I'd do?
    or if not, how do you show it?

    There are several SelectedIndexes?

    Type = select-multiple

    Bill

    Bill,

    Watch more closely the example I've provided earlierly:

    http://Apex.Oracle.com/pls/OTN/f?p=31517:166

    I use this code:

    for (i = 0; i < $x (pShuttle2) .length; i ++)
    {
    If (p_array == ")
    {
    p_array is $x (pShuttle2).value;.
    }
    on the other
    {
    p_array = p_array + ":" + $x (pShuttle2) [i] .value;
    }
    }

    Get.Add ('SHUTTLE_ITEM_VALUE', p_array);

    to concatenate the values in the table in a colon delimited string by some. It is later used to define the session state of the element of the shuttle to this value.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • After passing parameter to other forms, how do you get the value?

    Hello

    I had created a parameter and Federal Archives. I added the record group in the Data_Parameter parameter and use the Call_Form to open another form and pass it
    pd_id with her.

    Some code this that look like this

    DECLARE
    pl_id ParamList;
    pl_name VARCHAR2 (10): = "Bank_Param";
    rg_name VARCHAR2 (40): = "Bank_RecGrp";
    RG_ID RecordGroup;
    ERRCODE NUMBER;
    BEGIN
    pl_id: = Get_Parameter_List (pl_name);
    IF Id_Null (pl_id) THEN
    pl_id: = Create_Parameter_List (pl_name);

    RG_ID: = Find_Group (rg_name);
    IF Id_Null (rg_id) THEN
    RG_ID: = Create_Group_From_Query (rg_name,
    "SELECT CODE, BANK CODE".
    ||' ORDER BY 1');
    END IF;
    Errcode: = Populate_Group (rg_id);
    Add_Parameter (pl_id, 'bank_query', DATA_PARAMETER, rg_name);

    CALL_FORM (BankForm, Hide, no_replace, no_query_only, pl_id);
    ON THE OTHER
    Message ("list of parameters ' |") pl_name | "exist already!");
    RAISE Form_Trigger_Failure;
    END IF;
    END;

    I want to get the parameter after the other open form and using the record group insert in one of the combobox that is in one of the Databock.

    When_New_Form_Instance trigger level both on the form

    DECLARE
    pl_id ParamList;
    pl_name VARCHAR2 (10): = "Bank_Param";
    list_id Item: = Find_Item("Block_Name.Item_Name');
    BEGIN
    pl_id: = Get_Parameter_List (pl_name);
    IF (pl_id) Id_Null is FALSE
    POPULATE_LIST (list_id, pl_id);
    END IF;
    END;

    I don't know is this correct?

    Thank you if someone could help me with that.

    Joel

    Andreas,
    You can actually spend a DATA_PARAMETER, but in all honesty, I've never used I always comes to pass a text parameter. There are examples in the forms help (which I believe is where the OP got their original code) show that passing a DATA_PARAMETER, but I could not find any examples of how to work with the DATA_PARAMETER in the form of receiver.

    Craig...

  • How can I get the bookmarks toolbar is does not display to the default startup of Firefox?

    When I launch FireFox 6.0.2 it comes by default with the bookmarks on the left side menu. I don't want a default; I just want if I ask you. How can I get rid of these wastes screen space?

    This happens on a computer desktop with Vista and a laptop with XP, so it is not apparently sensitive BONES.

    You can click the close X on the Bookmarks Sidebar Panel or press Ctrl + B to toggle off bookmarks bar.

    See also view > sidebar > bookmarks

    Press F10, or press the Alt key to bring up the 'Menu Bar' temporarily if the menu bar is hidden.

  • How can I get the html source code of beeing displayed page?

    In the previous version of Firefox (4) the view menu contained option 'page source '. In the current version (6) this option disapired.

    Oops! I have it! Been moved from Tools/Web Developer / Source Page.

    See you soon,.

    Peterat

  • How can I get the list of recorded TV to display in columns?

    Windows Media Center displays TV recorded in columns on one of my PC and in a long horizontal flow on another PC. Both are Windows Vista.

    I finally found my own answer. In landscape view, right-click on the screen and choose "View List".

Maybe you are looking for

  • Cascade and its effect on DynDNS?

    OK, so for several months, I had a NSLU2 in a DMZ if I could get there by DynDNS and it was functioning 100%. I added a cascaded router and other NSLU2 downstairs to develop capabilities and features of my network home. I moved the "public" folder on

  • Issue updates

    I just reloaded Vista on laptop Gateway ML3109 of my daughter and maybe downloaded 300 updated to Microsoft Update.  Now it seems that my hard drive is completely overwhelmed by the updates of the available 70gigs, 65gigs are in use.  She may have 6g

  • HP ProBook 4530 s: igdpmd64.sys BSOD on HP ProBook 4530 s Windows 7 64 bit

    I used my HP ProBook 4530 s with 64-bit Windows 7 and Internet Explorer 8 (IE8) installed for 2011 with no problems.Recently I upgraded Windows SP1 and IE10. Everything works well except one thing.When I run IE10, open a few tabs and hoover my mouse

  • adobe says control user account is blocked - how unlock? I am administrator

    I want to reinstall adobe but he returns constantly as blocked. said that my administrator has blocked.  This is my lap top.  How to unlock?

  • Direct printing on a cellar wireless

    I have a new printer of e hp3522. I've set up and everything works great. My question, which may seem stupid. I use my verizon jetpack data allowance when I print wireless from my ipad with the option to print direct print /air? My iPad, maris hp3522