• 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
Question here
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question here


  • Subject: Question here
  • From: Gustavo Pizano <email@hidden>
  • Date: Mon, 10 Mar 2008 16:04:39 -0500

Im trying to do the followinng 
but I can't do it  dunno why, Im using Bindings and Im making the newbinding and all, but I can get the pop up window. dunno why
this is what I have in the html
and this is what I have in teh wod
Body : WOBody {
framework = "WOExamplesHarness.framework";
filename = "aqua_bg.jpg";
newBinding = onLoad;
}
Regards
Gus
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>Hello World</title>
</head>
<body>
<webobject name = "Body">
<webobject name = "HelloImage"/>
<br>
Hello, what is your name?.
<webobject name = "HelloWorldForum">
<webobject name = "NameField"/>
<webobject name = "HelloWorldSubmitButton"/>


</webobject>
</webobject>
</body>
</html>

Introduction to _javascript_ and WebObjects

First, let's revisit the Hello application created in Chapter 1, "A Web Objects Primer." We are going to return the greeting in the form of a _javascript_ pop-up window instead of a second page.

Dynamically Vended _javascript_ Alert Panel

Duplicate the Hello project and rename it DynamicHello by following the instructions in Chapter 1.

Open Main.wo in WebObjects Builder. We are going to use an onLoad script to perform the _javascript_ alert.

Add the following key to the Main page:


Name: onLoad



Type: String (java.lang.String)



As Variable: NO



Accessors: Only the Method returning the value


Now bind the onLoad key to the WOBody element. Because onLoad isn't a defined binding for WOBody (that is, you wouldn't see it listed in the WOBody Inspector) we need to add it to a new binding.

From the binding drop down, select Connect to new Binding …. Enter onLoad into the Attribute field in the Inspector. This will bind the onLoad key to the custom binding onLoad of the <BODY> element.

Copy the following lines into the onLoad() accessor:

public String onLoad() {
  String username = (String) valueForKeyPath("session.username");
  String  + username + "!');";

  return (username != null) ? onLoad:null;
}


 _______________________________________________
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: Question here
      • From: David LeBer <email@hidden>
  • Prev by Date: Re: Why im getting this error?
  • Next by Date: Re: Question here
  • Previous by thread: Re: Why im getting this error?
  • Next by thread: Re: Question here
  • Index(es):
    • Date
    • Thread