locked
Html Client :How to call the default screen for a specific entity type or get the name of the default screen? RRS feed

  • Question

  • In both the silverlight and html client, in the entity designer you can specify a default screen.

    In the silverlight client, it's possible to use this information implicitely, by calling:

    Application.Current.ShowDefaultScreen (myIEntityObject);

    Is there something similar in the html client.

    Or is it possible to simply retrieve the name of a default screen for a given entity type in javascript in such a way it can be used in myapp.showScreen("myscreenName", [...]);

    thx

    paul.


    paul van bladel

    Tuesday, May 6, 2014 4:19 PM

Answers

  • ok, found it :)

    var defaultScreen = entity.details.getModel()[":@DefaultScreen"].value.name;

    This defaultScreen can be used in the showScreen method.

    Still wondering if there is a way to call an autogenerated view when there is no default screen.


    paul van bladel

    • Marked as answer by Angie Xu Thursday, May 15, 2014 1:48 AM
    Tuesday, May 6, 2014 5:52 PM

All replies

  • ok, found it :)

    var defaultScreen = entity.details.getModel()[":@DefaultScreen"].value.name;

    This defaultScreen can be used in the showScreen method.

    Still wondering if there is a way to call an autogenerated view when there is no default screen.


    paul van bladel

    • Marked as answer by Angie Xu Thursday, May 15, 2014 1:48 AM
    Tuesday, May 6, 2014 5:52 PM
  • Still wondering if there is a way to call an autogenerated view when there is no default screen.
    Hi Paul I don't understand the question. Could you elaborate? What do you mean call an autogenerated view ?
    Wednesday, May 7, 2014 9:52 PM
  • I'm wondering the same as there are no auto generated views in the HTML client that I am aware of?

    Regards, Xander. My Blog

    Wednesday, May 7, 2014 11:31 PM
  • @ Josh,

    In the silverlight client there is a method ShowDefaultScreen (IEntityObject) which can based on an entity open the default view screen.

    In the entity designer you can specify which screen is the default screen (since there can be multiple view screens or even : no view screen).

    In the case there is no view screen created, the silverlight client manages to create one in run time.

    In the html client it's quite easy to mimic the behavor of the ShowDefaultScreen functionality. But it seems that the html client cannot create in runtime a view screen, in the case no default view screen has been created in design time.


    paul van bladel

    Thursday, May 8, 2014 1:42 PM
  • Oh, Thanks Paul I learned something.  Didn't realize SL client did that.  HTML does not - that I know of.  I'll let you know if I find something similar.  PS...First place to look is in model.json in bin directory then check in viewmodel.js in generated scripts.

    Thursday, May 8, 2014 1:52 PM
  • It's been a while, and cannot remember the proper terminology, but doesn't the SL client automatically add 'clickable links' for 'navigation properties' - at least for 'summary controls'.  Thus, necessitating the autogenerated view screen.

    I think in HTML client, you have to specifically set the tap action which brings up the 'convenience methods' (ie: viewSelected) at which point selecting '(new screen)' creates the screen. 

    So you're right, in lieu of 'autogenerated' screens, and since tap actions are not added automatically, the closest thing to an autogenerated screen is that created at design-time when tap actions are setup.

    Common Screen Sets are an exception to this since tap actions are all setup automatically, but still screens are created at design time.

    Thursday, May 8, 2014 2:13 PM