NJX:NJXFILEDOWNLOAD

The NJX:NJXFILEDOWNLOAD control is used to add a link to your page layout for downloading files from the Natural server to the client.

To use the NJX:NJXFILEDOWNLOAD control, you must also add an NJX:OBJECTS control to your page layout.You can link to all files available in the NJX:OBJECTS cache. The link is directly passed to the browser. To force the browser to download a file instead of opening it, you append the parameter DOWNLOAD=true to your link (for example, "nat:mydoc?DOWNLOAD=true"). The CONTENTID of the file in the NJX:OBJECTS cache will be used as a suggestion for the name of the downloaded file. You can also refer to files outside of the NJX:OBJECTS cache by using a normal browser link. In this case, the DOWNLOAD parameter is not evaluated by the Natural for Ajax framework.

To trigger a download from another control (for example, from a BUTTON control), you have to use the SUBPAGE control instead. See the Natural for Ajax demos for an example.

Note:
The NJX:NJXFILEDOWNLOAD control is only supported for the HTML client. It is not supported for the SWT Client.

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>
   <label name="Download Link" width="100">
   </label>
   <njx:njxfiledownload  valueprop="mydownload" >
   </njx:njxfiledownload>
</itr>

When you choose the Download from Natural link in this example, the file download dialog from your operating system appears.

Adapter Interface

1 MYDOWNLOAD 
2 LINKPROP (A) DYNAMIC
2 NAMEPROP (A) DYNAMIC

Properties

Basic
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%

valueprop

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

Optional  
withsubmitbutton

If set to "TRUE" adds an additional button to the control to start the file upload.

Optional

true

false

submitbuttonname

The name of the submit button in case WITSUBMITBUTTON is set to "true".

Optional  
submitbuttontextid

"Textid" for the name of the submitbutton if WITHSUBMITBUTTON is set to "true".

Optional  
comment

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

Optional  
Binding
valueprop (already explained above)    
visibleprop

Name of the adapter parameter that provides the information if this control is displayed or not. As consequence you can control the visibility of the control dynamically.

Optional  
invisiblemode

If the visibility of the control is determined dynamically by an adapter property then there are two rendering modes if the visibility is "false":

(1) "invisible": the control is not visible.

(2)"cleared": the control is not visible but it still occupies space.

Optional

invisible

disabled

cleared

Appearance
invisiblemode (already explained above)    
rowspan

Row spanning of control.

If you use TR table rows then you may sometimes want to control the number of rows your control occupies. By default it is "1" - but you may want to define the control to span over more than one columns.

The property only makes sense in table rows that are snychronized within one container (i.e. TR, STR table rows). It does not make sense in ITR rows, because these rows are explicitly not synched.

Optional

1

2

3

4

5

50

int-value

colspan

Column spanning of control.

If you use TR table rows then you may sometimes want to control the number of columns your control occupies. By default it is "1" - but you may want to define the control to span over more than one columns.

The property only makes sense in table rows that are snychronized within one container (i.e. TR, STR table rows). It does not make sense in ITR rows, because these rows are explicitly not synched.

Optional

1

2

3

4

5

50

int-value

darkbackground

Normally the background is in light colour but the CIS style sheets also have a dark(er) grey colour to be used.

If DARKBACKGROUND is set to true then the darker background colour is chosen. This property typically is used to integrate light coloured controls into darker container areas.

Optional

true

false