A push button in a dialog window that allows the user to select a folder from the file system. When the user presses the button, a Browse window appears that shows the folder hierarchy of the computer's file system.
Example
In this example:
•directory specifies the directory that is selected by default when the user enters the Browse window. •resultTo specifies that the folder selected in the Browse window is passed to a text box in the dialog. •resultFrom specifies that if the text box already contains a folder path, this path must be selected by default when the user enters the Browse window.
<example xmlns:pc="Processing.Command" xmlns:assign="Processing.Command.Assign" pc:hideme="true">
<pc:assign-var-default
somepath = "{path:GetFullPath(path:Combine('..'))}" />
<pc:Dialog
assign:proceed="/Forms/Form/@result='OK'"
assign:path = "/Forms/Form/TextBox[1]/text()">
<Form>
<Title>Specify a path</Title>
<Label dx="5" dy="5" w="30">Path:</Label>
<TextBox w="400" name="pathbox"><pc:value-of select="$somepath"/></TextBox>
<FolderButton
dx="10" w="90" h="20" directory="{$somepath}"
resultTo="pathbox" resultFrom="pathbox">Folder...</FolderButton>
<Button dy="20" newline="true"><Result>OK</Result>Proceed</Button>
<Button><Result>Cancel</Result>Cancel</Button>
</Form>
</pc:Dialog>
<pc:if test="xslutil:test($proceed)">
<pc:then>Ok: <pc:value-of select="$path"/></pc:then>
<pc:else>Cancelled</pc:else>
</pc:if>
</example>
|
See also
pc:Dialog
|