This is a component which can help you forward messages to the validation tracker.
It can for example be used when you have a page (or it can be a component surrounding your form) where the onActivate or beginRender phases can produce messaged which need to be displayed in the validation tracker in your page.
In your page you have to add the validationdelegate component to add allow the propagation of the messages
<t:form>
<t:equanda.ValidationTrackerDelegate/>
<t:errors/>
.....
</t:form>
Please note that the ValidationTrackerDelegate should be before the t:errors component.
In your page or component, you do something like the following
@Inject
private Environment environment;
private String keepMessage;
public void onActivate()
{
.... do whatever needs to be done
.... if there is a problem do the following
keepMessage = "error message";
}
void beginRender()
{
if ( null != keepMessage ) environment.push( MessageContainer.class, new MessageContainer( keepMessage ) );
}
void afterRender()
{
if ( null != keepMessage ) environment.pop( MessageContainer.class );
}