By default, dialog boxes do not 'remember' the last used values between sessions, but restart with empty fields.
There's a mechanism to load and save last used values. You have to script it in add-ins, individually for each field and for each dialog box.
There are two parts to adjust: one in the script, and another in <objectUI. Both work together and both must be configured exactly as explained below.
In this topic you can find examples of how that is achieved in various dialog boxes.
You have to provide for loading and saving of last used values in scripting, individually for each field and each dialog box. The method dlg.AddParameter as shown below, reads the value for the folder from the specified persistent variable, typically SystemUserOptions.<variablename>. dlg.AddParameter("folderId", <persistent_variable>) Important: this initialization needs to be defined before the line dlg.SetObjectType("...."). The selected value, specified in the dialog box, is saved by the below line, inserted after dlg.ShowDialog(). <persistent_variable> = dlg.FolderId However, the above will work only: •if the init section in the appropriate objectUI is defined accordingly, e.g. again with an example for the folder: <xsl:if test="$pars and $pars/*/add[@key='folderId']"> <gn4:folderRef> <xsl:attribute name="idref"> <xsl:value-of select="fn:objectIdToString($pars/*/add[@key='folderId']/@value)"/> </xsl:attribute> </gn4:folderRef> </xsl:if> •if the appropriate attribute, e.g. folderRef, in the same objectUI has the initMode defined as initMode = "Value": <attribute name="folderRef"> <ui mode="Normal" initMode="Value" label="Select Folder" labelPosition="Side"> <template kind="Tree" refAttributes="folderParent" displayCompletePath="true" xmlns="http://www.teradp.com/schemas/GN4/1/XmlSchemaExt.xsd"> <objectUI> <web refColumnWidth="400" width="200" height="125"/> </objectUI> </template> </ui> </attribute>
|
See also
Copying categories and keywords when merging wire stories