Add below code to add information message to the page on some ac tion.
InformationalMessage message= new InformationalMessage("message",runtimeNode);
runtimeNode.getConfiguration().addInformationalMessage(message);
InformationalMessage message= new InformationalMessage("message",runtimeNode);
runtimeNode.getConfiguration().addInformationalMessage(message);
Thanks for the post!
ReplyDeleteIs it also possible to display a validation error message to the user, while the user saves the configuration (with the event binding pre/postConfigSave)?
I would like to validate the whole configuration after finished and give the user an exception, if its incorrect.
Thanks and regards,
Frank
hi frank
Deleteyes ,it should work
you can also make it work,by using Totals and Resources on model or component.
Hi Kaushal!
DeleteIf it should work, HOW does it work? :)
If you add an informational message while calling preConfigSave, the user will never see this message, because of the finishing event of the configuration.
I would like to have a "breaking" event / message, for example a message "you have to change your input values, before you can save your configuration".
For example, I'm using a method, that fills in the UserStr01. If you save the configuration and have not calling this function, the error message shall be displayed.
How can I solve such a problem?
Thanks and regards,
Frank
hi frank
Deletefor this you need to make a custom validation failure.
what you will do is...
import oracle.apps.cz.cio.CustomValidationFailure;
using this class,you will regsiter a failure.
CustomValidationFailure failure = ("your messages"==null)?null:new CustomValidationFailure("your messages",(RuntimeNode) rtNode, true);
after that you need to get the validator.
and update teh validationfailure
rtNode.getConfiguration().updateValidationFailure(failure).
you need to write a CX for this.
Hi Kaushal,
ReplyDeletethanks for your explanation! It was my failure, because I've used still the postConfigSave binding.
With the preConfigSummary and the preConfigSave event it works perftectly.
Thanks so much!
Regards,
Frank
great!!!.....welcome....
ReplyDeleteHi Kaushal,
ReplyDeleteif you want to remove this CustomValidationMessages on a node, I have written the following method:
private void removeValidationFailuresOnNode(final IRuntimeNode node) {
final Collection c = node.getConfiguration().getValidationFailures();
for (final Iterator i = c.iterator(); i.hasNext();) {
final Object o = i.next();
if (o instanceof CustomValidationFailure) {
((CustomValidationFailure)o).removeCustomValidationFailure();
}
}
}
It's working correctly, but is there a handier method to remove them? ;)
Great Blog by the way!! Keep going!
Regards,
Frank
hi frank
ReplyDeleteI have not tried it, but i will forward the code,you can try it yourself.
give me your email id.
Regards,
Kaushal
frankiefigs(at)gmx-topmail(dot)de
DeleteThanks and regards,
Frank