Use panels in a Find-Manage Wizard
Use panels in a Find-Manage Wizard
Technologies > User Interface Add-Ins > Assemblies with Multiple Panes > Find-Manage with Panels
The Find-Manage assembly allows the user to review the list of data records and view, edit, add, or delete individual records. When used with multiple panels, this assembly provides all pieces of information on the single screen.
A typical Find-Manage assembly has two panels – a report and a form:
<view version="2.0">
<layout file="2panels.axvw" />
<title translatable="true">Find-Manage Assembly</title>
<dataSource>
<table name="activity_log" role="main" />
<field name="activity_log_id" table="activity_log" />
<field name="action_title" table="activity_log" />
</dataSource>
<panel type="grid" id="action_report" region="west">
<title translatable="true">Action Items</title>
<action id="refresh">
<title>Refresh</title>
<tooltip>Click to Refresh the Grid</tooltip>
<command type="showPanel" panelId="action_report" />
</action>
<action id="addNew">
<title>Add New</title>
<tooltip>Click to add new record</tooltip>
<command type="showPanel" panelId="action_form" newRecord="true"/>
</action>
<field name="activity_log_id" table="activity_log" controlType="link">
<command type="showPanel" panelId="action_form" />
</field>
<field name="action_title" table="activity_log" />
</panel>
<panel type="form" columns="1" id="action_form" showOnLoad="false" region="center">
<title>Action Item</title>
<action>
<title>Save</title>
<command type="saveForm"/>
</action>
<field name="activity_log_id" table="activity_log" />
<field name="action_title" table="activity_log" />
</panel>
</view>
A record selected in the report is displayed by the edit form:
<field name="activity_log_id" table="activity_log" controlType="link">
<command type="showPanel" panelId="action_form" />
</field>
The
activity_log.activity_log_id
column values
in all report rows are displayed as links. When the user clicks on the
link, the
showPanel
command takes
the primary keys of the selected report row and applies them as a restriction
to the edit form, so that the edit form displays the selected record.
Before the user selects a record in the report, the edit form does not display any data and all buttons on the form are disabled:
<panel type="form" id="action_form"
showOnLoad="false"
>
...
</panel>
The report panel can display a button to open a new record for editing
in the form.
<action id="addNew">
<title translatable="true">Add New</title>
<command type="showPanel" panelId="action_form"
newRecord="true"
/>
</action>
The edit form can display buttons to:
- Save the current record changes
- Delete the current record
- Cancel editing, which hides the form data and disables form buttons.
<action id="save">
<title translatable="true">Save</title>
<command type="saveForm"/>
</action>
<action id="delete">
<title translatable="true">Delete</title>
<command type="deleteRecord"/>
<command type="showPanel" panelId="action_form"
show="false"
/>
</action>
<action id="cancel">
<title translatable="true">Cancel</title>
<command type="showPanel" panelId="action_form"
show="false"
/>
</action>
When necessary, the edit form can include buttons that refresh the records
displayed in the report or in any other view panel:
<action id="delete">
<title translatable="true">Delete</title>
<command type="deleteRecord"/>
<command type="showPanel" panelId="action_form"
show="false"/>
<command type="showPanel" panelId="action_report"
applyParentRestriction="false"/>
</action>
The
applyParentRestriction
attribute
should be used to make sure that the edit form does not apply its record
restriction to the report. Typically the restrictions should be propagated
only when the user drills down.
Find-Manage assemblies can include additional panels with report and
form panels when the user needs to drill though multiple tiers of data
records. The user navigation and passing restrictions between multiple
panels is handled using the
showPanel
command.
Create per-row Action buttons and links