I think you are getting the error because setting a binding also involves reading the value back, therefore all bindings should also have a getter method.
ERXRedirect is supposed to be returned as a component in an action method. So instead of returning the thank you page, you would return an ERXRedirect instance.
But this does probably not solve your problem, as you are already on the ThankYouPage. As most of the work is done in ERXResponse.appendToResponse()
you may try to manually call this in ThankYouPage’s appendToResponse:
public void appendToResponse(WOResponse aResponse, WOContext aContext) {
if (noPayment) {
ERXRedirect redirect = pageWithName(ERXRedirect.class);
redirect.setComponent( redirectComponent );
redirect.appendToResponse(aResponse, aContext);
}
super.appendToResponse()
}
This should set a location header and 302 response code and so redirect to the target page.
Ralf
On 8 May 2021, at 16:17, Markus Ruggiero (rucotec) wrote: