Skip to Content
author's profile photo Former Member
Former Member

UI Download element

Hi all ,

Can someone help me can i use UI download elements . it would be good if someone can post the code for the same . I couldnt understand mcuh through the documentation for the same .

Thanks & Regards,

Udai

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2005 at 12:30 PM

    Can you elobarate your query..

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Web Dynpro FileDownload API – IWDFileDownload

      Definition

      You can use the FileDownload UI element to load files from the server to the client. The data property determines the data source in the view context. The target property determines the ID of the target window in the browser. For more information about this UI element, see the Binding section below.

      Description of the UI Element Properties

      · data

      Determines the data source of the files to be downloaded in the context.

      · target

      Determines the ID of the target window in the browser, if the link is activated. Either the users can specify the ID themselves or it has the value _blank, which opens an external, unnamed window.

      · type

      Describes the graphical representation of the FileDownload UI element. The type property can be filled with the following values and is represented by the enumeration type WDLinkType.

      function

      The UI element appears in the standard design and underlined.

      navigation

      The UI element appears underlined and in the color used for links that the user has already visited.

      reporting

      The UI element appears in the standard design and not underlined.

      result

      The UI element appears not underlined.

      Overview of Inherited and Additional Properties

      Name

      Interface

      Type

      Initial Value

      bindable

      Value Required

      data

      IWDFileDownload

      Object

      bindable_mandatory

      No

      enabled

      IWDUIElement

      boolean

      true

      bindable

      No

      imageAlt

      IWDAbstractCaption

      String (TranslatableText)

      bindable

      No

      imageFirst

      IWDAbstractCaption

      boolean

      true

      bindable

      No

      imageHeight

      IWDLink

      String

      bindable

      No

      imageSource

      IWDAbstractCaption

      String

      bindable

      No

      imageWidth

      IWDLink

      String

      bindable

      No

      size

      IWDLink

      WDLinkSize

      standard

      bindable

      No

      target

      IWDFileDownload

      String

      _BLANK

      bindable

      No

      text

      IWDLink

      String (TranslatableText)

      bindable

      No

      tooltip

      IWDUIElement

      String (TranslatableText)

      bindable

      No

      type

      IWDFileDownload

      WDLinkType

      navigation

      bindable

      No

      visible

      IWDUIElement

      WDVisibility

      visible

      bindable

      No

      wrapping

      IWDLink

      boolean

      false

      bindable

      No

      Data Binding

      At design time, you add the FileDownload UI element to an appropriate view. You then define a value attribute of type binary in the context of this view, also at design time; for the source text below the value attribute is called “FileDownload”.

      The data property must be bound to this value attribute of data type binary, so that the file can be downloaded as a byte array. At runtime, the binary data type can be enhanced with data to allow the passing of related information when downloading a file. Using the IWDModifiableBinaryType data type, which represents an extension of the binary data type you can access the MIME type of the file, that is, either read or set the MIME type. To do this, you must implement the following source text in the wdDoInit method of the controller implementation, with which, on the one hand, the binary data type is enhanced at runtime and on the other hand, the file extension is passed on during download:

      public void wdDoInit()

      {

      //@@begin wdDoInit()

      // The FileDownload UI element requires:

      IWDAttributeInfo attInfo = wdContext.nodeRoot().getNodeInfo().getAttribute("FileDownLoad");

      binaryType = (IWDModifiableBinaryType) attInfo.getModifiableSimpleType();

      // in addition the FileDownload UI element needs for defined resource types

      binaryType.setFileName("Snow Trees.jpg");

      binaryType.setMimeType(WDWebResourceType.JPG_IMAGE);

      //The FileDownload UI element needs for undefined resource types

      binaryType.setFileName("Snow Trees.xcc");

      binaryType.setMimeType(new WDWebResourceType("xcc", "", true));

      //@@end

      }

      Note that during the download, the MIME type of the file must be set in the controller implementation. Furthermore, you must pass on additional parameters to the setMimeType method, if the data type is not available in the Java Dictionary.

      Methods in the Web Dynpro IWDFileDownload API

      Method Name

      Parameter

      Return Value

      Short Description

      bindData

      (String path)

      Binds the value of the data property to the content element specified by the path.

      bindingOfData

      String

      Returns the path of the content element to which the data property is bound. Returns NULL if no binding exists.

      bindingOfTarget

      String

      Returns the path of the context element to which the target property is bound. Returns NULL if no binding exists.

      bindingOfType

      String

      Returns the path of the context element to which the type property is bound. Returns NULL if no binding exists.

      bindTarget

      (String path)

      Binds the target property to the context node specified by a path.

      bindType

      (String path)

      Binds the type property to the context node specified by a path.

      getData

      Object

      Returns the value of the data property.

      getTarget

      String

      Returns the value of the target property.

      getType

      WDLinkType

      Returns the value of the type property.

      setData

      (Object data)

      Sets the value of the data property.

      setTarget

      (String target)

      Sets the value of the target property.

      setType

      (WDLinkType type)

      Sets the value of the type property.

      Additional methods described in the following APIs are available using inheritance:

      Hope this helps...

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.