Skip to Content
avatar image
Former Member

Append Message Area

Hi,

How to append Message Area?

Thanks,

RPN

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 04, 2009 at 12:39 PM

    Hi Jude,

    As you have hardcoded the values thats why you are not getting the previous message.

    below is the code written by you

    IPrivateIDocClientView.IContextElement element = wdContext.currentContextElement();
    IWDMessageManager msgMNG  = wdComponentAPI.getMessageManager();
    msgMNG.reportSuccess("Success");
    msgMNG.raiseException("Failure");

    below are my suggestions.

    IPrivateIDocClientView.IContextElement element = wdContext.currentContextElement();
    IWDMessageManager msgMNG  = wdComponentAPI.getMessageManager();
    String success = "Success";
    String failure = "Failure";
    //now you need to delclare one global variable between 
    //@@begin others
    String result = success +failure;
      //@@end
    // I hope both these statements are in different methods.
    msgMNG.reportSuccess("result ");
    msgMNG.raiseException("result ");

    Hope this will help.

    Regards

    Narendra Singh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi Jude,

      1. create a global variable of type String which holds the previous message.

      //@begin others
      String prev_msg = null;
      //@end others
      

      2. adjust the method

      private void Display_Message(String Message,boolean Error)
      	{   	
      	       String temp = Message;
                     Message = prev_msg + Message;
                     prev_msg = temp;
      		IPrivateIDocClientView.IContextElement element = wdContext.currentContextElement();
      		IWDMessageManager msgMNG  = wdComponentAPI.getMessageManager();
      		if (Error==false)
      			msgMNG.reportSuccess(Message);
      		else
      			msgMNG.raiseException(Message, true);
      	}
      

      Plz close thread, if answered.

      Thanks

      nikhil

  • avatar image
    Former Member
    Feb 05, 2009 at 04:50 AM

    Hi,

    Small correction required in last line of above code from Gayathri

    msgMNG.raiseException(var1, true); // instead of argument 'Message'

    Also, for better readability, you can put some space between the messages thru var = var + " " + Message;

    Kind Regards,

    Nitin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 05, 2009 at 04:56 AM

    Please have a look at the below thread

    message-area

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 04, 2009 at 11:48 AM

    Hi,

    Can you please explain it clearly?

    Regards

    Narendra

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      HI,

      there are two buttons in my iview and a message area. On clicking Button one a message is displayed say "success", on clicking the second button message "failure" is displayed.

      at runtime when i click button one the message "success" is displayed. when i click the second button the message "failure" is displayed, but the previous message "success" is erased.

      My question is, Is there any way to append the messages, so i will not be able to lose the older ones..

      thanks

      Jude.

      Edited by: Jude Silvester on Feb 4, 2009 1:00 PM

  • avatar image
    Former Member
    Feb 04, 2009 at 12:05 PM

    Hi,

    I got your problem but can you please tell me on click of a button from where are you getting success or failure message and how you are showing them.

    Can you please paste the code which you are using as there are various ways you can append the messages but it all depends on your way of doing it.

    Regards

    Narendra

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Narendra,

      This is the code:

      IPrivateIDocClientView.IContextElement element = wdContext.currentContextElement();
      IWDMessageManager msgMNG  = wdComponentAPI.getMessageManager();
      msgMNG.reportSuccess("Success");
      msgMNG.raiseException("Failure");
      
      
      

      Jude.

      Edited by: Jude Silvester on Feb 4, 2009 1:30 PM

  • avatar image
    Former Member
    Feb 04, 2009 at 01:19 PM

    Hi Jude,

    Hi Chander i think thats what he wanted (append both the messages so that he can print both)

    Code which you need to declare global

    //now you need to delclare one global variable between 
    //@@begin others
    String success = "";
    String failure = "";
    String result = success +failure;
      //@@end

    Code for action of button one

    String success = "Success";
    Display_Message(result , false);

    Code for action of button two

    String failure= "failure";
    Display_Message(result , false);

    Else your other coding is fine.

    Regards

    Narendra

    Add comment
    10|10000 characters needed characters exceeded