Skip to Content
avatar image
Former Member

Re: how to create and use tabs for WD views

Gentlemen,

Since your answers have been so useful so far, please allow me to challenge you with another question:

In both views i have a messageAreaUIElement, to whcih i wirte error messages.

Since I moved to the tabstrip, whenever an error message needs to be written to the sectond tab view, it is written to the first tab message area instead... when deleting the message are in the first view - then it works ok for the second view...

I write to the message area this way:

wdComponentAPI.getMessageManager().reportException(errorMsg, true);

is there a way i can prevent this pheonmenon?

Regards,

Oren.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 09, 2007 at 01:06 PM

    Hello Oren!

    If understand correct you have two different MessageArea's in two tabs.

    So if it's true try to this solution.

    Create your method, like this.

    private void setMessageAreaEnabled(boolean firstEnabled, boolean secondEnabled) {
      IWDView view = (IWDView)wdControllerAPI;
      IWDUIElement element; 
      element = (IWDUIElement) view.getElement("MessageAreaFirst");
      if (element!=null) {
        element.setEnabled(firstEnabled);
        if (firstEnabled) {
           element.requestFocus();
        }
      }
      element = (IWDUIElement) view.getElement("MessageAreaSecond");
      if (element!=null) {
         element.setEnabled(secondEnabled);
        if (secondEnabled) {
            element.requestFocus();
        }
      }
    }
    

    And before calling

    wdComponentAPI.getMessageManager().reportException(errorMsg);

    just set in which AreaMessage it should be displayed.

    for fist tab

    setMessageAreaEnabled(true, false);

    for second tab

    setMessageAreaEnabled(false, true);

    I hope it hepls.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      This is not the recommended way. UI elements should not be accessed from any other method than wdDoModifyView().

      Nevertheless, you could bind the "visible" property of the message areas to context attributes of type "Visibility" and set the attribute values to WDVisibility.NONE reps. VISIBLE to achieve the same effect.

      Armin

  • avatar image
    Former Member
    Aug 09, 2007 at 12:10 PM

    I think this has already been treated in this forum, try to search.

    IIRC, you have to make sure that only the message area of the currently selected tab is visible. This may be achieved by using calculated attributes for controling the visiblities of the different message areas.

    Armin

    Add comment
    10|10000 characters needed characters exceeded