Professional Documents
Culture Documents
At the end of this Exercise, you are able to: Define an Image UI Element. Place the image within a Tray UI Element.
Developing
3-4 Download - Upload Download the image explosion.gif from Web Dynpro Component WD_04S_UI_IMAGE and upload it to your component.
1 UI Elements Solution
4-1 Bind the image properties alt and source to the context of the view. Bind the image properties source, tooltip and visible to the context of the view container:
Add a new context node to the view controller context, having the name Image. Change the cardinality of this node to 1..1. Add three new attributes to the node Image, having the names SOURCE, TOOLTIP (both of type string) and VISIBLE (of type WDUI_VISIBILITY). Bind the properties SOURCE, TOOLTIP and VISIBLE of the Image I element to these context elements.
2 UI Elements Solution
* fill structure with values stru_image-source = 'explosion.gif'. stru_image-tooltip = 'Explosion boom!!'. stru_image-visible = '02'. "=visible * navigate to <IMAGE> via lead selection context_node = wd_context->get_child_node( name = `IMAGE` ). * get element via lead selection context_elem = context_node->get_element( ). * bind structure to context element image CALL METHOD context_elem->set_static_attributes EXPORTING static_attributes = stru_image. ENDMETHOD.
3 UI Elements Solution