DataGrid with multi-line headers

Hello!

How can I have a DataGrid with header and so to speak.

Something like this:

[Main header]

[sub1] [sub2] [sub3]

Thank you!

There is an example of SplitDataGridColumn on my blog

--

Alex Harui

Flex SDK Team

Adobe System, Inc..

http://blogs.Adobe.com/aharui

Tags: Flex

Similar Questions

  • How to build a JTree with nodes multi-line Windows L and am FJt

    Although I already found 2 ways to build nodes multi-line JTree but both methods work very well in Java by default appearance and when I change my windows look and feel then it fails. I can't understand what is the problem. The two ways by which I build multi line nodes are:

    First: Using html in nodes
    as the DOSB linea < br > < html > < / html >

    Secondly: By implementing TreeRenderer and change it accordingly, such a class is given below
    class ModifiedTreeCellRenderer extends JPanel implements TreeCellRenderer {
        protected JLabel icon;
        protected TreeTextArea text;
        
        public ModifiedTreeCellRenderer() {
            setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
            icon = new JLabel() {
                @Override
                public void setBackground(Color color) {
                    if (color instanceof ColorUIResource)
                    color = null;
                    super.setBackground(color);
                }
            };
            add(icon);
            add(Box.createHorizontalStrut(4));
            add(text = new TreeTextArea());
        }
        
        @Override
        public Component getTreeCellRendererComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            String stringValue = tree.convertValueToText(value, isSelected, expanded, leaf, row, hasFocus);
            setEnabled(tree.isEnabled());
            text.setText(stringValue);
            text.setSelect(isSelected);
            text.setFocus(hasFocus);
            if (leaf) {
                icon.setIcon(UIManager.getIcon("Tree.leafIcon"));
            } else if (expanded) {
                icon.setIcon(UIManager.getIcon("Tree.openIcon"));
            } else {
                icon.setIcon(UIManager.getIcon("Tree.closedIcon"));
            }
            return this;
        }
    
        @Override
        public Dimension getPreferredSize() {
            Dimension iconD = icon.getPreferredSize();
            Dimension textD = text.getPreferredSize();
            int height = iconD.height < textD.height ? textD.height : iconD.height;
            return new Dimension(iconD.width + textD.width, height);
        }
    
        @Override
        public void setBackground(Color color) {
            if (color instanceof ColorUIResource)
                color = null;
            super.setBackground(color);
        }
    
        class TreeTextArea extends JTextArea {
            Dimension preferredSize;
            
            TreeTextArea() {
                setLineWrap(true);
                setWrapStyleWord(true);
                setOpaque(true);
            }
    
            @Override
            public void setBackground(Color color) {
                if (color instanceof ColorUIResource)
                color = null;
                super.setBackground(color);
            }
    
            @Override
            public void setPreferredSize(Dimension d) {
                if (d != null) {
                preferredSize = d;
                }
            }
    
            @Override
            public Dimension getPreferredSize() {
                return preferredSize;
            }
    
            @Override
            public void setText(String str) {
                FontMetrics fm = getToolkit().getFontMetrics(getFont());
                BufferedReader br = new BufferedReader(new StringReader(str));
                String line;
                int maxWidth = 0, lines = 0;
                try {
                    while ((line = br.readLine()) != null) {
                        int width = SwingUtilities.computeStringWidth(fm, line);
                        if (maxWidth < width) {
                            maxWidth = width;
                        }
                        lines++;
                    }
                } catch (IOException ex) {
                    System.out.println(ex);
                }
                lines = (lines < 1) ? 1 : lines;
                int height = fm.getHeight() * lines;
                setPreferredSize(new Dimension(maxWidth + 6, height));
                super.setText(str);
            }
    
            void setSelect(boolean isSelected) {
                Color bColor;
                if (isSelected) {
                    bColor = UIManager.getColor("Tree.selectionBackground");
                } else {
                    bColor = UIManager.getColor("Tree.textBackground");
                }
                super.setBackground(bColor);
            }
    
            void setFocus(boolean hasFocus) {
                if (hasFocus) {
                    Color lineColor = UIManager.getColor("Tree.selectionBorderColor");
                    setBorder(BorderFactory.createLineBorder(lineColor));
                } else {
                    setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
                }
            }
        }
    }
       
    but the two methods in the event of failure in a Windows look and feel, can anyone help with this?

    Published by: user8978073 on April 30, 2011 10:24

    Published by: user8978073 on April 30, 2011 10:25

    Can't check right now, but - afair, windowsLAF sets the rowHeight to a fixed value (16 or 18 or something like that). Consult the setRowHeight and make sure that there<= 0="" to="" indicate="" that="" it="" should="" be="">

  • model of multi line search with as

    Hi all

    I use oracle 9i. I want to search for multi - line pattern.

    for example

    Update tablename
    Set the columnname.

    I used select * from user_source where text like "update tablename set columnname %" but this only seems to work if update tablename set columnname is in the same line.

    Thank you.

    Well, no wonder it doesn't work. USER_SOURCE stores a single line of text per line, so the text in the column by definition cannot contain the multiline strings. One solution could be a LEAD analytic function:

    SQL> create or replace
      2    procedure p1
      3      is
      4      begin
      5          update emp
      6             set ename = ename;
      7  end;
      8  /
    
    Procedure created.
    
    SQL> select  distinct name
      2    from  (
      3           select  s.*,
      4                   lead(text) over(partition by name order by line) next_text
      5             from  user_source s
      6          )
      7    where text like '%update emp%'
      8      and next_text like '%set ename%'
      9  /
    
    NAME
    ------------------------------
    P1
    
    SQL> 
    

    SY.

  • Upgrade to 3.6.15. Now my Add ons (1 password, Download Helper, Multi line Bookmark Toolbar) disappeared. Everyone knows about this problem? Any ideas on how to solve this problem? Thank you.

    Upgrade to 3.6.15. Now my Add ons (1 password, Download Helper, Multi line Bookmark Toolbar) disappeared. Everyone knows about this problem? Any ideas on how to solve this problem? Thank you.

    There may be a problem with one of the files which stores details of the installed extensions. Try to delete these files as described in the section "Corrupt extension files" of this link - https://support.mozilla.com/kb/Unable+to+install+add-ons

    Although this article is not specifically about your problem, the method indicated in the corrupted files extension section can help. When you restart Firefox after you delete these files, the list of installed extensions is rebuilt and cela hopefully solve your problem.

  • Pop up multi line string causes missing "error".

    I need to display a string of long text (multi line) in a pop-up message.

    If I do this with a very long string in the .c file it works (I have several \n in the chain so that it looks OK in the pop-.

    However, if I try to extend the string of text on several lines THAT CVI is complaining, how to do this, I don't want to use a too large number of columns.

    That's what he does not like:

    case EVENT_RIGHT_CLICK:
    MessagePopup ('Run Test Jig Interface Test Help',')
    This test verifies that this program can communicate with
    the ATJ hardware.\n\n this program asks equipment and
    firmware revision of the ATJ and then records the results in this section as well as in the test report");
    break;

    Thank you

    You can split the text on multiple lines by using the line continuation character ' \ ', in this way:

    MessagePopup ("Run Test Jig Interface Test Help",
       "This test verifies that this program can communicate with " \
       "the ATJ hardware.\n\n This program requests the hardware and " \
       "firmware revison of the ATJ and then records the results in this " \
       "section as well as in the test report");
    
  • How can I add multi line selection in a drop-down list

    I just started with Acrobat DC. Everything is simple, until it isn't. I try to add items to my drop-down list. It's easy. I'm trying to make the choice of multi line. It is an inspection report and the choice will not fit on a single line. So after making the choice, can not read the answer. Thank you-Tim

    It is possible to do it, but only with a script and it's a kind of buggy. In other words, not really a good idea.

  • Trying to create a multi-line dialog box

    I worked on a study PDF guide. At the end of each chapter is a self test, and I have some javascript which marks the review when a user clicks a button. Currently, I use a window app.alert to notify the user what responses it is correct and display explanations on incorrect answers. Unfortunately, some of the explanations may be a little long, so I had some tests auto split in several alerts. I have a snippet of code (below) for example to a dialog box, but have been unable to find examples of a multi-line dialog box. A thread has responses as "it is not easy", but no solid examples. Someone at - it an example of a simple dialog box, a line that I could adjust to my needs?

    var oDlg = { 
        description: { name: "Test Dialog", elements: [ { name: "Hello World", type: "static_text", }, { type: "ok", }, ] } 
    }; 
    // Dialog Activation 
    app.execDialog(oDlg);
    
    

    I tried to do something like that, but it barfs on the first carriage return:

    var sText = "Question 5: Incorrect! The correct answer is B\r\rA, C, and D are incorrect. && and || are both short-circuit operators. With &&, when the left side evaluates to false the right side is never evaluated. And with ||, when the left side evaluates to true, the right side is never evaluated.\r\rIn the first statement, i1 does not equal 99 when it is evaluated, so the second expression is printed. However, it is decremented BEFORE the print statement, so the combined value of i and j is 299.\r\rIn the second statement, the left side of the equation evaluates to false, so the right side is never evaluated. Thus the second expression is printed out.\r\rIn the third statement, i3 equates to 100, so the first expression is printed out.\r\rFor the last statement, the left side of the expression is evaluated to true, so the right is never evaluated. The first expression is printed out.\r\rThe final result is 'Value2: 299, Value2: 300, Value1: 299, Value1: 300'";
    
    var oDlg = { 
    description: { name: "Test Dialog", elements: [ { name: SText, type: "static_text", }, { type: "ok", }, ] } 
    }; 
    // Dialog Activation 
    app.execDialog(oDlg);
    

    Any help would be appreciated.

    Here is a basic sample:

    Dialog1 var = {}

    DoDialog: function() {}

    Return app.execDialog (this);

    },

    initialize: function {(dialogue)

    var dlgInit = {}

    "not1": this.strnot1

    };

    Dialog.Load (dlgInit);

    },

    Description: {}

    name: "dlg1."

    elements:

    [

    {

    type: "display."

    elements:

    [

    {

    type: "cluster."

    item_id: "cls1."

    name: "Notes."

    elements:

    [

    {

    type: 'static_text. "

    Multiline: 'true ',.

    item_id: "not1."

    Width: 300,

    height: 300,.

    }

    ]

    }

    ]

    },

    {

    type: "ok."

    }

    ]

    } / / description

    };

    var sText = "Question 5: Incorrect! The correct answer is B\r\rA, C, and D are incorrect. & and | are only two short circuit operators. With &, when the left is set to false, the right side is never evaluated. And with |, when the left evaluates to true, the right side is never evaluated.\r\rIn the first statement, i1 is not equal 99 when it is evaluated, so the second expression is printed. However, it is decremented BEFORE the print statement, so the combined value of i and j is 299.\r\rIn that the second statement, the left side of the equation is set to false, then the right-hand side is never evaluated. The second expression is so printed out.\r\rIn the third statement, i3 is equivalent to 100, so the first expression is printed out.\r\rFor the last statement, the left side of the expression evaluates to true, then the right is never evaluated. The first expression is printed out.\r\rThe end result is ' value2: 299, value2: 300, value1: 299, value1: 300 ft;

    Dialog1.strnot1 = sText;

    Dialog1. DoDialog();

  • AutoComplete - see value in the form of multi line + return value.

    Hi Experts,

    I had a simple solution for AutoComplete to see the multi line like: select line1 | Chr (10) | Line2 | Chr (10) | line 3 of une_table.
    In onblur DA it is a process that reduces the value, set the fields another request based on the process of pl/sql.

    After the upgrade to the latest version of apex + modified model - the integer value is displayed as a single line only (no need to any text is indicated).

    I want to manage something like: ExtJs - Ajax search field
    http://Apex.Oracle.com/pls/OTN/f?p=PLAYPEN:1:264121214928301:

    Is there a solution to the APEX to use AutoComplete with multi display value line without incorporating the ExtJs?
    Sorry for my English :)

    Thank you!
    Concerning
    J :D

    I'll add my plugin in 2 or 3 days...

    Welcome

  • How do I Center a text entry field can be single or multi-line?

    I have created a form in Adobe Acrobat Pro XI and have almost everything I like.  One of my latest problems trying to get a text in a field of centered text.  The entrance is sometimes a single line and multi-line sometimes.  If I put in place for multi-line entries are centered, then the single line looks like offshore... and vice versa.  Is it possible to have the centered text automatically in the text field single or multi-line?

    Unfortunately, there is no way to set up a field so that the text is guaranteed to be centered vertically in both cases. If you set up so that the rich text formatting is enabled, it is possible for a user centered vertically, but this isn't something you can preconfigure so that it remains in effect when the field is cleaned. For a user to do, with the emphasis placed on the ground that they would have to display the toolbar properties (Ctrl + E), click on the "more..." "> paragraph > alignment > intermediate text [button]

  • How can I increase the attack in a multi-line text box?

    Is this possible?

    I found this ad a few years where someone has asked a similar question:

    http://forums.Adobe.com/thread/286972

    This feature has never been added? If this is not the case-how can I make the code work posted in response to that post?  Just hide the lines would be a good alternative, I think. I tried to add the code to my existing PDF, but seems not to do anything, the lines are still visible when you type in the field.

    No, leading to control has been added and it probably never will be.

    The code at this other thread is not complete because the functions that it calls are not displayed. They are not integrated. Here is a link to a document with a multi-line field that behaves in this way: https://workspaces.acrobat.com/?d=AG6oZ3bi3DYHokxDPeWN7A

    There are several small scripts in various events that control the behavior.

  • FormsCentral Adobe multi-line text field

    I am trying to create a form that will expand the fields of history/medical notes as indicated by the patient.  I tried incorporating fields "(multi-line) text field ', but get a field with a scroll bar, rather than a growing field.  Moving to other fields, or registration or import the file does not change the scope of expanded scroll.

    Any help appreciated.

    Many LiveCycle Designer is uninstalled when you install Acrobat 11, you must be eligible to receive the latest free version, so you can continue to use the dynamic forms designer.

  • Strange behavior on DataGrid with ArrayCollection as a DataProvider collection

    I have a Datagrid with an ArrayCollection as a DataProvider collection, the arrayCollection collection is partially generated by a remoteObject call, the dataprovider seems to work at least until I try to change the field...

    By the RemoteObject, I get only a collection ArrayCollection with the 'ip' field, but the data grid seeks ip, check and recordfields...

    If I add/edit this field new it works, but only under specific condition

    The DataGrid control:

     <s:DataGrid id="datagrid" left="10" right="10" top="136" 
           dataProvider="{listaIPCheck}" bottom="10" requestedRowCount="4">
              <s:columns>
                    <s:ArrayList>
                         <s:GridColumn dataField="ip" headerText="Asset"/>
                         <s:GridColumn dataField="check" headerText="Inventory"/>
                         <s:GridColumn dataField="save" headerText="Salvataggio"/>
                    </s:ArrayList>
               </s:columns>
     </s:DataGrid>
    

    The Script:

       [Bindable]private var listaIPCheck:ArrayCollection; 
    
        private function ro_resultHandler(event:Event=null):void
        {
          listaIPCheck = new ArrayCollection();
          listaIPCheck = ro.getListUpdate.lastResult;
          heap = 0; 
          // Read Below {POINT #1}
          init3(); 
        }
    
    
        private function init3():void
        {
         // Read Below {POINT #2}
         if (heap<listaIPCheck.length)
         {
            // omitted the initialization of the process p
            p.addEventListener(NativeProcessExitEvent.EXIT, onExit);
            try{ 
              p.start(startupInfo);
            }catch(e:Error){}
         }
        }
    
    
    
        private function onExit(e:NativeProcessExitEvent):void { 
            // Read below {POINT #3}
        }
    

    Here is my code, now, as you can see there are 3 lines where I wrote to read below...

    Suppose that to put this simple 'for' instead of the commented (once both) line

        for (var k:Number=0;k<listaIPCheck.length;k++)
        {
          listaIPCheck.getItemAt(k).check = "checkVal";
          listaIPCheck.getItemAt(k).save = "saveVal";
        }
    

    This code still works in 3 points, so at the end of the call, the ArrayCollection collection is always filled with new values, but the datagrid control refresh the items only in the POINT #1 and #2 of POINT

    Why not the Point #3?

    When you get a large number of items in your list, you will probably also find it resets the selectedIndex property and jumps on the first line of data.  It is not automatically updated because the ArrayCollection collection look inside objects to see if they change.  When they change, you must indicate the ArrayCollection collection they changed, call itemUpdated.

  • DataGrid with dynamic comboboxes

    I need to design a dataGrid with comboboxes in a column. These comboboxes should all have some different dataProviders based on a column value 1. What would be a general approach?

    Thank you

    Property of the data rendering engine corresponds to the data for the whole of the line so you can get the data of Column1 and assign the dataprovider of the combobox as a result.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • How to bind itemrender checkbox in a datagrid with the selecteditem property?

    Hey,.

    I have a datagrid with a checkbox column. I need the boxes to select different items I want to remove for example or do anything else with them. I thought to bind the checkboxes with the DataGrid.SelectedItems property but I Don t know how? Is there perhaps a better way to collect the elements of a datagrid control that are selected by a checkbox ItemRenderer?

    Thank you!

    What about Kat

    In this situation you must always be go the dataprovider of the DataGrid to see which check boxes are selected.

    So if the dataprovider for the DG does not have a field for the State of the checkbox, it is best to add a.

    Then simply change the field in the dataprovider for the line checjbox which is checked/uncheced and if you need to do something else on which boxes are checked, refer to the fields in the dataprovider.

    It is always best practice.

    If this post answers your question or assistance, please mark it as such.

  • Disorders of the multi line text area

    I work in CS3 on Mac.

    I created a text box in a dialog box with my resource editor.  Then, I used the ADMItemSuite to set the "point guy" to "kADMTextEditMultiLineType".

    When I hit the return key I eventually trigger the 'ok' button in the dialog box instead of going to the next line in the text box in that just, I was typing.  I can remedy this situation by creating a tracker for the element of text box manually adds a '\r' when the key 'kADMReturnKey' race is followed, but that substitutes the feature by clicking on / mouse of the multi-line text box selection.

    Any ideas how I can get back to go to the next line in the text box without writing my own tracker?

    Thank you

    Bill

    That I could find, the best way to do this is to create your own tracker. You don't have to manage it all just treat the return key and call Tracker by default if it is not coming back. It takes only a few lines of code.

    Why don't you create a tracker?

Maybe you are looking for