Scripting the desktop clients
The Content Manager metadata configuration supports embedding scripts. When the script is loaded, any defined function is compiled using .NET Framework and is executed at run-time.
navtitle attribute.
This is a private API which can be changed without prior notice. For internal use only.
How it works
Scripting support consists of three processes:
- Load Form reading XML and loading the scripts.
- Handle Events executing the scripts.
- Close Form unloading the scripts and cleanup the assembly.
Enabling scripting support
Client scripting is enabled by default through the Trisoft.Scripting.EnableScript setting in the application configuration file.
Linking two metadata fields through scripting
In the script below, the Navigation Title (NavTitleField) in the Insert Values dialog for Topic Ref to Topic inherits the value of the HREF Title (HRefField) when changed.
<ishfrm id="Dita.TopicRefToTopic.Form">
...
<ishfrmfield name="HRefField" ishfieldref="XMLID" level="content" ishfielddatatype="typereference" valuechanged="Field_ValueChanged">
<label>HRef</label>
...
<script language="Visual Basic">
<![CDATA[
Public Sub Field_ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
If (Not String.IsNullOrEmpty(Me.DisplayText)) Then
If (Me.Form.Fields.Contains("NavTitleField")) Then
Dim navTitleField As Field = Me.Form.Fields("NavTitleField")
navTitleField.SerializedValue = Me.DisplayText
End If
End If
End Sub
]]>
</script>
</ishfrmfield>
<ishfrmfield ref="NavTitleField"/>
<ishfrmfield ref="ConditionField"/>
...