Id: | 11929 |
Product: | finPOWER Connect |
Type: | NEW |
Version: | 2.01.00 |
Opened: | 12/05/2014 |
Closed: | 24/06/2014 |
Released: | 27/06/2014 |
Job: | J013232 |
Page Sets; Can now be shown Modal or Pseudo-Modal and can refresh their Parent form
Page Sets can be launched from an Application Shortcut, e.g., a link on the Client Key Details page, e.g.:
app://PageSet/?id=MyPageSet&ClientPk=123
Previously, there was no way to make the Page Set either Modal or Pseudo-Modal to the form from which it was launched. To accommodate this, two new Parameters can now be added to URLs in Summary Pages. These are 'Modal' and 'PseudoModal', e.g.:
app://PageSet/?id=MyPageSet&ClientPk=123&Modal=True
app://PageSet/?id=MyPageSet&ClientPk=123&PseudoModal=True
When one of these parameters is used, the Page Set can access a special 'ParentForm' parameter, e.g.:
Dim ParentForm As ISFormBaseBL
' Get Parent Form
ParentForm = DirectCast(psh.Parameters.GetObject("ParentForm"), ISFormBaseBL)
' Refresh Parent Form (e.g., to reload Client record)
If ParentForm Is Nothing Then
mUI.MsgBox("No parent form to refresh.", MsgBoxStyle.Exclamation)
Else
ParentForm.Refresh()
End If
The ISFormBaseBL object has the following properties and methods that can be used by the Page Set:
- FieldsLoad method
- Reload information from the form's Source object into the User Interface fields. This is useful if the Page Set has updated (but not saved) the 'Source' object.
- FormKey property
- FormRecordMode property
- The Record Mode of the form, e.g., if the Clients form has a record loaded but is not in edit mode, this will be 'Loaded'.
- NOTE: For forms that do not support changing of records, e.g., the New Account wizard, this will always return 'Loaded'. Also, for Page Sets, many properties of the ScriptInfo object such as FormKey and FormRecordMode are not applicable and will just return default values.
- Refresh() method
- Causes the form to refresh, e.g., in the case of a record-based form such as the Clients form, this will cause the Client record to be reloaded. This is useful if the Page Set has update and saved the underlying record.
- Source property
- This is the source object for the form, e.g., a finClient object for the Clients form.
- NOTE: Only a few forms currently expose a source object, therefore this property may by Nothing.
- The following forms expose this:
- Accounts form (finAccount object)
- New Account wizard (finAccount object)
- Clients form (finClient object)
- New Client wizard (finClient object)
- Security Statements form (finSecurityStmt object)
Page Sets run from an Action Script can access the Parent Form in the same way, providing the Action Script executes the Application Shortcut as per the following example:
Public Function Main(ByVal userInterface As ISUserInterfaceBL, ByVal reports As ISfinReports, ByVal eventId As String, ByVal targetObject As Object, ByVal parameters As ISParameters, ByRef RequiresRefresh As Boolean) As Boolean
Dim ApplicationShortcut As ISApplicationShortcut
' Assume Success
Main = True
' Handle Events
Select Case eventId
Case "Execute"
ApplicationShortcut = finBL.CreateApplicationShortcut()
With ApplicationShortcut
.Action = "PageSet"
With .Parameters
.SetString("id", "MyPageSet")
' Set Modal details
'.SetBoolean("Modal", True)
.SetBoolean("PseudoModal", True)
End With
End With
' Execute Application Shortcut (passing in ParentForm)
' NOTE: Use finBL.ExecuteApplicationShortcut rather than userInterface.ExecuteApplicationShortcut to allow Parent Form to be passed
Main = finBL.ExecuteApplicationShortcut(ApplicationShortcut, Nothing, Nothing, ScriptInfo.Properties.GetObject("ParentForm"))
End Select
End Function
NOTE: If the ParentForm is included when executing the Application Shortcut as per the above example, then the Page Set will be displayed Pseudo-Modal if neither Modal or PseudoModal parameters are specified or are both set to False.