on 08-25-2006 7:00 AM
Hi,
I have two InputFields of data type time. After the user has entered the times and has pressed the next button, I have to check that the difference is not larger than 5 hours.
If it is larger than 5 hours I want to give <b>one error message</b> in the MessageArea <b>but highlight the two InputFields</b> with red frames.
I used this lines of code, which present two error messages with the same text, which is not nice:
public void onActionStep2Next(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionStep2Next(ServerEvent)
long timeFrom = wdContext.currentContextElement().getTimeFrom().getTime();
long timeTo = wdContext.currentContextElement().getTimeTo().getTime();
long delta = timeTo-timeFrom;
if (delta > (3600000 * 5)){
IWDMessageManager msg = wdComponentAPI.getMessageManager();
msg.reportContextAttributeMessage(
wdContext.currentContextElement(),
wdContext.getNodeInfo().getAttribute("TimeFrom"),
MessageMain.MAX__REQUESTED__HOURS__ERROR,
null,
false);
msg.reportContextAttributeMessage(
wdContext.currentContextElement(),
wdContext.getNodeInfo().getAttribute("TimeTo"),
MessageMain.MAX__REQUESTED__HOURS__ERROR,
null,
false);
} else { ... }
Do you have a way to solve this? Thank you.
Regards,
Marcus
Message was edited by: Marcus Freiheit
Hi,
You cannot have only one message displayed for two context attributes.
Even if you pass an empty message to the second call, the framework will show something like "message.<Key>" (I think).
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.