You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stav <cc...@yahoo.com> on 2003/03/12 21:09:07 UTC

Palette woes

Hi All,

how to preset Palette selections with
IPropertySelectionModel implementation.

I have implemented equals() for my custom object. I
have also looked at the docs.

Works fine with StringPropertyModel, but not
implementations of IPropertyModel.

Thanks in advance.

Cheers,
Stav.

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

RE: Palette woes

Posted by Stav <cc...@yahoo.com>.
Hi Howard,

from what I see in the debugger, it never calls my
equals() method.

I use the same object/ interface with another
IPropertySelectionModel component and the same
equals() method is called in debugging and works and
renders as expected.

I will try debugging the Palette component as you
suggested and post the results.

Thx.
Stav.


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

RE: Palette woes

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
Seems strange, you may want to fire up the debugger.

The code that populates the two <select> elements is simple:

        int count = model.getOptionCount();
        for (int i = 0; i < count; i++)
        {
            IMarkupWriter w = _availableWriter;

            Object optionValue = model.getOption(i);

            if (selectedSet.contains(optionValue))
                w = _selectedWriter;

            w.beginEmpty("option");
            w.attribute("value", model.getValue(i));
            w.print(model.getLabel(i));
            w.println();
        }

That works for StringPropertySelectionModel, should work for an model where
the optionValue objects properly implement equals().

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/proposals/tapestry



> -----Original Message-----
> From: Stav [mailto:cclunis@yahoo.com] 
> Sent: Wednesday, March 12, 2003 3:09 PM
> To: Tapestry mailing lists
> Subject: Palette woes
> 
> 
> Hi All,
> 
> how to preset Palette selections with
> IPropertySelectionModel implementation.
> 
> I have implemented equals() for my custom object. I
> have also looked at the docs.
> 
> Works fine with StringPropertyModel, but not
> implementations of IPropertyModel.
> 
> Thanks in advance.
> 
> Cheers,
> Stav.
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online 
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org