Intercepting a failed action method invocation
Intercepting a failed action method invocation
- Subject: Intercepting a failed action method invocation
- From: Paul Hoadley <email@hidden>
- Date: Mon, 11 Jul 2016 17:10:15 +0930
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"> <div> <wo:link action="$linkAction">Link!</wo:link> </div> </wo:if>
Then:
private boolean showLink = true;
public boolean showLink() { if (showLink) { showLink = false; return true; } return showLink; }
public WOActionResults linkAction() { System.out.println("Main.linkAction: CALLED"); return null; }
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