locked
Populate a list with an entity's property's children? RRS feed

  • Question

  • That title wasn't very good.  Let me use an example.

    I've created a BrowseDivision screen.  'Division' has a 'Supervisor' property, another entity.  'Supervisor' in turn, has a collection of 'Equipment' entities they keep track of.

    In the Browse Division screen, how best can I list all the Equipment entities that the Supervisor keeps track of?  I can drag and drop any individual property of the Supervisor onto the screen, but a collection of theirs?  Do I do something like:

    screen.Division.getSupervisor().function success(result) {...

    where the ellipses is where things get hazy for me?  I'll get back a Supervisor entity, but do I then call result.getEquipment() and go from there?

    How can I populate a list of Equipment from the Division's Supervisor on this screen?


    Monday, March 28, 2016 6:27 AM

Answers

  • HI Jim,

    If you just need to display the collection on the browse screen, then try one of these tow options:

    I cannot recall for certain if you can simply drag nav props two levels deep, but you may be able to drag the Supervisor.Equipment property and it will create a rows layout of equipment collection.  You may have to first select the query and choose Manage Included Data then choose to include Equipment.

    If that doesn't work out, the next option would be to create a new query on Equipment having a parameter Supervisor.ID.  Add that query to your browse screen and bind the parameter to Division.Supervisor.ID.  Then you can drag from equipment query.

    HTH,

    Josh

    • Marked as answer by jim bancroft Tuesday, March 29, 2016 8:15 PM
    Monday, March 28, 2016 1:22 PM

All replies

  • HI Jim,

    If you just need to display the collection on the browse screen, then try one of these tow options:

    I cannot recall for certain if you can simply drag nav props two levels deep, but you may be able to drag the Supervisor.Equipment property and it will create a rows layout of equipment collection.  You may have to first select the query and choose Manage Included Data then choose to include Equipment.

    If that doesn't work out, the next option would be to create a new query on Equipment having a parameter Supervisor.ID.  Add that query to your browse screen and bind the parameter to Division.Supervisor.ID.  Then you can drag from equipment query.

    HTH,

    Josh

    • Marked as answer by jim bancroft Tuesday, March 29, 2016 8:15 PM
    Monday, March 28, 2016 1:22 PM
  • Thanks again Josh, your second suggestion did the trick.  Earlier I had tried dragging the the Supervisor property on the screen, as you suggested, and the Equipment collection did not appear in the listing along the the 'first order' properties belonging to Supervisor.


    Tuesday, March 29, 2016 8:15 PM
  • Sorry to resuscitate this one, but I'm still having a bit of trouble.  To clarify things a bit, this screen has a single 'Division' entity passed to it from another screen as a parameter.

    As Josh suggested, I created a new query on Equipment with an integer parameter of Id and added it to the screen. 

    I then bound this query's Id parameter to Division.Supervisor.ID.  So far so good.

    However, when I drag the new Equipment query onto the screen for display, nothing appears.  It's not until I drag the Division entity on the screen (in a Row or Column display, either) and *then* add the Equipment fields beneath this that the Equipment fields will appear.

    This isn't quite what I'd hoped for-- what I'm really after on this screen is only showing the Equipment records related to this Division.  But as it stands I have to nest this Equipment info beneath the Division information.  I'm not showing any Division fields when I do so, but the nesting is there and it looks awkward on the screen, an equipment Row display nested in another Row display which is empty.

    Just wondering if there's a good way to handle this scenario.  Let me know if I can clarify things further.  Thanks!

    Monday, April 4, 2016 8:25 PM