Re: How to use WODisplayGroup
Re: How to use WODisplayGroup
- Subject: Re: How to use WODisplayGroup
- From: David LeBer <email@hidden>
- Date: Sun, 7 Dec 2008 12:04:10 -0500
On 7-Dec-08, at 10:33 AM, Francesco Romano wrote:
On 07/dic/08, at 16:05, Johann Werner wrote:
If I got your idea right you should look at WOSwitchComponent. The
problem I mentioned in the last e-mail is if your condition
evaluates to true (showing your rows) and then you are submitting
changes where during the takeValues phase the condition changes to
false the new values are not set as WO thinks that those objects
are not on that page. This is one of those pitfalls of WO where the
whole request-response-loop can puzzle quite easily.
jw
From Reference: WOSwitchComponent provides a way to determine at
runtime which nested component should be displayed. This component
is useful when you want to decide how to display information based
on the state of the application.
I don't understand...
I have to create a full wocomponent? (with html, java, api, etc..)
If this.. I can create the component and use the hyperlink in the
others pages to link to the right component...
Am I wrong?
A couple of things Francesco,
1. Keep it simple: WO can be quite complex for a new developer, I
would strive to go slowly. Try not to bite off more than you can chew.
2. It looks like it might be easier to use a 'wrapper component'
rather than a 'switch component' for your forms.
3. I would focus on learning about using multiple editing contexts
first, even if it means sacrificing your knowledge of reusable
components at this point.
1. Keep it simple
----------------------
Use what you know, make sure it works, and add incrementally.
Otherwise you are going to have a whale of a time trying to figure out
what is not working for you.
2. Wrapper Component
--------------------------------
A wrapper component is a component that wraps another components
content. But it is a child of the component it wraps. Confusing, I
know, but here is an example:
Wrapper:
-------------
HeaderComponent.java
public String theComponentName;
HeaderComponent.html
<h1><wo:str value="$theComponentName"/></h1>
<wo:WOComponentContent />
<p id="footer">Copyright 2008, My Cool Co Inc</p>
HeaderComponent.api
theComponentName required
Usage:
----------
SomeOtherComponent.html
<wo:HeaderComponent theComponentName="My Fancy Component">
<p>Some content</p>
</wo:HeaderComponent>
The key things to understand about wrapper components:
1. They have a single WOComponentContent that will be replaced with
the content of the component they wrap.
2. You feed the objects they need into them via bindings.
3. Wrapper components are a child of the component they wrap, so you
any time you use the child, you get the wrapper automatically.
In your case you might end up with a TableWrapper component that takes
the current EOEditingContext, next page name, and previous page name
as bindings.
3. Multiple EditingContext
-----------------------------------
I wrote a blog post on this a while back: <http://davidleber.net/?p=322>
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
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