locked
New project LS generated tables / screen Grey Matter RRS feed

  • Question

  • Okay on to the next phase of my project and I seem to always find interesting things to puzzle me.

    I built two tables in LS native (no funny stuff no legacy data) Then built a Common Screen Set and it create the three expect renditions of an Add, Browse, and View screen I wanted to test it out to see before I went further and made the Add screen home and fired it up. Interestingly enough this is what I got. By the way. The example I leave you here is every bit as functional as what was on my screen as well...

    The text boxes are completely greyed out and none functional.  So the Add screen is pretty much worthless.  What switch did I miss that I should have flipped?

    Regards,

    Ken...


    Ken Carter

    Monday, October 5, 2015 7:59 PM

Answers

All replies

  • Set the Browse screen as the home screen and then click the Add button on that screen.

    Unleash the Power - Get the LightSwitch HTML Client / SharePoint book

    http://LightSwitchHelpWebsite.com

    • Proposed as answer by joshbooker Monday, October 5, 2015 8:34 PM
    • Marked as answer by kencar Monday, October 5, 2015 8:34 PM
    Monday, October 5, 2015 8:26 PM
  • That's what got me what is there.

    Ken Carter

    Monday, October 5, 2015 8:29 PM
  • I take that back.. I didn't.. thank you! duh... so browse is the key to add... interesting. thanks!

    Ken Carter

    Monday, October 5, 2015 8:34 PM
  • ... so browse is the key to add... interesting.

    Hi Ken,

    AddEdit screens need the entity to be 'passed in' when the screen opens.

    The Add button on Browse screens from 'common screen set' do this out-of-the-box. 

    Alternatively, you can do the same with a custom button by choosing the addEditNew 'suggested method' from the new button dialog.  Lastly, you can create the new item in js code and pass it using beforeShown argument of showScreen or in the screen _created method like so (air-code not tested):

    myapp.AddEditElement.created = function(screen){

    if (!screen.Element) screen.Element = new myapp.Element();

    };

    Monday, October 5, 2015 10:59 PM
  • Great stuff guys... Was able to test it and create new records then come back and edit them successful. Next pairing will be the table with the multi-tabbed details for these, but I'm pretty sure that I've garnered enough insight from these exercises to get through that without a lot of issues at all. Then tie this back with the legacy piece I brought up last week and the whole thing comes together, very nice.

    Ken Carter

    Tuesday, October 6, 2015 12:51 PM