Announcement Announcement Module
Collapse
No announcement yet.
Localization post processor and 'headerText' Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment


        • #5
          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.

          Comment


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

            Comment


            • #7
              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

              Comment

              Working...
              X