Filepicker - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki

<FILEPICKER/> : : Widget : File

The <FILEPICKER/> widget opens the native filepicker allowing the user to select a file from the underlying operating system. It is somewhat unique in that is both a display widget as well as a file data source.

Attributes

Name Type Default Description Req
allow string The filetype extensions allowed by the filepicker, comma seperated string.

Events

Name Description
onstart A list of ; separated event's to evaluate and execute when the filepicker is launched
ondismissed A list of ; separated event's to evaluate and execute when the filepicker closes

Methods

Name Type Description
launch() Opens the filepicker

Examples

<FML>
	<COL halign="center" visible="=noe({formdata.data.F20060})">
		<FILEPICKER allow=".png,.jpg,.jpeg" id="f1" onsuccess="toast('Image uploaded')" onfail="toast('Upload error, please retry')"/>
		<BUTTON onclick="f1.start();">

			<BOX expand="false" maxwidth="300" border="all" bordercolor="=!noe({f1.data.file}) ? green : 'orange'" padd="20">

				<ICON icon="camera" visible="=noe({f1.data.file})"/>
				<IMAGE width="250" url="={f1.data.file}" visible="=!noe({f1.data.file})"/>
			</BOX>

		</BUTTON>
		<TEXT value="Image captured, tap to retake" color="grey" visible="=!noe({f1.data.file})"/>
	</COL>
</FML>

An example of FILEPICKER tied to a button.

(fig. a)

FilepickerExample

(img. a)

Other Widgets You May Find Useful:

⚠️ **GitHub.com Fallback** ⚠️