1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    7
    Vote Rating
    0
    apart is on a distinguished road

      0  

    Default Assign global variable value to config.text

    Assign global variable value to config.text


    Hi, I'd like to assign a value stored in a global variable (i.e. Lang.BUTTON_TEXT) to a config.text field. I can't seem to be able to do this in Architect - all the values are interpreted as strings. Is there any way to get around this? Or can you suggest a better way of localizing my app? Thanks.

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,310
    Vote Rating
    112
    ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice

      0  

    Default


    1. Write an override.
    2. Set the value in afterRender event of the component.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    7
    Vote Rating
    0
    apart is on a distinguished road

      0  

    Default


    Yeah, that's what I was doing, but it doesn't seem too elegant, does it?

  4. #4
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,310
    Vote Rating
    112
    ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice

      0  

    Default


    Quote Originally Posted by apart View Post
    Yeah, that's what I was doing, but it doesn't seem too elegant, does it?
    As matter of fact I think #2 is the correct way to go since value is editable, I mean, must be entered by the user and what you want to do is put a default value which will be edited by the user so that property shouldn't be confugured by object expression as you want.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  5. #5
    Sencha User
    Join Date
    Dec 2009
    Posts
    7
    Vote Rating
    0
    apart is on a distinguished road

      0  

    Default


    Nope, it's not an editable field. It's the title property for a toolbar or in fact any string in the app that I need to localize. Seems like an overhead to override each class just to substitute the strings.

Thread Participants: 1