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
hi
check this link
http://help.sap.com/saphelp_nw04/helpdata/en/0d/5375848e41aa4c86219c80acd054df/frameset.htm
will certainly help you .
murali
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