Column Header Rendering

Hi,
Does anyone know how I can change the background color og a JTable header when I click on a column in the table. For example If I click on column 3 in the tabe the header for column 3 will change color.
Thanking you in advance.

Add ur renderer for the header which extends BasicTableCellRenderer.. override the getTableCellRendererComponent()..
table.getHeader().setDefaultRenderer(myRenderer());
class myRendere extends BasicTableCellRenderer{
public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column){
  if(selected)
     this.setBackGround(Color.black);
return this;
}

Similar Messages

  • Header renderer click handler not working

    Hi All
    Below is code of my header renderer which copied code from default headerrenderer and created new one, I added textinput with down arrow and close button,
    But when i click on close button, I am making filter box invisible, If i put a break point inside griditemrenderer1_mouseOutHandler() function then filter box becomes invisible, but while running in debug mode without break point filter box shows visible only,
    Please let me know where i am doing wrong.
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemRenderer minWidth="21" minHeight="21"
                        xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        mouseOver="griditemrenderer1_mouseOverHandler(event)"
                        creationComplete="griditemrenderer1_creationCompleteHandler(event)">
        <fx:Declarations>
            <s:Label id="labelDisplay"
                     verticalCenter="1"
                     textAlign="start"
                     fontWeight="bold"
                     verticalAlign="middle"
                     maxDisplayedLines="1"
                     showTruncationTip="true" />
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import com.db.view.components.FilterPopup;
                import mx.managers.PopUpManager;
                import mx.controls.Menu;
                import mx.events.FlexEvent;
                import spark.components.gridClasses.IGridVisualElement;
                import mx.core.IVisualElement;
                import spark.components.DataGrid;
                import spark.components.GridColumnHeaderGroup;
                import spark.components.gridClasses.GridColumn;
                import spark.primitives.supportClasses.GraphicElement;
                // chrome color constants and variables
                private static const DEFAULT_COLOR_VALUE:uint = 0xCC;
                private static const DEFAULT_COLOR:uint = 0xCCCCCC;
                private static const DEFAULT_SYMBOL_COLOR:uint = 0x000000;
                private static var colorTransform:ColorTransform = new ColorTransform();
                 *  @private
                private function dispatchChangeEvent(type:String):void
                    if (hasEventListener(type))
                        dispatchEvent(new Event(type));
                //  maxDisplayedLines
                private var _maxDisplayedLines:int = 1;
                [Bindable("maxDisplayedLinesChanged")]
                [Inspectable(minValue="-1")]
                 *  The value of this property is used to initialize the
                 *  <code>maxDisplayedLines</code> property of this renderer's
                 *  <code>labelDisplay</code> element.
                 *  @copy spark.components.supportClasses.TextBase#maxDisplayedLines
                 *  @default 1
                 *  @langversion 3.0
                 *  @playerversion Flash 10
                 *  @playerversion AIR 1.5
                 *  @productversion Flex 4.5
                public function get maxDisplayedLines():int
                    return _maxDisplayedLines;
                 *  @private
                public function set maxDisplayedLines(value:int):void
                    if (value == _maxDisplayedLines)
                        return;
                    _maxDisplayedLines = value;
                    if (labelDisplay)
                        labelDisplay.maxDisplayedLines = value;
                    invalidateSize();
                    invalidateDisplayList();
                    dispatchChangeEvent("maxDisplayedLinesChanged");
                 *  @private
                 *  Create and add the sortIndicator to the sortIndicatorGroup and the
                 *  labelDisplay into the labelDisplayGroup.
                override public function prepare(hasBeenRecycled:Boolean):void
                    super.prepare(hasBeenRecycled);
                    if (labelDisplay && labelDisplayGroup && (labelDisplay.parent != labelDisplayGroup))
                        labelDisplayGroup.removeAllElements();
                        labelDisplayGroup.addElement(labelDisplay);
                private var chromeColorChanged:Boolean = false;
                private var colorized:Boolean = false;
                [Bindable]
                private var _filterVisibility:Boolean = false;
                 *  @private
                 *  Apply chromeColor style.
                override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                    // Apply chrome color
                    if (chromeColorChanged)
                        var chromeColor:uint = getStyle("chromeColor");
                        if (chromeColor != DEFAULT_COLOR || colorized)
                            colorTransform.redOffset = ((chromeColor & (0xFF << 16)) >> 16) - DEFAULT_COLOR_VALUE;
                            colorTransform.greenOffset = ((chromeColor & (0xFF << 8)) >> 8) - DEFAULT_COLOR_VALUE;
                            colorTransform.blueOffset = (chromeColor & 0xFF) - DEFAULT_COLOR_VALUE;
                            colorTransform.alphaMultiplier = alpha;
                            transform.colorTransform = colorTransform;
                            var exclusions:Array = [labelDisplay];
                            // Apply inverse colorizing to exclusions
                            if (exclusions && exclusions.length > 0)
                                colorTransform.redOffset = -colorTransform.redOffset;
                                colorTransform.greenOffset = -colorTransform.greenOffset;
                                colorTransform.blueOffset = -colorTransform.blueOffset;
                                for (var i:int = 0; i < exclusions.length; i++)
                                    var exclusionObject:Object = exclusions[i];
                                    if (exclusionObject &&
                                        (exclusionObject is DisplayObject ||
                                            exclusionObject is GraphicElement))
                                        colorTransform.alphaMultiplier = exclusionObject.alpha;
                                        exclusionObject.transform.colorTransform = colorTransform;
                            colorized = true;
                        chromeColorChanged = false;
                    super.updateDisplayList(unscaledWidth, unscaledHeight);
                 *  @private
                override public function styleChanged(styleProp:String):void
                    var allStyles:Boolean = !styleProp || styleProp == "styleName";
                    super.styleChanged(styleProp);
                    if (allStyles || styleProp == "chromeColor")
                        chromeColorChanged = true;
                        invalidateDisplayList();
                protected function griditemrenderer1_mouseOverHandler(event:MouseEvent):void
                    _filterVisibility = true;
                protected function griditemrenderer1_mouseOutHandler():void
                    _filterVisibility = false;
                protected function griditemrenderer1_creationCompleteHandler(event:FlexEvent):void
                    trace(label);
                protected function textinput1_clickHandler(event:MouseEvent):void
                    var filterpopUp:FilterPopup = new FilterPopup();
                    filterpopUp.filterColumn = label;
                    PopUpManager.addPopUp(filterpopUp,this,false);
                    filterpopUp.addEventListener("test",testHandler);
                    filterpopUp.x = event.stageX - 50;
                    filterpopUp.y = event.stageY + 10;
                protected function testHandler(event:Event):void
                    owner.dispatchEvent(new Event("test"));
            ]]>
        </fx:Script>
        <s:VGroup left="7" right="7" top="5" bottom="5" gap="2" verticalAlign="bottom">
            <s:HGroup id="tiFilter" width="100%" gap="3" verticalAlign="middle" visible="{_filterVisibility}">
                <s:TextInput width="{labelDisplay.width + 20}" height="16" skinClass="com.db.view.skins.FilterTextInputSkin"
                              text="{label}" click="textinput1_clickHandler(event)"/>
                <s:HGroup id="closeBtn" width="15" height="15" click="griditemrenderer1_mouseOutHandler()"
                          buttonMode="true" useHandCursor="true" mouseChildren="false" keyDown="griditemrenderer1_mouseOutHandler()">
                    <s:Image source="@Embed('/assets/images/icon_close.gif')"/>
                </s:HGroup>
            </s:HGroup>
            <s:Group id="labelDisplayGroup" width="100%"/>
            <s:Group id="sortIndicatorGroup" includeInLayout="false" />
        </s:VGroup>
    </s:GridItemRenderer>

    Hi Sudhir,
    Thanks for posting your issue, Kindly find the code snnipet below to Add a new item in Custom list
    public override void ItemAdded(SPItemEventProperties properties)
        base.ItemAdded(properties);
        if (properties.List.Title
    == "Test")
    Get Properties
            string ABC=
    properties.ListItem["Column"].ToString();
            string DEF=
    properties.ListItem["Column"].ToString();
            DateTime XYZ=
    (DateTime)properties.ListItem["Start Column"];
            DateTime WSD=
    (DateTime)properties.ListItem["End Column"];
    Create sub site
            SPWeb web
    = properties.Site.AllWebs.Add(name.Replace(" ", string.Empty),
    name,
                description, 0, SPWebTemplate.WebTemplateSTS, false, false);
            web.Update();
    Also, browse the below mentioned URL to implementation your custom list step by step. and how you can debug your custom code.
    http://www.c-sharpcorner.com/UploadFile/40e97e/create-site-automatically-when-a-list-item-is-added/
    http://msdn.microsoft.com/en-us/library/ee231550.aspx
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • Exporting to Excel - How to control Column Heading?

    I'm working in SSRS 2012.  I have one tablix in the report body.  The tablix has both Row and Column Groups.
    When rendering in the web browser the report page breaks on a row group.  The Repeat Column Headers property is set to "True" so it shows the column headings from page to page.
    When rendering in Excel, I want one worksheet and not separate worksheets so the page break is disabled via the Page Break->Disabled property expression "=IIf(Globals!RenderFormat.Name="EXCELOPENXML", True, False)".
    This is all good but the Column Headings only show up once at the very top in the excel worksheet. 
    Is it possible to make the Column Headings repeat with each tablix data region as it is rendered vertically down the worksheet?
    OR is there a way from SSRS to set the Excel property "Rows to Repeat at top" to include Column Heading; by default the SSRS Report's header is repeated in Excel, but can the number of rows be changed to include the Column Heading?
    OR is there some other work around?
    Thanks for your help.
    Mark

    Thanks for the reply Wendy.
    You addressed my second question ... "is there a way from SSRS to set the Excel property "Rows to Repeat at top" to include Column Heading; by default the SSRS Report's header is repeated in Excel, but can it be changed to include the Column Heading? 
    Based on your response, the only way to freeze the column header in excel is to freeze or split panes AFTER export to excel.  well booo but I have to accept that I guess.
    My first question is what I really want to do, which is to physically repeat the Column Heading in the excel rendering. I included two pictures demonstrate what I want ...
    1) the standard SSRS report rendered in Excel ... Column Headings are shown once:
    Standard Export to Excel
                           Year
    Region
    Category
    2011
    2012
    2013
            Total
    East
    Sales
    10
    20
    30
    60
    Expenses
    8
    20
    10
    38
    Profit
    2
    0
    20
    22
    West
    Sales
    8
    16
    24
    48
    Expenses
    6
    16
    8
    30
    Profit
    2
    0
    16
    18
    2) what I'd like to see rendered in Excel ... which is to repeat the headers as you scroll down the page
    Desired Export to Excel
                          Year
    Region
    Category
    2011
    2012
    2013
            Total
    East
    Sales
    10
    20
    30
    60
    Expenses
    8
    20
    10
    38
    Profit
    2
    0
    20
    22
                           Year
    Region
    Category
    2011
    2012
    2013
            Total
    West
    Sales
    8
    16
    24
    48
    Expenses
    6
    16
    8
    30
    Profit
    2
    0
    16
    18
    Thanks again for your help,
    Mark

  • Can I "catch" a click on a sortable column header of a report?

    Hi,
    I have a report.
    Most columns are made sortable: users can click on them to sort.
    I notice that when clicked only page-rendering executes (i.e. not page processing).
    Here is the question.
    I need to call some custom PL/SQL when the user clicks on a sortable column header. This PL/SQL could executes in the before header (it needs to fire before the page re-executes the query).
    The PL/SQL needs to know which column was clicked on: how can I determine this?
    Can I access the url (example below)? I see that it shows which column was clicked.
    https://dev.centraal.boekhuis.nl:4443/pls/apex/f?p=100:3:145900176972409:fsp_sort_4::RP&fsp_region_id=1562722058676533
    Thanks,
    Toon

    That would order the report by C1 when I click C2, which isn't what I want. I want to preserve the order of C1 (whether that's ascending or descending) and then have C2 ascend or descend for each set of values in C1.
    If I can't set the Order By then I'll need something like this as my query. The "last_col1_order" and "this_col2_order" would be items, set according to the last few values of Request. It's horrible, but it gets the job done. This would be so easy in forms!
    WITH data AS (
      select level col from dual connect by level < 6)
    SELECT
      col1,
      col2,
      lpad(case last_col1_order
             when decode(this_col2_order,'asc','asc','desc') then col1
             else col1_desc end,20,'#') ||
        lpad(col2,20,'#') col2_sort
    FROM (
      SELECT
        col1,
        col2,
        (max(col1) over(partition by 1))-(dense_rank() over(order by col1)) col1_desc,
        'asc' last_col1_order,
        'desc' this_col2_order
      FROM (
        SELECT a.col col1, b.col col2
        FROM data a, data b
    order by col2_sort desc

  • Datagrid column header word wrap issue

    Hi All,
    I'm passing dynamic text to a datagrid column header. The word wrap is true but it's not working.
    Any ideas how to fix this issue?
    DataGridColumn headerText="{myVar.text} Total" headerWordWrap="true"
    Thanks
    Johnny

    @Johnny,
    Try to make use of the headerRenderer property and use <mx:Text /> control as a renderer so that your headerText gets wrapped..
    Thanks,
    Bhasker
    Message was edited by: BhaskerChari

  • How to get column header text in IWDTable

    Hi
    Just want to know how to get column header name in IWDTable.
    I know that you can get it with
    IWDAbstractTableColumn[] groupedColumns = table.getGroupedColumns();
    for (int i = 0; i < groupedColumns.length; i++) {
         IWDAbstractTableColumn column = groupedColumns<i>;
         column.getHeader().getText();
    But what if text isnt set on header level but its rendered from cellEditor  model binding (im not sure if its like that).

    Finally after your suggestion i did it with this code
    String header = column.getHeader().getText();
                       if ((header == null || header.length() == 0) && column instanceof IWDTableColumn){
                            IWDTableCellEditor tableCellEditor = ((IWDTableColumn) column).getTableCellEditor();
                            if (tableCellEditor instanceof IWDTextView){
                                 String bindingPath = ((IWDTextView)tableCellEditor).bindingOfText();
                                  StringTokenizer tokenizer = new StringTokenizer(bindingPath,".");
                                  String token = "";
                                  IWDNodeInfo nodeInfo = context.getNodeInfo();
                                  while (tokenizer.hasMoreTokens()){
                                       token = tokenizer.nextToken();
                                       if (tokenizer.hasMoreTokens()){
                                            nodeInfo = nodeInfo.getChild(token);          
                                  IWDAttributeInfo attribute = nodeInfo.getAttribute(token);
                                  ISimpleType simpleType = attribute.getSimpleType();
                                  simpleType.getDescription();
                                 header = simpleType.getDescription();

  • DG Header renderer problem

    Hi, I've encountered a problem with datagrid header renderer.
    I have custom header renderer based on let's say - Label, or
    something else, doesn't matter. Now when I run the application,
    everything is OK. Problem occuress, when I try to click on this
    header to sort data. Program runs into a loop and CPU is full
    loaded. I've tried to debug and I've found out, that my custom item
    renderer constructor (CustomHeaderRenderer ) is called all the time
    in a loop. Don't understand why... when I use standard header
    renderer, everything's ok.
    This is the whole code:
    package myClasses
    import mx.controls.Label;
    public class CustomHeaderRenderer extends Label
    public function CustomHeaderRenderer()
    this.text = &quot;Some Text&quot;;
    Does anybody knows, where could be a problem ?? thanks

    Here is the sample code I tried. I tried it using Flex 2.0.1
    and Flex 3. I am unable to reprodue your bug.
    quote:
    &lt;?xml version=&quot;1.0&quot;
    encoding=&quot;utf-8&quot;?&gt;
    &lt;mx:Application xmlns:mx=&quot;
    http://www.adobe.com/2006/mxml&quot;
    layout=&quot;absolute&quot;&gt;
    &lt;mx:Script&gt;
    &lt;![CDATA[
    private var input:Array =
    { x:100, y:10, z:11 },
    { x:20, y:12, z:14 },
    { x:10, y:14, z:18 },
    { x:10, y:14, z:18 }
    ]]&gt;
    &lt;/mx:Script&gt;
    &lt;mx:DataGrid
    dataProvider=&quot;{input}&quot;&gt;
    &lt;mx:columns&gt;
    &lt;mx:DataGridColumn dataField=&quot;x&quot;
    headerRenderer=&quot;CustomHeader&quot;
    headerText=&quot;Sample&quot; /&gt;
    &lt;mx:DataGridColumn dataField=&quot;y&quot;
    headerRenderer=&quot;CustomHeader&quot;
    headerText=&quot;Sample&quot; /&gt;
    &lt;mx:DataGridColumn dataField=&quot;z&quot;
    headerRenderer=&quot;CustomHeader&quot;
    headerText=&quot;Sample&quot; /&gt;
    &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;
    &lt;/mx:Application&gt;
    quote:
    package
    import mx.controls.Label;
    public class CustomHeader extends Label
    public function CustomHeader()
    super();
    this.text = &quot;Some text&quot;;

  • Hide Nested columns header

    I've a nested column, i.e. one column has 2 columns in it. How to disable only the header of the sub column and not the main column's header.
    Example:
    TableColumn main = new TableColumn("");
    TableColumn lastName = new TableColumn("Last Name");
    TableColumn firstName = new TableColumn("First Name");
    main.getColumns().addAll(lastName , firstName );
    When this is rendered, it displays 1 main header and 2 sub header Last Name and First Name. Now how to only hide showing of First and Last Name column's header.
    Is it possible?
    I checked the other posts in the forum like this in the below link, but i want to hide the nested columns header.
    https://forums.oracle.com/message/10028003#10028003
    Thanks.

    I did the below code to hide the columns, but it hides all the columns. Is there a way to hide only the nested column only and not main header column which has both these columns.
    Pane header = (Pane) table.lookup("TableHeaderRow");
    header.setVisible(false);
    table.setLayoutY(-header.getHeight());
    table.autosize();
    What if there are 2 tableview's and you want only ont tableview's header be made invisible.? How to do it?
    Thanks.

  • How to access AdvancedDatagrid column Header information?

    I have an AdvancedDatagrid with custom Column header
    renderers.
    column = new AdvancedDataGridColumn("Header Text");
    column.headerRenderer = new
    ClassFactory(PE_FilterHeaderRenderer);
    MyAdvancedDataGrid.columns = [column];
    Within my header renderer class I have some code to implement
    the children the way that I want. Now.. does anyone know how to
    access those headers from the outside without storing off an
    intance of the header itself within the class. Basically, I need to
    get the right header and access an accessor within that header to
    set something to change the header text and such if the user does
    something to the datagrid. Any ideas would be helpfull..
    Thanks!

    Hi Michael,
    If you just want to retrieve the data, you could use the following code.
    //Get the node which the table is bound to
    IWDNode node = wdContext.nodeTable();
    //iterate thru the elements
    for(int i = 0 ; i<node.size();i++)
      IWDNodeElement ne = node.getElementAt(i);
      Object value = ne.getAttributeValue("<column name>");
      //Here you have the data in the value variable
      //and you can manipulate this now
    Regards,
    Sudeep

  • Column header sorting: Checkboxes

    Column header sorting doesnt seem to work like one would expect when the column is a checkbox rendered using htmldb_item.checkbox().
    If I have a some boxes checked, some unchecked on a page and I click on the column header, I would expect all the checked and unchecked boxes to show up together. But they dont. Does the HTML for the checkbox interfere with the sorting? Is there a way to make it sort what you see on screen?
    Thanks

    Vikas,
    What you get when using htmldb_item calls in your query are varchar2 columns. So it’s ordered by the resulting strings, including all HTML tags that are rendered by that procedure. You might be able to do what you are describing by using Tyler’s sorting hack somehow:
    Dynamic Selection of Report Column Format
    Regards,
    Marc

  • ADF 10.1.3.4 - html tag in af:table column header

    Hello,
    How can I to put "&lt;br/&gt;" into af:table column header?
    I tried to put "&lt;br/&gt;" in both the headerText property of the af:column and in the VO, but it always get encoded.
    Thanks before.
    Regards,
    Rudi
    Edited by: bungrudi on Nov 24, 2008 1:50 AM -- encoding the br tag in the post, because it get rendered as is :)

    Hi,
    you can't mix and match HTML markup with JSF elements. This is only possible if the JSF component explicitly supports this (like af:formattedOutput).
    Frank

  • JTable - One Column Heading for Two Columns

    Can you adjust the default JTable to have one column heading for two columns of data? Is there a simple span command? I've looked at the api for JTable and JTableHeader and didn't see anything, is there something I'm missing? Any help would be appreciated.

    What i am trying to accomplish is have column 'E' span 2 columns.
    This is my code thus far, however it give the error from my pryor message. I am pretty sure it is because I'm using and Object[][] and a String[] instead of Vectors. What corrections do I need to make in order for my goal of:
    [ A ][ B ][ C ][ D ][ E  ][ F ][ G ]
    [ 1 ][ 2 ][ 3 ][ 4 ][5][6][ 7 ][ 8 ]
    Object[][] data = new Object[ROWS][COLUMNS];
    String[] columnNames = {"A","B","C","D","E","E","F","G"};
    table = new JTable(data, columnNames);
    table.setBackground(Color.white);
    table.addKeyListener(this);
    DefaultTableCellRenderer d = new DefaultTableCellRenderer();
    d.setHorizontalAlignment(JLabel.CENTER);
    table.setDefaultRenderer(table.getColumnClass(0),d);
    for (int i = 0; i < table.getColumnCount(); i++){
    TableColumn aColumn = header.getColumnModel().getColumn(i);
    TableCellRenderer renderer = aColumn.getHeaderRenderer();
    if (renderer == null) {
    renderer = new DefaultTableCellRenderer(){
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column){
    JTableHeader header = table.getTableHeader();
    if (header != null) {
    setForeground(header.getForeground());
    setBackground(header.getBackground());
    setFont(header.getFont());
    setHorizontalAlignment(JLabel.CENTER);
    setText((value == null) ? "" : value.toString());
    setBorder(UIManager.getBorder("TableHeader.cellBorder"));
    return this;
    aColumn.setHeaderRenderer(renderer);

  • Problem in Adding two buttons under same column header (in JTable)

    Hi,
    I have a JTable and to a particular column i want to add two buttons.
    Here the two buttons should be under the same column header and i need to add listners to these.
    Any idea how to do this?
    Thanks & regards
    Neel

    Of course as your header is drawn by a renderer, the buttons don't actually work, but you can listen for mouse clicks within the area of the header and see which button the mouse position was over.
    See the Java Table Sorter Demo code for how to add a mouse listener to the header...
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableSorterDemo
    ....and from there you should be able to determine where in the component the click occured by using the getX() and getY() methods of the MouseEvent to determine which button in the renderer component was clicked. Use something like Rectangle.contains() to match the click location against the buttons.

  • Multi-colored JTable column heading?  How?

    Hi,
    I'm looking for a way to have JTable column heading text
    that can be displayed in multiple colors, so one string
    in one column header, might have each letter a different
    color.
    My application requires highlighting some of the letters
    of a word as red, while others are normal text (black).
    I've been using multi-line strings to simulate vertical
    naming for my column header, for example:
    PPP
    I I I
    N N N
    1 2 3
    for PIN1, PIN2, PIN3. The column data has a binary
    one or zero for each pin, grouped together in one JTable
    column. In my application, if there is an error, I want to
    color just the text representing, say PIN2 red and leave
    the surrounding PIN1 and PIN3 black.
    What approach should I take for doing this with JTable?
    Thanks!
    John Roberts
    [email protected]

    You should override the default cell renderer used by Java
    - JTable.getTableHeader().setDefaultRenderer(yourRenderer)
    Extend yourRenderer from JLabel and use HTML tags to change the color.
    - setText on JLabel with the HTML code like "<HTML> <BODY> <FONT COLOR="red"> A </FONT> <FONT COLOR="green"> B </FONT></BODY> </HTML>"

  • DataGrid custom header renderer issues

    I'm trying to create a DataGrid headerRenderer with a
    TextInput to filter the grid from the column. The custom renderer
    simply has a label (with the column header label) and then a text
    input, and it's all in AS, implementing IFactory, etc. It's
    rendering just fine.
    The issue is with the filtering - at first, I tried just
    adding the text box, but as soon as I typed anything in it, the
    filtering logic (which must call dataProvider.refresh() to refresh
    the dataGrid) caused the header to be re-instantiated, thereby
    clearing the filter text input field. I later worked around this by
    caching the TextInput objects elsewhere, and having the header
    simply addChild on them.
    However, the issue still gets in the way. The headerRenderer
    is reinstantiated twice per call to refresh(), causing it to blink,
    and if the user types too fast, it throws a RTE because the
    components haven't been instantiated yet.
    Is there a way to stop this incessant re-initialization of
    the headerRenderer? It doesn't seem necessary or efficient. If
    anyone knows or wants to help I would be very grateful.
    Thanks!

    This may be caused by the TextInput event you are using to
    call the filtering method. Are you call your filtering method from
    the TextInput's change event, perhaps? If so, each character being
    typed will call the filter method. Call your filtering method from
    the valueCommit event, and see if that helps.
    Put a break on the first line of your filter method, debug
    the app, start typing into the TextInput and watch what happens. If
    the filter method is called multiple times this could be the
    problem.
    Be sure you don't call the filter method until the typing is
    completed.

Maybe you are looking for

  • TS4036 I added Icloud to join my calendar to another person. It erased all history date from previous months. how do I get that data back?

    I added Icloud to join my calendar on my phone to another person. It erased all history date from previous months. how do I get that data back?

  • Can't re-install FCE

    I updated to FCE HD from 2.0.2. The initial install went fine. I was able to use Live Type and Soundtrack fine. Then after making titles in Live Type I started getting a message on the icon and in the viewer after importing the title that said: Media

  • How can I get web page to retain button count values

    Hi, I have a button which, each time it is pressed increments a number. The number is shown in a text box. This all works fine, on my web page. However if I close the web page and then reopen it, the count number goes back to zero. How can I keep the

  • Reverse process on HFM

    Hi... Im trying to do the reverse process on HFM version 9.3 with ODI 11g. Im clic on reverse and the process stuck on the second step of the reverse. What can I do????

  • Poor insert performance

    I am currently facing an issue where an insert into a table is taking ~2hrs to insert 1 M rows. It appears that its due to a foriegn key constraint. is it normal that a ref constraint can slow down things 2X times? because its 2x times faster when i