• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Intercepting a failed action method invocation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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">

      <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?

 

 

-- 
Paul Hoadley
http://logicsquad.net/



 

 _______________________________________________
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

  • Follow-Ups:
    • Re: Intercepting a failed action method invocation
      • From: Paul Hoadley <email@hidden>
References: 
 >Intercepting a failed action method invocation (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: qualified to-many relationships?
  • Next by Date: Re: java.lang.reflect.InvocationTargetException
  • Previous by thread: Intercepting a failed action method invocation
  • Next by thread: Re: Intercepting a failed action method invocation
  • Index(es):
    • Date
    • Thread