In this Lesson
You will learn how menu items can be hidden until an entity appears in the session.
Sometimes you may have items on a menu which only apply to the the ‘current item’ they are working with. Consider the following example.
The entries for Menu Items and Guest List should only appear after a party has been selected because they are designed to operate on the currently selected party.
In Soiree terms a party is an entity as described in the Entity Definitions lesson. When the user selects an entity its keys are placed into the session context. The Soiree menu manager has the ability to filter menu items by the presence or absence of an entity’s keys.
Try it out
In this exercise you will learn how to control the visibility of a scene menu item by using session context.
Before we begin let’s prepare the Party Definition scene so that it can be closed.
- Open the PartyDefinition scene
- Add a Close button to the scene
- Right-click the button and modify its properties to Close All layers
- Save the scene
Now let’s create a menu that is controlled by the presence of an entity’s keys in the session.
- Open the PartyPool solution
- The Primary Menu should look like this
- Drag the PartySplash to create a new scene item in the Party Pool main menu
Provide the following values for the item
The menu should now look like this
- Notice the menu item shows an E indicating it has an entity assigned to it.
- Save the solution definition
When an entity is assigned to a scene menu item it will only be displayed if the entity’s keys exist in the session.
Let’s test that now.
- Start Derby and the Server if they are not already running.
- Start the PartyPool solution.
- Sign on with user=editor pw=editor
- Notice the newly added Party Splash – With Entity sub-menu is not on the main menu because a party has not been selected yet.
- Select the Party Scenes sub-menu
- Select the Party Definitions scene
- Select one of the parties
- Close the scene
- Navigate back up to the main menu
- The new item is now displayed because a party has been selected
That’s all for this lesson.