11.popups - View and Edit

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Popups: View and Edit

Student Exercise
Popups: View and Edit - Student Exercise

Popups: View and Edit


“Currently, users can add, remove, and edit contact interactions on the Interactions page in the
Interactions list view panel. However, the editable list view panel on the page only exposes some of the
Interaction entity fields. Configure a popup that will allow users to view and edit all the fields of a contact
interaction.” – Insurance company business analysts

As a configuration developer, you want to be able to create, configure and open popup locations so that
the users can see and/or edit more information about an object. In this lab, you will first create the
Interaction Popup. The popup will allow users to edit and view an interaction. Next, you will modify the
Summary cell widget in the InteractionsLV, so that clicking it navigates to the popup.

Prerequisites
You must first complete the following previous lesson(s):

1. Creating New Entities


2. List Views
3. Editable List Views
4. Typelists

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 2


Popups: View and Edit - Student Exercise

For this lab, use TrainingApp, Guidewire Studio, and a supported web browser.
http://localhost:8880/ab/ContactManager.do is the default URL for TrainingApp. To view,
edit, and delete various contacts, log in to TrainingApp as Alice Applegate. The login/password for Alice
Applegate is aapplegate/gw.

Lab: Popup locations


5. In Project View, create the Interaction_ExtPopup in the traininglabs PCF folder

Create the traininglabs PCF folder if it doesn’t exist


For the Popup, set the startInEditMode and canEdit properties to true
To the Popup, add an inline Screen and an inline Detail View
To the inline Detail View, add editable atomic widgets for the following Interaction_Ext fields:
 Interaction Date
 Initiated By Contact
 Channel Type
 Summary
 Associated User
 Interaction Reason
6. Modify the Interactions_ExtLV.pcf

Modify the cell widget for the Summary field to be a navigable link to the editable Interaction Popup.
The Popup should display the entity from the row that the user clicked on.

Note: Use your best judgment for field ordering, display keys, and input widget selection. Review the
Atomic Widgets lesson for more details if needed.

Guidewire API
The startInEditMode property

If this property is set to true then the location will open in edit mode allowing the user to modify the data
immediately. If the property is set to false then the location will open in read-only mode and the user will
need to click on the edit button to edit the details. This property could be also set dynamically, e.g. based
on an expression, result of a function call or a parameter received from the parent location in case of
Popups.

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 3


Popups: View and Edit - Student Exercise

Guidewire API
The canEdit property

This property determines if the location (and any containers inside it) can or cannot be in edit mode. If the
startInEditMode property is set to true or the location has a Toolbar and Edit Buttons widget then the
canEdit property must be set to true. The default value is false.

Hint
Referencing the object associated with a row

When you click on a cell in a row, you want to open the popup and pass in the object that is associated
with that specific row. Remember, the variable defined in the elementName attribute of the Row Iterator is
always the variable that will store that associated object. As a configuration developer, you don’t have to
worry about indexes. You can just simply reference the variable and the PCF framework will determine
which object from the array is associated with that row the user clicked on.

Review
Navigating to a location

Review the Introduction to Locations lesson if you need tips on how to define navigation in Guidewire
applications.

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 4


Popups: View and Edit - Student Exercise

Activity
Verify the work you have done

1. Log in to TrainingApp as Alice Applegate

Use the appropriate shortcut to reload the PCF changes


Edit the Interactions page for William Andy
Open the William Andy contact
In the sidebar menu, click Interactions
If you previously did not create an interaction, create at least one interaction now in the list view
panel
Click Edit then click Add
Enter a date, a reason, and select a user
Click Update
For an interaction row, click an interaction reason link
Edit all editable fields in the Interaction Popup
Click Update

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 5


Popups: View and Edit - Student Exercise

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 6


Popups: View and Edit - Student Exercise

Lab Solution: Popup locations

Solution
Exact details on how to complete the lab.

1. Create the traininglabs PCF folder if it doesn’t exist


2. Create the Interaction_ExtPopup

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 7


Popups: View and Edit - Student Exercise

3. Add an inline Screen container and set the following properties: startInEditMode, canEdit,
title

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 8


Popups: View and Edit - Student Exercise

4. Specify an entry point with a single Interaction_Ext parameter

5. Specify a variable for the parameter (same name and same type)

6. Add a toolbar and edit buttons

From the toolbox, drag and drop a Toolbar into the screen you just added.
Drag and drop an Edit Buttons widget into the toolbar.
7. Add a detail view

Drag and drop a Detail View below the Toolbar widget


The widget is colored red because the Detail View must contain an Input Column or a Table Layout.
You’ll fix this in the next step.
8. Add an Input Column

Drag and drop an Input Column widget into the Detail View.
Notice that the Detail View is no longer red.

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 9


Popups: View and Edit - Student Exercise

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 10


Popups: View and Edit - Student Exercise

9. Add an input for the Interaction Date field

Drag and drop a Date Input into the Input Column.


Set the editable property to true.
Set the id property to InteractionDate.
Set the label property to DisplayKey.get("Ext.InteractionDate"). This display key was created an
earlier lab. If it does not exist, create it at this point.
Set the value property to anInteraction.InteractionDate.
10. Add an input for the Initiated by Contact field

Drag and drop a Boolean Radio Button Input into the Input Column below the Interaction Date
input.
Set the editable property to true.
Set the id property to InitiatedByContact.
Set the label property to DisplayKey.get("Ext.InitiatedByContact "). This is a new display key, so
create it using Studio.
Set the value property to anInteraction.InitiatedByContact.
11. Add an input for the Channel Type field

Drag and drop a TypeKey Input into the Input Column below the Initiated By Contact input.
Set the editable property to true.
Set the id property to ChannelType.
Set the label property to DisplayKey.get("Ext.ChannelType").
Set the value property to anInteraction.Channel.
Notice that the valueRange and valueType fields were automatically entered.
12. Add an input for the Summary field

Drag and drop a Text Input into the Input Column below the Channel Type input.
Set the editable property to true.
Set the id property to Summary.
Set the label property to DisplayKey.get("Ext. Summary").
Set the value property to anInteraction.Summary.
13. Add an input for the Associated User field

Drag and drop an Alt User Input into the Input Column below the Summary input.
Set the editable property to true.
Set the id property to AssociatedUser.

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 11


Popups: View and Edit - Student Exercise

Set the label property to DisplayKey.get("Ext.AssociatedUser").


Set the value property to anInteraction.AssociatedUser.
14. Add an input for the Interaction Reason field

Drag and drop a Range Input into the Input Column below the Associated User input.
Set the editable property to true.
Set the id property to ReasonType.
Set the label property to DisplayKey.get("Ext.ReasonType").
Set the value property to anInteraction.Reason.
Notice that the valueRange and valueType fields were automatically entered.
15. The completed popup should look like this screenshot:

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 12


Popups: View and Edit - Student Exercise

16. On Interactions_ExtLV, configure the action property of the Summary cell to open the
Interaction_ExtPopup

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 13

You might also like