Results 1 to 7 of 7

Thread: Localization post processor and 'headerText'

  1. #1
    Join Date
    Aug 2006
    Posts
    8

    Default Localization post processor and 'headerText'

    In a DataGrid, I give a DataGridColumn and 'id' of "myColumn" and then in the "myBundle.properties" there is an entry of "myColumn_headerText=Header". Shouldn't that put "Header" in for the 'headerText' for that column auto-magically? It already works for labels, toolTips etc. in other components but 'headerText' does not appear to work eventhough the documentation says it is in the "default" list of property names looked for by the "...LocalizationStageProcessor".

    Thanks,

    Todd
    - Todd

  2. #2
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default datagridcolumn not uicomponent

    Hey there,

    yep, the datagrid column headers are a bit of an exception. They are not a regular UIComponent that gets added to the stage, so there won't be an ADDED_TO_STAGE event and hence the stageprocessor won't pick it up.
    This is simply a nasty exception to the rule, I'm not sure yet how to solve this, for now you'll have to inject the text manually through the resourceManager I'm afraid.

    cheers,

    Roland

  3. #3
    Join Date
    Aug 2006
    Posts
    8

    Default Thanks

    Ok, that's what I thought. I did injected localization on another project myself the same way, I had to add some code to an overridden LocalizedDataGrid to get the 'headerText' at the right time there.

    Thanks,

    Todd
    - Todd

  4. #4
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default

    Hey Todd,

    when I find the time I'll see if I can add some kind of exception to the localization prcoessor that'll check if a datagrid is added to the stage, and if so, will check its columns and inject them accordingly.
    If you have any suggestions on how to implement this, then any help will be greatly appreciated.

    cheers,

    Roland

  5. #5
    Join Date
    Aug 2006
    Posts
    8

    Default

    I'll piddle with this weekend and try to remember what I did. It was another company I don't have that code anymore. Unfortunately, I seem to remember that the column "id" field proved to be problematic when columns were adding so I had to do something more hacky. I'll let you know if I discover anything good.
    - Todd

  6. #6
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default

    thanks a lot for taking the time Todd, its greatly appreciated!

  7. #7
    Join Date
    Aug 2006
    Posts
    8

    Default

    Yes, now I remember. In Flex, it allows you to assign an 'id' to the columns but "DataGridColumn" objects don't actually have an 'id' property so it bombs. I ended up putting and id-like value in the header text for the columns and replaced the headerText with the value for the localizaiton file. Not very elegant but without knowing a unique identifier for the DataGridColumn, I didn't know another way.

    <mxataGridColumn headerText="nameColumn"... />

    nameColumn_headerText=Name

    But you only get one chance to localize it. After that you lose the "key". I'll give it some more thought. If you can think of some "tag" that can be put on the column, lemme know.

    Todd
    - Todd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •