cancel
Showing results for 
Search instead for 
Did you mean: 

Binding data to dynamic download UI element

0 Kudos

Hi,

One Upload UI element and the document uploaded is stored in custom table. Once it is uploaded and stored successfully the Upload Ui element is replaced by a download UI element. Till here I could do...

Now when I click on this download element I am getting a 'Null object Reference' error. Its because no data is bind to this element. How to bind the data in custom database to this UI element??? I need to bind the values to the following properties..Data,Mime type,text.

the method i used to create download element is :

CALL METHOD cl_wd_file_download=>new_file_download
    EXPORTING
*     activate_access_key    =
*     behaviour              = E_BEHAVIOUR-AUTO
*     bind_behaviour         =
      bind_data              =
*     bind_design            =
*     bind_enabled           =
*     bind_file_name         = ls_tax_download-zfile_name
*     bind_image_first       =
*     bind_image_height      =
*     bind_image_source      =
*     bind_image_width       =
*     bind_mime_type         = ls_tax_download-zfile_type
*     bind_target            =
*     bind_text              = ls_tax_download-zfile_name
*     bind_text_direction    =
*     bind_tooltip           =
*     bind_type              =
*     bind_visible           =
*     bind_wrapping          =
*     context_menu_behaviour = E_CONTEXT_MENU_BEHAVIOUR-INHERIT
*     context_menu_id        =
*     data                   =
*     design                 = E_DESIGN-STANDARD
      enabled                = 'X'
*     file_name              =
*     id                     =
*     image_first            = 'X'
*     image_height           =
*     image_source           =
*     image_width            =
*     mime_type              =
*     target                 =
      text                   =
*     text_direction         = E_TEXT_DIRECTION-INHERIT
*     tooltip                =
*     type                   = E_TYPE-NAVIGATION
*     view                   =
*     visible                = E_VISIBLE-VISIBLE
*     wrapping               =
    receiving
      control                = lr_download
      .

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Thanks for your suggestion. But that doesnt satisfy my requirement.

There is no one else to help me with this issue......

Abhijeet-K
Active Participant
0 Kudos

Hi Sooraj,

I am not sure how you have created the UI download element dynamically. However, the simplest of the way is to use the FileDownload UI element, with it data binding set to the same context element which is bound to the FileUpload UI element data. Additionally, you can enable (or make visible) the FileDownload UI element, only after successful upload of file, to ensure no click on it occurs before legit data binding is in place.

Also have a look at this simple and elegant post.

0 Kudos

Thanks for your reply.

My requirement is to remove the upload ui element after uploading the file and replace it with a download ui element. So everything is dynamic here.... As you can see in the code I have posted there are options to set the properties dynamically....But I dont know which value I should give. I tried to bind the values which I have fetched from custom table....But its throwing error...

Abhijeet-K
Active Participant
0 Kudos

Hi Sooraj,

Lets try to keep things simple. Have both UI upload and download elements in the view, while keeping the download one invisible till upload is successful. Both should have binding to same context element. Post successful upload, make the upload UI element invisible and download visible. This will emulates your purported dynamism, as well as never cause null object reference error.