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

reportContextAttributeMessage doesn't highlight checkbox group.

Hi,

I am using reportContextAttributeMessage on checkbox group. The error message shows but its not clickable and as a result I cannot highlight or go directly to the checkbox group.

Does reportContextAttributeMessage work for checkbox group?

Thanks

Srinivas

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 08, 2009 at 05:41 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2010 at 11:40 PM

    Hi, I haven't tried to use ReportContextAttributeMessage with a checkbox group, but I think I can help you with the other requirement if you haven't found a solution yet.

    For highlighting multiple fields, there's a constructor for ReportContextAttributeMessage that will take an array of attribute pointers instead of a single one... so, let me explain...

    Lets say you have two input fields: inpFieldA and inpFieldB, both require a String input which is mapped to your context attributes sStringA and sStringB.

    First you would need to create attribute pointers for those two attributes...

    IWDAttributePointer attA = wdContext.currentContextElement().getAttributePointer( "sStringA" );
    IWDAttributePointer attB = wdContext.currentContextElement().getAttributePointer( "sStringB" );
    

    then you would need to put those into an array...

    IWDAttributePointer attributes[] = { attA, attB };
    

    Now, like I said, instead of using ReportContextAttributeMessage with a single attribute, there's this:

    public void reportContextAttributeMessage(IWDAttributePointer[] attributes, IWDMessage message, Object[] args);
    

    Just use that array you created back there and it will display one message and higlight both fields.

    Now, if you only want it to highlight both when both are empty (which I'm guessing is the case), then you could use a condition like this ( pardon my not using real code, just giving you the logic )

    IWDAttributePointer attA = wdContext.currentContextElement().getAttributePointer( "sStringA" );
    IWDAttributePointer attB = wdContext.currentContextElement().getAttributePointer( "sStringB" );
    
    if( field A is empty OR field B is empty ){
       if( field A is empty AND field B is empty ){
          Create the array with both attribute pointers and invoke ReportContextAttributeMessage with both;
       }
       else{
          if( field A is empty ){
             invoke ReportContextAttributeMessage using only attribute pointer A;
          }
          if( field A is empty ){
             invoke ReportContextAttributeMessage using only attribute pointer B;
          }
       }
    }
    else{
       Normal functioning...
    }
    

    Hope that helps...

    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.