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

Compile-time check identification of view elements

Hi all,

i've posted this as a reply to another post already, i post it again here.

I think, it would be a good idea to generate an (maybe inner) interface class for each view controller which could be used to identify the view elements, which where created at design time (of course this is not possible for the elements added at runtime). This would increase the maintainability of code significantly.

For example, if i create a view "WorkView" which contains a button "ExitButton" and a checkbox "AdvancedSearch", the framework could generate an interface "IViewElementsWorkView" or inner interface "IPrivateWorkView.IViewElements", containing something like:

public final static String EXIT_BUTTON_ID = "ExitButton";

public final static String ADVANCED_SEARCH_ID = "AdvancedSearch";


Then, in the wdDoModifyView method, i could do something like:

if (firstTime) {

IWDButton exitButton = (IWDButton) view.getElement(IViewElementsWorkView.EXIT_BUTTON_ID);

IWDCheckBox advSearch = (IWDCheckBox) view.getElement(IViewElementsWorkView.ADVANCED_SEARCH_ID );


The compiler will then be able to check, if a view element has been removed or renamed, just like it's possible using the component's messages by the IMessageXXX class. This would be helpful regardless the fact, that the view elements could have been removed or destroyed at runtime.

Best regards,


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 Mar 04, 2004 at 02:18 PM

    Hi Stefan,

    I already sent this to some people within the team. I'll come back to you as soon as we have an answer.

    At this opportunity: Thanks for all your activities within this forum!


    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.