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

Labels in Web Dynpro's

Has anybody had any trouble getting labels to display in a view at runtime - I have concluded that this is perhaps a bug, but would like to confirm. I have checked and rechecked the properties of labels with no luck.

Secondly, I am having a little trouble getting my mind round the API. How would one get a handle on a label or input at runtime to set it's properties?

Many thanks,


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 12, 2004 at 12:10 PM

    Hi Rowan,

    The label can be used like all other UI elements. The ID of the UI element gives you a handle. By using a Cast on the right type you can access and set all properties of this UI element.

    Maybe the abstract of the documentation is helpful as well:

    Dynamic Modification of a View

    Web Dynpro provides the wdDoModifyView Hook method in the controller implementation of the view. The Hook method enables you to overwrite source code at runtime. It allows the application programmer to insert source code, which is used for customizing a Web application, for example. The wdDoModifyView method is called for every view before it is displayed on the screen. All modifications of UI elements that cannot be made using declarative data binding at design time are covered by the Hook method. For example, the Hook method is used if a UI element is to be rendered only at runtime.


    • Hook method called to modify view before rendering. Access to UI elements

    • is via the given view API only!


    public void wdDoModifyView(IWDView view)


    //@@begin wdDoModifyView



    Note that the implementation of the wdDoModifyView method must always be defined between the comment lines //@@begin and //@@end, which is the user coding area. Otherwise, a runtime error occurs.

    The interfaces IWDView and IWDViewElement provide the methods required for modifying the UI elements.

    · IWDView provides a method for rendering the new UI elements:

    IWDButton submitButton = (IWDButton) view.createElement(IWDButton.class, ?submitButton?);

    · IWDView provides a method for accessing existing UI elements using the ID:

    IWDButton submitButton = (IWDButton) view.getElement(?submitButton?);

    By default, a view contains a TransparentContainer UI element, whose ID is RootUIElementContainer. This element is the top UI element in the hierarchy of the UI elements of a view. This condition cannot be changed, modifications can only be defined for the UI element children of this container.

    Note that exactly one view is assigned to a UI element. Therefore, it is not possible to separate UI elements from multiple views or transfer them from one view to another.

    Add a comment
    10|10000 characters needed characters exceeded

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.