Re: WOSwitchComponent?
Re: WOSwitchComponent?
- Subject: Re: WOSwitchComponent?
- From: Greg Hulands <email@hidden>
- Date: Mon, 14 Nov 2005 10:05:48 +1000
The easiest thing to remember with WO programming is not to think
"this is a web app, everything is different to a desktop app." Have a
variable in the ErrorOccurred.java class, create the accessors (if
you so desire), then in whatever page had the error.
ErrorOccurred err = (ErrorOccurred)pageWithName("ErrorOccured");
err.setError("Something Bad Happened");
return err;
For handling errors at the application level, take a look at http://
www.stepwise.com/Articles/Technical/2003-08-15.01.html
HTH,
Greg
On 14/11/2005, at 9:56 AM, Randy Becker wrote:
Wow. I've got my app split up into separate .wo s now, and it's
great, but I don't know how to pass variables around between them -
e.g. how should I handle errors that need to be displayed to the
user - I'd like to do something like this:
} else {
errorMessage = "Something bad happened!";
return (WOComponent)pageWithName("ErrorOccurred");
}
But that doesn't work, because I don't know how to tell
ErrorOccurred.java what the contents of errorMessage are.
Basically, I don't know how to call a function. :) At least, not
one I've defined myself, let alone in another file.
-Randy
On Nov 13, 2005, at 1:26 PM, Karl wrote:
Use a page wrapper. You simply create a single component to
enclose your content. That page (say PageWrapper.html and .wod)
only has to contain a single WOCompoent - namely WOComponentContent.
Each page should include your PageWrapper component. What happens
at runtime is that your page essentially gets popped into the
PageWrapper in place of the WOComponentContent. Very powerful but
difficult to visualize.
Karl
On 13-Nov-05, at 1:18 PM, Randy Becker wrote:
Hi, I'm new to WO, and was wondering what the WO way is to
implement a common look to a site. By this I mean having a
dynamic, but always included header, footer, etc. I get the
feeling that it has something to do with components and maybe
with WOSwitchComponent, but I can't really get anything to work,
so I'm currently I've been putting parts of my project (all of
which is in Main.wo) into WOConditionals and toggling their
values in order to display and hide them. I know there's got to
be a better way. What is it?
-Randy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
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:
40framedphotographics.com
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