On Tue, Jun 27, 2000 at 06:35:32PM -0700, John McNally wrote:
> return formatPercent(tax.getSalesTax());
A-ha - there's one to add to WebMacroFormatter, excellent.
> One problem though, I liked to have the display objects extend a Hashtable
> so that it was easy to add things like a link (DynamicURI) for the object,
> so for example a loop through a list of objects with Edit or Delete links
> (buttons)
> is easy to read and write in the template.
>
> I was thinking it should be possible to define a generic DisplayProxy like
>
> DisplayProxy extends Hashtable
> {
> public Object obj;
> DisplayProxy(Object obj)
> {
> this.obj = obj;
> }
> }
>
> Since WM is using reflection to find the objects methods, I was thinking
> there should not be any casting problems with this approach. Is this
> correct?
So if you put the proxy object in as $proxy for instance, you would
say either:
$proxy.obj.Blah
or
$proxy.delete
depending on whether you want to access the object directly or access an
item out of the Hashtable? That should all work.
So you would fill this hashtable in the screen?
> What are your thoughts on this approach? What other ways are there to
> accomplish what I want?
Filling the hashtable, and then wrapping the object seems like quite a
lot of hassle for not _that_ much benefit.
What I plan to do is have a context tool for links as well. I would say
something like
<a href="$mylink.delete($obj)">delete</a>
Obviously though this requires a certain uniformity across the design of
the business objects - which I do have (all have a getId() method which
returns the value for the table primary key).
--
Sean Legassick
[EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]