• 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: Need help in calling a method defined in the .java file from a javascript fired from a javascript event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help in calling a method defined in the .java file from a javascript fired from a javascript event


  • Subject: Re: Need help in calling a method defined in the .java file from a javascript fired from a javascript event
  • From: "Eric E. van Leeuwen" <email@hidden>
  • Date: Fri, 9 May 2008 13:44:12 -0700

Don,

Thanks! I'm going to give this a try.

Eric

On May 9, 2008, at 1:29 PM, Don Lindsay wrote:

Hello;

I have a WOpopup in a worepitition, each WOPopup has a WOSubmit button (both are in a TD tag) associated with it and it's style=visibility.hidden.

The WOForm has to have multiplesubmit set to true.
The WOSubmit must have it's action set to the method you wish to call in the java file.


I created a javascript function created to find the associated WOSubmit button that is associated with the WOPopup.

          function listChanged(oElement) {
             oParent = oElement.parentNode;
             //oAlert = oParent.type + "\n";
             oChildren = oParent.childNodes;
             for (i=0;i<oChildren.length;i++) {
               if (typeof(oChildren[i].type)!='undefined') {
                if (oChildren[i].type=='submit'){
                  oChildren[i].click();
                }
                //oAlert += "\n" + oChildren[i].type + "\n";
              } else {
                //oAlert += "n,";
              }
             }
            //alert(oAlert);
          }

I set the otherTagString of the WOPopup to onchange=listChanged(this);

The javascript function finds the associated wosubmit and clicks it programatically.

Don

On May 9, 2008, at 4:17 PM, Eric E. van Leeuwen wrote:

Lachlan (et al),

Thanks for the quick response. But I must apologize for omitting the fact that I'd like to avoid using "3rd party" add-ons. Anyone else want to take a crack at it?

Eric

On May 9, 2008, at 12:18 PM, Lachlan Deck wrote:

Hi Eric,

On 10/05/2008, at 4:55 AM, Eric E.van Leeuwen wrote:

I need a way to "bridge" from javascript to my webobject's java. I have a situation where I need a WOPopupButton's onChange javascript event to call a method defined in the .java file of the WOComponent.

You'll want to take a look at the Ajax framework (and example app) in Project Wonder.
Live example: http://www.mdimension.com/cgi-bin/WebObjects/AjaxExample.woa


with regards,
--

Lachlan Deck

_______________________________________________ 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


_______________________________________________ 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: Need help in calling a method defined in the .java file from a javascript fired from a javascript event
      • From: Chuck Hill <email@hidden>
References: 
 >Need help in calling a method defined in the .java file from a javascript fired from a javascript event (From: Eric E.van Leeuwen <email@hidden>)
 >Re: Need help in calling a method defined in the .java file from a javascript fired from a javascript event (From: Lachlan Deck <email@hidden>)
 >Re: Need help in calling a method defined in the .java file from a javascript fired from a javascript event (From: "Eric E. van Leeuwen" <email@hidden>)
 >Re: Need help in calling a method defined in the .java file from a javascript fired from a javascript event (From: Don Lindsay <email@hidden>)

  • Prev by Date: Re: Need help in calling a method defined in the .java file from a javascript fired from a javascript event
  • Next by Date: Re: FBL
  • Previous by thread: Re: Need help in calling a method defined in the .java file from a javascript fired from a javascript event
  • Next by thread: Re: Need help in calling a method defined in the .java file from a javascript fired from a javascript event
  • Index(es):
    • Date
    • Thread