Re: Component with bindings in dictionary.
Re: Component with bindings in dictionary.
- Subject: Re: Component with bindings in dictionary.
- From: Chuck Hill <email@hidden>
- Date: Mon, 16 Feb 2009 18:47:38 -0800
On Feb 16, 2009, at 3:09 AM, lgazda wrote:
Hi,
I am trying to make something like this:
I want to be able to switch dynamically components (base on some
variables) in few places (on single site) and i don't want to use
conditionals.
My idea:
I want to have component which extends for example WOString and take
one binding which is dictionary with specific for sub-class bindings.
For example for WOString it will be dictionary with key = value and
valueForKey = "SomeText" but I don't know how to replace
associations in super constructor.
You are probably better off just making a stateless WOComponent that
wraps a single WOString. It will be easier to deal with than trying
to subclass WOString. The dynamic elements are not designed to be
easily sub-classed. You won't be sacrificing much by using a
WOComponent and they are easier to work with.
I want use WOSwitchComponent and i need components with the same api
- MyWOString and MyWOText will have same binding (dictionary) and
due to this I will be able to inject different kinds of components.
Any advice would be great.
You can make a WOComponent subclass to handle your new API and then
subclass it and wrap each dynamic element you need.
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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