Re: Intercepting a failed action method invocation
Re: Intercepting a failed action method invocation
- Subject: Re: Intercepting a failed action method invocation
- From: Chuck Hill <email@hidden>
- Date: Mon, 11 Jul 2016 15:55:51 +0000
- Thread-topic: Intercepting a failed action method invocation
Hi Paul,
Just override invokeAction() and if the result is null then no action matched the URL. That is your queue to set a conditional boolean to cause the informational message to be shown.
Chuck
From:
<webobjects-dev-bounces+chill=email@hidden> on behalf of Paul Hoadley <email@hidden>
Date: Monday, July 11, 2016 at 12:40 AM
To: WebObjects-Dev <email@hidden>
Subject: Intercepting a failed action method invocation
Hello,
I have a page structure where a form submit button is conditionally rendered based on some property of an EO. Sometimes the page will be returned such that the submit button is displayed, but meanwhile the value of the property changes
behind the page’s back. At this point, clicking on the submit button doesn’t invoke the action method, but returns the same page (now with the submit button excluded by the conditional). It’s just as easy to demonstrate this with a WOHyperlink—the behaviour
is the same:
<wo:if
condition="$showLink">
<wo:link
action="$linkAction">Link!</wo:link>
private
boolean
showLink =
true;
public
boolean showLink() {
public WOActionResults linkAction() {
System.out.println("Main.linkAction:
CALLED");
The hyperlink is rendered on initial page load, but then never again, and the action method is never called in response to clicking the hyperlink displayed on initial load.
I think this behaviour is quite reasonable, but I want to intercept it so that I can add an informational message to the page that explains what’s going on. Is there an obvious way to do this?
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden