Coinciding columns on multiple rows with GridBadLayout

I was trying to figure out why I could not initially accomplish the following with a GridBagLayout:
Row0: 0000011111
Row1:      1111122222
Row2:           2222233333 The above is supposed to be 3 JLabels on three different rows:
The 1st row has a single JLabel starting in column 0 with a width of 2, extending it to column 1.
The 2nd row has a single JLabel starting in column 1 with a width of 2, extending it to column 2.
The 3rd row has a single JLabel starting in column 2 with a width of 2, extending it to column 3.
The entire grid is 4 columns and 3 rows total.
Below I have two examples where I attempted the above. Only the 2nd example produces the desired effect. The 1st code example ends up putting both the Row 0 and Row 1 JLabel in the same column. This was surprising because I thought the GridBagLayout would give each column contained by a control enough weight to actually make those columns exist.
Here is what my first code example below produces:
Row0: 0000011111
Row1: 1111122222
Row2:           2222233333 The first two JLabels, 0000011111 and 1111122222, appear in the same column, and the 3rd JLabel appears in the seemingly 2nd column. This was confusing to me which is the point of this whole post.
In order to gain the desired effect, I had to place 4 blank dummy empty JLabel components in a non-visible Row 0 of the grid. I did this for all 4 columns of that invisible row 0. The row is non-visible because the JLabel have no text or output. After adding this non-visible Row 0, all of the original mentioned Rows 0 through 2 become Rows 1 through 2 respectively.
For example:
Row0: iiiiiIIIIIiiiiiIIIII
Row1: 0000011111
Row2:      1111122222
Row3:           2222233333 The above shows an inserted Row 0 with invisible labels that are not seen, but they seem to give weight to each column, allowing each to exist. Without doing this, as mentioned, the first code example (shown below) fails. The second example (also below) works, so it appears that putting the invisible controls into the first row, one in each column, somehow gives enough weight to each column to "establish" the column more so than otherwise.
The big question I have is why didn't the first example work?
I mean, in that example, I'm giving each JLabel equal weight, and each one takes up a width of 2 columns, so why doesn't the JLabel in the second row end up in column 1? Instead, both the original row 0 and row 1 JLabels appear in what looks like column 0, the same column. Does anyone know why this happened?
The invisible control solution is fine but I'm just curious why it wasn't as intuitive as it should have been. The only thing I can come up with is that the weight of the 1st and 2nd JLabel (row 0 and 1) got combined in some fashion which combined them into column 1 which end up looking like column 0 since 0 somehow looses all weight. (???)
****************** THE FOLLOWING DOES NOT PRODUCE THE RIGHT EFFECTS ******************
public class TestCoincidingColumns1 extends javax.swing.JFrame {
    /** Creates new form TestCoincidingColumns1 */
    public TestCoincidingColumns1() {
        initComponents();
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new java.awt.GridBagLayout());
        jLabel1.setText("LabelRow0Col0Wid2");
        jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 255)));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        getContentPane().add(jLabel1, gridBagConstraints);
        jLabel2.setText("LabelRow1Col1Wid2");
        jLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        getContentPane().add(jLabel2, gridBagConstraints);
        jLabel3.setText("LabelRow2Col2Wid2");
        jLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        getContentPane().add(jLabel3, gridBagConstraints);
        pack();
    }// </editor-fold>
    * @param args the command line arguments
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TestCoincidingColumns1().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    // End of variables declaration
****************** THE FOLLOWING WORKS ******************
public class TestCoincidingColumns1WithFix extends javax.swing.JFrame {
    /** Creates new form TestCoincidingColumns1WithFix */
    public TestCoincidingColumns1WithFix() {
        initComponents();
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        DummyRow0Col0 = new javax.swing.JLabel();
        DummyRow0Col1 = new javax.swing.JLabel();
        DummyRow0Col2 = new javax.swing.JLabel();
        DummyRow0Col3 = new javax.swing.JLabel();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new java.awt.GridBagLayout());
        jLabel1.setText("LabelRow0Col0Wid2");
        jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 255)));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        getContentPane().add(jLabel1, gridBagConstraints);
        jLabel2.setText("LabelRow1Col1Wid2");
        jLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        getContentPane().add(jLabel2, gridBagConstraints);
        jLabel3.setText("LabelRow2Col2Wid2");
        jLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        getContentPane().add(jLabel3, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.weightx = 1.0;
        getContentPane().add(DummyRow0Col0, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.weightx = 1.0;
        getContentPane().add(DummyRow0Col1, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.weightx = 1.0;
        getContentPane().add(DummyRow0Col2, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.weightx = 1.0;
        getContentPane().add(DummyRow0Col3, gridBagConstraints);
        pack();
    }// </editor-fold>                        
    * @param args the command line arguments
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TestCoincidingColumns1WithFix().setVisible(true);
    // Variables declaration - do not modify                     
    private javax.swing.JLabel DummyRow0Col0;
    private javax.swing.JLabel DummyRow0Col1;
    private javax.swing.JLabel DummyRow0Col2;
    private javax.swing.JLabel DummyRow0Col3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    // End of variables declaration                   
}

gridwidth=1 will produce something like the following:
Row0: 00000
Row1:      11111
Row2:           22222where each component has its own column which is not the effect I was looking for. The effect is where a component appears halfway, or partway into the middle of the prior row's component's column. See original post for example.
See URL in my prior post for a different thread with a post containing details as to why it's not possible to do what I want to do with GridBagLayout unless I use hidden columns to define each column that I want. When I do that, I can place a component midway into what appears to be the column for the prior row's component.
Thanks for trying though.

Similar Messages

  • Web dynpro screen with multiple rows with columns that can be edited

    Web dynpro screen with multiple rows with columns that can be edited individually:
    Hi
    I am busy creating a screen in web dynpro for ABAP which we would like to make available via Portal ESS (Portal 7).
    I need to add 'n type of table (or almost something like Excel) or something in which someone can type a few paycode numbers (there should be lets say 10 blank rows in which info can be typed in and if I click on a button or so, more rows must be added if necessary.  Then in the other colums stuff like amounts must be entered which one should also be able to edit then and there.
    Can anyone assist in what I can use for this?  There does not seem to be some existing element that I can use.
    Help will be appreciated.
    Regards
    Debbie

    Hi Debbie,
    Whiel Creating table you need to be care full that use chose INPUT FIELD as the CELL EDITOR. Just guessing that if ur table is not editable u might have choosen TextView as default cell editor type.
    check link for details on TABLE UI
    [http://help.sap.com/saphelp_erp2005/helpdata/EN/b5/ac884118aa1709e10000000a155106/frameset.htm]
    easy way is to first add UI ELEMENT TABLE to your VIEW, then right click over it & select create binding from context. After you have a pop up where you can select what columns you want what should be its cell editor etc.
    Greetings
    Prashant

  • Can we create JTable with multiple rows with varying number of columns ?

    Hi All,
    I came across a very typical problem related to JTable. My requirement is that cells should be added dynamically to the JTable. I create a JTable with initial size of 1,7 (row, columns) size. Once the 7 columns are filled with data, a new row should be created. But the requirement is, the new row i.e. second row should have only one cell in it initially. The number of cells should increase dynamically as the data is entered. The table is automatically taking the size of its previous row when new row is added. I tried by using setColumnCount() to change the number of columns to '1' for the second row but the same is getting applied to the first row also.
    So can you please help me out in this regard ? Is it possible to create a JTable of uneven size i.e. multiple rows with varying number of columns in each row ?
    Thanks in Advance.

    Well a JTable is always going to paint the same number of columns for each row. Anything is possible if you want to rewrite the JTable UI to do this, but I wouldn't recommend it. (I certainly don't know how to do it).
    A simpler solution might be to override the isCellEditable(...) method of JTable and prevent editing of column 2 until data in column 1 has been entered etc., etc. You may also want to provide a custom renderer that renderers the empty column differently, maybe with a grey color instead of a white color.

  • Select or deselect multiple rows with one single selection  event

    Does anyone know how to create a JTable which can select or deselect multiple rows with one single selection event in JTable. Fore example, if the table has
    row1
    row2
    row3
    row4
    row5
    row6
    What I need is when user select row1 or row2, both row1 and row2 should be set to be selected. Then if user press CTRL and click one of row3 or row4, both of them should be selected including the previouse selected row1 and row2.
    For deselection, if row1 and row2 are selected, when users deselect one of row1 or row2, both of them should be deselected.
    Hopefully someone can give me a hint.

    Here is a partial solution using a JList. Only one line gets highlighted when the user makes a selection in the list. But, two lines are returned. There is a blank line between every two lines.
         private void addLineToList() {
              String a = f_one.getText();
              String b = f_two.getText();
              if (a.length() == 0) {
                   Utils.showInformationMessage("Item field is empty.");
                   f_one.requestFocusInWindow();
                   return;
              if (b.length() == 0) {
                   Utils.showInformationMessage("Match field is empty.");
                   f_two.requestFocusInWindow();
                   return;
              model.addElement("item: " + a);
              model.addElement("match: " + b);
              model.addElement(" ");
              int size = model.getSize();
              pairList.setSelectedIndex(size - 3);
              f_one.setText("");
              f_two.setText("");
              f_one.requestFocusInWindow();
         private void editList() {
              if (pairList.getSelectedValue().toString().equalsIgnoreCase(" ")) {
                   Toolkit.getDefaultToolkit().beep();
                   f_one.requestFocusInWindow();
                   return;
              if (!f_one.getText().equals("")) {
                   int result = JOptionPane.showConfirmDialog(this,
                   "The Item field contains text. Replace the text?",
                   "Flash Card Activity", JOptionPane.YES_NO_OPTION,
                   OptionPane.INFORMATION_MESSAGE);
                   if (result == JOptionPane.NO_OPTION) return;
              if (!f_two.getText().equals("")) {
                   int result = JOptionPane.showConfirmDialog(this,
                   "The Match field contains text. Replace the text?",
                   "Flash Card Activity", JOptionPane.YES_NO_OPTION,
                   JOptionPane.INFORMATION_MESSAGE);
                   if (result == JOptionPane.NO_OPTION) return;
              String item = "";
              String match = "";
              int index = pairList.getSelectedIndex();
              String choice = model.getElementAt(index).toString();
              if (choice.startsWith("item")) {
                   item = choice;
                   match = model.getElementAt(index + 1).toString();
                   model.remove(index);
                   model.remove(index);
                   model.remove(index);
              else {
                   item = model.getElementAt(index - 1).toString();
                   match = choice;
                   model.remove(index + 1);
                   model.remove(index);
                   model.remove(index - 1);
              int size = model.getSize();
              if (size > 2) {
                   pairList.setSelectedIndex(size - 2);
              f_one.setText(item.substring(6));
              f_two.setText(match.substring(7));
              f_one.requestFocusInWindow();
         }

  • OCI8 OCIBindDynamic failure to callback on random columns over multiple rows

    I am developing a set of bindings to Oracle for Python; see http://www.zope.org/Members/matt/dco2
    When attempting to implement Python's executemany() method of the Python DB API, the code sets up a set of columns which are marked as DATA_AT_EXEC when bound, and a subsequent OCIBindDynamic is issued to set up the input callback.
    This works, and I can have multiple rows retrieved in this fashion, EXECEPT that sometimes, Oracle does NOT call back a column, and will attempt to insert NULL for this column instead. The row/column for which this happens is apparently random, and the incidence of this is timing related (reducing the batch size also helps).
    Has anyone got any idea if this is a legitimate bug in the transport interface? I have trace tables in my bindings which clearly demonstrate that a callback does NOT occur on random columns.

    I've seen this problem with 8.0.5, 8.1.6, 8.1.7 on Linux (I test on 4 different machines, with various distributions), and 8.1.7 on Solaris.
    I am interested in trying to keep things bound DATA_AT_EXEC to keep the code paths simplified, so I'd like to figure it out and fix it.

  • 2.1.0.62: Bug editing text columns in multiple rows using editor-window

    Hello Forum,
    I hope this is not a double post, but I did not come up with the right keywords to search for.
    So here is the bug/strange annoying behavior:
    When I edit multiple rows of a table using the extra edit-window, it shows the text of the previous row I edited and not the text of the actual row.
    Well, sounds quit complicated so I'll give an example:
    Suppose you have a table with two columns and two rows. One column is of type varchar2. Say it contains the values "one" and "two".
    Now I click into the row containing "one", open the extra-edit-window and change the value to "one-1".
    Then I click into the second row and also open the extra-edit-window. The window shows "one-1" instead of "two" as it should.
    This is very annoying because I don't have autocommit activated and when I edit a couple of clob fields, the editor just shows the text of the previous field. I have to say commit for every row in order not to scramble the contents of multiple fields. I have to use the edit-window because the inplace editor is not very useful when editing large texts.
    I observed this bug with varchar2 and clob fields but it may not be restricted to those.
    I run Windows XP and conect to Oracle 10.2.0.4
    Regards,
    dhalek

    Hello -K-,
    setting "Post edits on row change" indeed does prevent this bug, but leads to another problem:
    When I click the rollback-button, the table data is not reverted to its original state. In fact the changes are not commited, but rolling back, does not give the old data back. I can enter "rollback;" into the worksheet and then refresh the table data to show the old values but internally SQL Developer still thinks it has uncommitted changes in the table.
    I, for now, uncheck "Post edits on row change" and use the inplace editor wherever possible. That has some strange cursor bugs (sometimes puts the cursor to the end making it impossible to enter text in the middle of the field) but that does not affect other rows.
    Regards,
    dhalek
    Edited by: dhalek on 30.10.2009 15:08

  • Insert multiple rows with autoincrement id

    I need to insert multiple rows to a table which has an autoincrement PK (unique), e.g:
    Entity:
    public Class Entity{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    Private Long id;
    Facade:
    @PersistenceContext(unitName = "xx-enterprise-ejbPU")
    protected EntityManager em;
    public void create(Entity entity) {
    em.persist(entity);
    Service Class:
    public Class Service implements ServiceLocal{
    @EJB
    private XxxFacadeLocal xxxFacade;
    public void saveEntity(Entity entity){
    xxxFacade.create(entity)
    ManageBean:
    public Class ManageBean
    @EJB
    private ServiceLocal service;
    public void doSave(ActionEvent event)
    service.saveEntity(entity1); //entity.id is set to null, suppose to be generated by DB auto_increment, i.e. insert 3 rows with 3 different ids
    service.saveEntity(entity2);
    service.saveEntity(entity3);
    The result is: Key duplication error on inserting entity2, but entity1 is inserted into DB with id auto increased correctly.
    If I insert only one row each time for test purpose, everything works as expected.
    But what I need is to insert multiple rows. How to do it?
    Thank you in advance.

    Like this (although the @Basic annotation is very much unnecessary). So if it isn't happening you must have made a mistake somewhere. Are you sure the ID column actually has auto_increment?
    Also if you are using Hibernate as the persistence provider and you put it on the classpath, check the packages of the annotations you are using; Hibernate and JPA share some with the same name unfortunately.

  • Need query to convert Single Row Multiple Columns To Multiple rows

    Hi,
    I have a table with single row like below
    Column0 | Column1 | Column2 | Column3 | Column4|
    Value0    | Value1    | Value2    | Value3    |  Value4  |
    Am looking for a query to convert above table data to multiple rows having column name and its value in each row as shown below
    Column0 | Value0
    Column1 | Value1
    Column2 | Value2
    Column3 | Value3
    Column4 | Value4
    Thanks in advance.
    Mohan

    Hi ykMohan,
    Dynamic UNPIVOT can be applied in this case as well.
    CREATE TABLE dbo.T(ID INT,Column0 VARCHAR(99),Column1 VARCHAR(99),Column2 VARCHAR(99),Column3 VARCHAR(99),Column4 VARCHAR(99))
    INSERT INTO T VALUES
    (1,'Value0','Value1','Value2','Value3','Value4'),
    (2,'Value0','Value1','Value2','Value3','Value4');
    DECLARE @columns VARCHAR(MAX)
    SELECT @columns=
    STUFF(
    SELECT ','+ COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='T' AND TABLE_SCHEMA='dbo' AND Column_name NOT IN('ID') FOR XML PATH('')
    ),1,1,'')
    DECLARE @Sql NVARCHAR(MAX)
    SET @Sql =
    'SELECT ID, UPT.col,UPT.val FROM T
    UNPIVOT
    (val FOR col IN('+@columns+')) AS UPT'
    EXEC sp_executeSQL @Sql
    DROP TABLE T
    If you have any feedback on our support, you can click
    here.
    Eric Zhang
    TechNet Community Support

  • Updating Multiple Rows With A Sequence

    I'm trying to update multiple rows of data in one column based on if its date is greater than a certain date. Starting with the lowest date from those dates I'll give it a 2000 and every ascending date from that point will be another number in sequence (2001, 2002, 2003, etc.).
    Apologization Edit:
    11g XE
    Edited by: spysmily1 on Jun 4, 2012 5:50 PM
    Edited by: spysmily1 on Jun 4, 2012 5:51 PM

    I would use a counter and start at a specific number. Then I would try to keep updating with this number and incrementing each time. The part I can't quite grasp is how to use this number with the lowest record and apply this sequence to each date that ascends from there. What I was going to try to come up with is something like:
    DECLARE
    counter := 2000;
    BEGIN
    loop
    update table_name
    set column_name = counter
    where date > specified date;
    counter := counter + 1;
    end loop;
    This is my first thought but I couldn't see a way to just update the first one that is greater than the specified date and then keep cycling through the dates until the last date(most recent). I know I would need a loop but what can I set that loop to so it would know when to stop. I could use a variable I know is less than the total amount that need to be altered.
    Edited by: spysmily1 on Jun 4, 2012 6:21 PM

  • Multiple rows with single date

    I am using a CDC control task to extract and load data from our OLTP source to our Data Warehouse.
    For our Date dimension, we have a DateKey which is a
    DATETIME stamp (created using SSAS dimension wizard). Time is always 00:00:00 as a DATETIME
    value is required for populating the dates.
    Our fact table destination uses this DateKey as a FK.
    Our fact table OLTP data source contains multiple records with a single DATE and TIME field. This fine as I can convert the DATE field to a DATETIME using a derived column.
    However, as our Date dimension has granularity of a day, all we require for our fact table is the most recent daily record from our OLTP data source.
    At present, the data flow task is attempting to write all records and failing on PK constraint.
    How would I go about traversing all records for each date and loading only the most recent for that day? Is there a better way to go about this?

    If you wish to get only one record for today, you can simply use in your source query:
    SELECT TOP 1 ... FROM OLTPdata ORDER BY DEATETIMEcolumn DESC
    if you need one record for each date, you may use ranking functions:
    WITH Q AS (
    SELECT
    ROW_NUMBER() OVER (PARTITION BY CAST(DateTimeColumn AS DATE) ORDER BY DateTimeColumn DESC, some tie breaker column) AS ROWNUM,
    FROM  OLTPData
    SELECT * FROM Q WHERE ROWNUM=1

  • Dynamic gallery with 3 columns and 5 rows with paging

    guyz, i am new to spry and i need your help. i want to create
    a dynamic gallery with data source as xml. i want to create a
    gallery with 3 columns and 5 rows.Basically a wallpaper page where
    there would be 15 wallpapers in a page with a link of downloading
    wallpapers with resolution 800x600,1024x768 and 1280x1024.
    for example if there are 63 wallpapers for a section , then
    there would be 5 pages with 5th page having only 3 wallpapers.
    everytime a wallpaper is added to xml, it automatically adds
    it up in html...
    plz help....i really want to create this asap and i cant find
    any help...

    thanks a ton for your response.... Meanwhile i figured out
    the solution myself using photogallery tutorial where div fixes the
    width and the next repeated element get shifted to another
    line.....
    now i am struck with another problem.
    i need to give substring to a particular data on xml.
    for example i have the following xml
    <movies>
    <data>
    Important Note: These online forums are for user-to-user
    discussions of Adobe products, and are not an official customer
    support channel for Adobe. If you require direct assistance, or
    prefer to contact Adobe support staff directly, please contact
    Adobe support.
    </data>
    </movies>
    i want to display only first 50 characters of data tag.....
    whats the code/syntax to do so.....

  • Updating multiple rows with different values

    Hi!
    I have a problem. I need to update more then 1000 rows with different values. How can I do it?
    For exsample i have table:
    id; color, date,
    1 red
    2 green
    3 white
    I need to update date field.
    Update table
    set date='01.02.03'
    where id=1
    Update table
    set date='01.03.03'
    where id=2
    Maybe there is way how to update multiple rows at one query?
    Sorry for my bad english.
    Thanks!

    Hi,
    You can try this
    UPDATE TABLE SET DATE = CASE
                        WHEN ID = 1 THEN TO_DATE('01-02-03','DD-MM-RR')
                        WHEN ID = 2 THEN TO_DATE('01-03-03','DD-MM-RR')
                        ENDcheers
    VT

  • How to remove the duplicate Columns in Multiple Rows?

    Hi,
    I want to remove the duplicate columns in a Multiple Rows.
    For example:
    Now i'm getting the output like this
    S_NO Order_number Assy_item Assy_Desp Item_Number
    1     S3123 12345 TEST     *1245*
    2     S3123 12345 TEST     *1256*
    3     S3123 12345 TEST     *1289*
    4     S3123 12345 TEST     *1223*
    5     S4123 42345 SAMPLE *4568*
    6     S4123 42345 SAMPLE *5656*
    7     S4123 42345 SAMPLE *4558*
    the Original output should be like this
    S_NO Order_number Assy_item Assy_Desp Item_Number
    1     S3123 12345 TEST     *1245*
    2                         *1256*
    3                         *1289*
    4                         *1223*
    5     S4123 42345 SAMPLE *4568*
    6                         *5656*
    7                         *4558*
    note: Alignment Problem all the Bold Numbers are Item Number(Last Column)*
    i'm using XML and RTF template.
    RTF Template is a Basic Table like Structure
    i pasted the XML code below
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="items" version="1.0">
    <parameters>
    <parameter name="P_DATE" dataType="date"/>
    <parameter name="P_DEPT_NO" dataType="varchar2"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="ROW1">
    <![CDATA[
    SELECT
    SUBSTR(IMGR.ORDER_NUMBER,3,2) MACHINE_NO
    ,IMGR.ORDER_NUMBER
    ,IMGR.ASSY_ITEM_NUMBER
    ,IMGR.ASSEMBLY_DESCRIPTION
    ,IMGR.ITEM_NUMBER
    ,IMGR.ITEM_DESCRIPTION
    ,SUBSTR(IMGR.ORDER_NUMBER,1,2) DEPT_NO
    ,IMGR.PLAN_DESCRIPTION
    FROM XXI.IGL_MRP_GROSS_REQUIREMENTS IMGR
    WHERE IMGR.DEMAND_TYPE IN ('Discrete job','Non-standard job')
    AND IMGR.PLAN_DESCRIPTION ='MRP-PRODUCTION'
    AND IMGR.DEMAND_DATE <= :P_DATE
    AND SUBSTR(IMGR.ORDER_NUMBER,1,2) IN (&P_DEPT_NO)
    ORDER BY
    DEPT_NO
         ,MACHINE_NO
    ,IMGR.ASSEMBLY_DESCRIPTION
    ,IMGR.ASSY_ITEM_NUMBER
    ,IMGR.ORDER_NUMBER
    ,IMGR.ITEM_NUMBER
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_IGLOO_QA_FPI" source="ROW1">
    <element name="MACHINE_NO" value="MACHINE_NO"/>
    <element name="ORDER_NUMBER" value="ORDER_NUMBER"/>
    <element name="ASSY_ITEM_NUMBER" value="ASSY_ITEM_NUMBER"/>
    <element name="ASSEMBLY_DESCRIPTION" value="ASSEMBLY_DESCRIPTION"/>
    <element name="ITEM_NUMBER" value="ITEM_NUMBER"/>
    <element name="ITEM_DESCRIPTION" value="ITEM_DESCRIPTION"/>
    <element name="DEPT_NO" value="DEPT_NO"/>
    <element name="PLAN_DESCRIPTION" value="PLAN_DESCRIPTION"/>
    </group>
    </dataStructure>
    </dataTemplate>
    Please Share your ideas.
    Thank
    Aswath

    hi Ananth,
    i tried the logic but its also not printing the First Line.
    Syntax:
    <?if:ORDER_NUMBER!= ORDER_NUMBER?><?ORDER_NUMBER?><?end if?>
    I think this condition works fine if it is start from second line of the row.
    Output:
    S_NO Order_number Assy_item Assy_Desp Item_Number
    1     12345 TEST     1245
    2     12345 TEST     1256
    No Order_number displayed.
    i hope you got my point. Please help me to get through it.
    Thanks
    Aswath

  • One column having multiple values with comma separator.

    Hey Guys,
    In my db, one culmn having multiple values with comma separator. like column_name = 'value1,value2,value3'. Now I want to compare this column to another column and fetch in Cursor.
    and each value having corresponding email_id, By fetching cursor, I need to populate email_ids.
    Thanks in advance!!
    -Lakshman

    Please compare and fetch cursor and populate result with out extract data into temp table. Give me the query!You have not provided DDL for table so I don't know table or column name to write any SQL.
    You have not provided DML for test data to run SQL against.

  • Select single column but multiple rows in JTable

    Hi
    I have a jTable and want to be able to select multiple rows but only in a single column.
    I've set these properties which makes selection almost the way I would like it.
    table1.setCellSelectionEnabled(true);
    table1.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);the only problem now is that the user can select multiple columns.
    Is there a simple way to restrict selection to single column?
    regards
    abq

    table.setCellSelectionEnabled(true);
    table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    DefaultListSelectionModel model =
         (DefaultListSelectionModel)table.getColumnModel().getSelectionModel();
    model.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

Maybe you are looking for