locked
How to change the Details Picker column according to the browser language setting RRS feed

  • Question

  • I am Localizing my LightSwitch HTML Client Application, however I have a problem with my Related Catalog Tables

    In my case I have a table Sex Catalog related to my table Person

    I need to keep it as table since I am developing an new module of an existing application. I don't want to duplicate my catalogs creating the choice lists in LightSwitch app

    The sex catalog table has for columns (Title, Code, Title_Fr, Title_De), translations to french and german are in column Title_fr, Title_de

    The relationship with Person is 0..1 with Code.

    When I create the Add/Edit screen for Person, the Sex Dialog displays as value the column Title. Which is OK when the language is English.

    But I need this Dialog changing to the column Title_fr when the browser language setting is in French or Title_de when the browser language setting is in German.

    It is possible to select/change the Details Picker column according to the browser language setting?

    Any help is welcome!

    Tuesday, May 27, 2014 10:29 PM

Answers

  • Beneath the Details Picker is a child control which is displayed as a popup when you click the plus sign. 

    By default this is a Summary Control.  To change the displayed property in the summary control you must change the Summary Property of the respective table which cannot be controlled at runtime so that's no help for you.

    Alternatively, you can change the Summary Control (beneath the Details Picker in the screen designer) to a Rows Layout and add a CustomControl beneath the Rows Layout.  Bind the CC to the selectedItem of Details Picker screen data.  Now in the _render method handle the browser language switch to render the respective property.

    HTH,

    Josh

    • Proposed as answer by Angie Xu Thursday, June 5, 2014 12:09 PM
    • Marked as answer by Angie Xu Friday, June 6, 2014 1:39 AM
    Wednesday, May 28, 2014 1:52 AM

All replies

  • Beneath the Details Picker is a child control which is displayed as a popup when you click the plus sign. 

    By default this is a Summary Control.  To change the displayed property in the summary control you must change the Summary Property of the respective table which cannot be controlled at runtime so that's no help for you.

    Alternatively, you can change the Summary Control (beneath the Details Picker in the screen designer) to a Rows Layout and add a CustomControl beneath the Rows Layout.  Bind the CC to the selectedItem of Details Picker screen data.  Now in the _render method handle the browser language switch to render the respective property.

    HTH,

    Josh

    • Proposed as answer by Angie Xu Thursday, June 5, 2014 12:09 PM
    • Marked as answer by Angie Xu Friday, June 6, 2014 1:39 AM
    Wednesday, May 28, 2014 1:52 AM
  • Thank for the reply and the suggestion. I will try it right away and come back with my results.
    Thursday, May 29, 2014 8:06 PM