NJX:NJXFILEUPLOAD2

The NJX:NJXFILEUPLOAD2 control is used to upload files from the client to the Natural server. The rendering is identical to the FILEUPLOAD2 control.

To use the NJX:NJXFILEUPLOAD2 control, you must also add an NJX:OBJECTS control to your page layout because the uploaded file will be added to the NJX:OBJECTS data structure. Once a file is uploaded, the Natural application can refer to the file via the CONTENTID of the uploaded object.

The following topics are covered below:

Note:
See also Documents in Some Common Rules for all Controls.


Example

Example

The XML layout definition is:

<itr>
   <njx:njxfileupload2 width="400" valueprop="myupload" 
        withsubmitbutton="true" submitbuttonname="Upload to Natural">
   </njx:njxfileupload2>
</itr>

Adapter Interface

1 MYUPLOAD 
2 CEXT (A) DYNAMIC
2 CNAME (A) DYNAMIC
2 CONTENTID (A) DYNAMIC
2 CPATH (A) DYNAMIC

When uploading a file, the client-side file name, extension and path are provided in the CNAME, CEXT and CPATH fields, respectively. The Natural application can optionally specify a CONTENTID for the NJX:OBJECTS data structure. If CONTENTID is not specified, a concatenation of file name and extension is automatically set as the CONTENTID value.

Built-in Events

When you choose the Upload to Natural button in the above example, the value-of-valueprop.onUploadFinished event is triggered in the Natural application. When this event is triggered, the CNAME, CEXT, CPATH and CONTENTID fields are filled, and the file content is provided in the data structure of the NJX:OBJECTS control.

Properties

Basic
valueprop

Name of the adapter parameter that provides the content of the control.

Optional  
width

Width of the control.

There are three possibilities to define the width:

(A) You do not define a width at all. In this case the width of the control will either be a default width or - in case of container controls - it will follow the width that is occupied by its content.

(B) Pixel sizing: just input a number value (e.g. "100").

(C) Percentage sizing: input a percantage value (e.g. "50%"). Pay attention: percentage sizing will only bring up correct results if the parent element of the control properly defines a width this control can reference. If you specify this control to have a width of 50% then the parent element (e.g. an ITR-row) may itself define a width of "100%". If the parent element does not specify a width then the rendering result may not represent what you expect.

Optional

100

120

140

160

180

200

50%

100%

height

Height of the control.

There are three possibilities to define the height:

(A) You do not define a height at all. As consequence the control will be rendered with its default height. If the control is a container control (containing) other controls then the height of the control will follow the height of its content.

(B) Pixel sizing: just input a number value (e.g. "20").

(C) Percentage sizing: input a percantage value (e.g. "50%"). Pay attention: percentage sizing will only bring up correct results if the parent element of the control properly defines a height this control can reference. If you specify this control to have a height of 50% then the parent element (e.g. an ITR-row) may itself define a height of "100%". If the parent element does not specify a width then the rendering result may not represent what you expect.

Optional

100

150

200

250

300

250

400

50%

100%

ihtmlstyle

CSS style definition that is directly passed into this control.

With the style you can individually influence the rendering of the control. You can specify any style sheet expressions. Examples are:

border: 1px solid #FF0000

background-color: #808080

You can combine expressions by appending and separating them with a semicolon.

Sometimes it is useful to have a look into the generated HTML code in order to know where direct style definitions are applied. Press right mouse-button in your browser and select the "View source" or "View frame's source" function.

Optional

background-color: #FF0000

color: #0000FF

font-weight: bold

comment

Comment without any effect on rendering and behaviour. The comment is shown in the layout editor's tree view.

Optional