Default Value on Autocompletebox for HTML Client RRS feed

  • Question

  • Hello,

    I wrote a "created" entity method which set defaults for new items for the autocompleteboxes in my silverlight application.

    I did it with this line: 

    entity.vwKagAdressgruppenItem = DataWorkspace.OLDB.vwKagAdressgruppen.Where(grp => grp.Gruppe == "INT").FirstOrDefault();  

    Now I added a HTML Client to the same solution and was hoping that the created Method would work on server side and would be used also for the HTML client, but it does not.

    How can I set the default value for the HTML Client if I use the created method for this client. I think I need only the correct syntax.

    Thank you much.


    Sunday, July 28, 2013 7:53 PM

All replies

  • At the bottom of the entity designer, switch the perspective to your HTML client. Then select the created method from the Write Code drop down. Here, you write your initialization code, but in JavaScript instead of C# because it runs on the client.

    Justin Anderson, LightSwitch Development Team

    Sunday, July 28, 2013 10:36 PM
  • Thank you,

    I know where I have to write the code, but I don't know the syntax for this in JavaScript.

    Could you please give me an example, or a code snippet.

    Thank you.

    Monday, July 29, 2013 7:43 AM
  • Hi,

    could you please give me a short code snippet for that?

    Thank you much.

    Bye Nu

    Sunday, October 13, 2013 11:00 AM