You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Davor Miku <da...@gmail.com> on 2009/01/26 19:15:54 UTC

Palette-base component not showing

Hi,

Palette-base custom component "category.palette" is not showing when
embedded into beaneditform:

<t:beaneditform t:id="content" exclude="id">
    <t:parameter name="categories">
        <t:category.palette t:id="categories"
t:currentCategories="content.categories" />
    </t:parameter>
</t:beaneditform>

Otherwise it woks fine. There is no exception. PRODUCTION_MODE is set to
false.

Can anyone help, please?

I'm pretty new to Tapestry, sorry if I'm making dumb questions.

Re: Palette-base component not showing

Posted by Davor Miku <da...@gmail.com>.
I'm giving up on BeanEdit.  Anyway, if some have an idea what's wrong, I
like to hear it.

Now I'm not even sure that kind of custom rendering of properties is
possible at all.

On Mon, Jan 26, 2009 at 2:25 PM, Davor Miku <da...@gmail.com> wrote:

> Yes, I understand that, but with <t:parameter /> I should be able to
> override that, and to provide my own rendering
> of categories property. At least, that's how I understood documentation.
>
>
>
>
> On Mon, Jan 26, 2009 at 3:12 PM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> Em Mon, 26 Jan 2009 16:01:37 -0300, Davor Miku <da...@gmail.com>
>> escreveu:
>>
>>  I'm not getting it.
>>>
>>
>> I'm sorry, I could have been clearer. The relevant part of the
>> documentation is:
>>
>> "The default set of property types supported by BeanEditForm:
>> * String: as a text field
>> * Number: as a text field
>> * Enum: as a drop-down list
>> * Boolean: as a checkbox
>> * Date: as a JavaScript calendar"
>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> http://www.arsmachina.com.br/thiago
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

Re: Palette-base component not showing

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, Jan 27, 2009 at 3:41 AM, Davor Miku <da...@gmail.com> wrote:
> I've solved it.
> Bean class MUST override equals() and hashCode() methods!
> 4 hours of my life ;)

It's always nice to learn something new. :) Overriding equals() and
hashCode() is not just a Tapestry best practice, it is a Java best
practice, as they are used extesively by Java Collection API.

-- 
Thiago

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


Re: Palette-base component not showing

Posted by Davor Miku <da...@gmail.com>.
I've solved it.

Bean class MUST override equals() and hashCode() methods!

4 hours of my life ;)

On Mon, Jan 26, 2009 at 3:31 PM, Davor Miku <da...@gmail.com> wrote:

> Thanks!
> There is progress however now I'm getting:
>
> Render queue error in BeginRender[content/Add:content.form]: Bean editor
>> model for com.autobrief.content.model.Content does not contain a property
>> named 'categories'. Available properties: action, author, creationDate, id,
>> intro, publishedDate, source, status, text, title, type.
>>
>
> exception and there is categories property.
>
> Any clue?
>
>
> On Mon, Jan 26, 2009 at 4:20 PM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> Em Mon, 26 Jan 2009 16:25:12 -0300, Davor Miku <da...@gmail.com>
>> escreveu:
>>
>>  Yes, I understand that, but with <t:parameter /> I should be able to
>>> override that, and to provide my own rendering
>>> of categories property. At least, that's how I understood documentation.
>>>
>>
>> The property rendering can be overriden if it was created in the
>> BeanModel, and your categories property wasn't. To add it, use the include
>> parameter of BeanEditForm:
>>
>> <t:beaneditform t:id="content" exclude="id" include="categories">.
>>
>> It should work now. :)
>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> http://www.arsmachina.com.br/thiago
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

Re: Palette-base component not showing

Posted by Davor Miku <da...@gmail.com>.
Thanks!
There is progress however now I'm getting:

Render queue error in BeginRender[content/Add:content.form]: Bean editor
> model for com.autobrief.content.model.Content does not contain a property
> named 'categories'. Available properties: action, author, creationDate, id,
> intro, publishedDate, source, status, text, title, type.
>

exception and there is categories property.

Any clue?

On Mon, Jan 26, 2009 at 4:20 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Mon, 26 Jan 2009 16:25:12 -0300, Davor Miku <da...@gmail.com>
> escreveu:
>
>  Yes, I understand that, but with <t:parameter /> I should be able to
>> override that, and to provide my own rendering
>> of categories property. At least, that's how I understood documentation.
>>
>
> The property rendering can be overriden if it was created in the BeanModel,
> and your categories property wasn't. To add it, use the include parameter of
> BeanEditForm:
>
> <t:beaneditform t:id="content" exclude="id" include="categories">.
>
> It should work now. :)
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Palette-base component not showing

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 26 Jan 2009 16:25:12 -0300, Davor Miku <da...@gmail.com>  
escreveu:

> Yes, I understand that, but with <t:parameter /> I should be able to
> override that, and to provide my own rendering
> of categories property. At least, that's how I understood documentation.

The property rendering can be overriden if it was created in the  
BeanModel, and your categories property wasn't. To add it, use the include  
parameter of BeanEditForm:

<t:beaneditform t:id="content" exclude="id" include="categories">.

It should work now. :)

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: Palette-base component not showing

Posted by Davor Miku <da...@gmail.com>.
Yes, I understand that, but with <t:parameter /> I should be able to
override that, and to provide my own rendering
of categories property. At least, that's how I understood documentation.




On Mon, Jan 26, 2009 at 3:12 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Mon, 26 Jan 2009 16:01:37 -0300, Davor Miku <da...@gmail.com>
> escreveu:
>
>  I'm not getting it.
>>
>
> I'm sorry, I could have been clearer. The relevant part of the
> documentation is:
>
> "The default set of property types supported by BeanEditForm:
> * String: as a text field
> * Number: as a text field
> * Enum: as a drop-down list
> * Boolean: as a checkbox
> * Date: as a JavaScript calendar"
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Palette-base component not showing

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 26 Jan 2009 16:01:37 -0300, Davor Miku <da...@gmail.com>  
escreveu:

> I'm not getting it.

I'm sorry, I could have been clearer. The relevant part of the  
documentation is:

"The default set of property types supported by BeanEditForm:
* String: as a text field
* Number: as a text field
* Enum: as a drop-down list
* Boolean: as a checkbox
* Date: as a JavaScript calendar"

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: Palette-base component not showing

Posted by Davor Miku <da...@gmail.com>.
Documentation:
"You may add <t:parameter>s to the component; when the name matches (case
insensitive) the name of a property, then the corresponding Block is
renderered, rather than any of the built in property editor blocks."

Well 'categories' is name of one bean's property, and:
'<t:category.palette t:id="categories"
t:currentCategories="content.categories" />'
is my way of rendering it.

I'm not getting it.

On Mon, Jan 26, 2009 at 2:50 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Mon, 26 Jan 2009 15:46:35 -0300, Davor Miku <da...@gmail.com>
> escreveu:
>
>  Thanks for reply.
>> It's working fine outside BeanEditForm.
>> BeanEditForm is showing everything else fine.
>>
>
> Read the BeanEditForm documentation. ;) My guess is that the default
> BeanModel created for you object does not have the categories property
> because Tapestry, out of the box, just handles numbers, strings, dates and
> enums.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Palette-base component not showing

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 26 Jan 2009 15:46:35 -0300, Davor Miku <da...@gmail.com>  
escreveu:

> Thanks for reply.
> It's working fine outside BeanEditForm.
> BeanEditForm is showing everything else fine.

Read the BeanEditForm documentation. ;) My guess is that the default  
BeanModel created for you object does not have the categories property  
because Tapestry, out of the box, just handles numbers, strings, dates and  
enums.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: Palette-base component not showing

Posted by Davor Miku <da...@gmail.com>.
Thanks for reply.

It's working fine outside BeanEditForm.

Here's bean :
public class Content  {
...
...
    private Set<Category> categories = new HashSet<Category>();
...
...
 }

PaletteCategory component implements Field interface.

BeanEditForm is showing everything else fine.

Any ideas?



On Mon, Jan 26, 2009 at 2:32 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Try using your component outside of a BeanEditForm please.
>
> Em Mon, 26 Jan 2009 15:15:54 -0300, Davor Miku <da...@gmail.com>
> escreveu:
>
>
>  Hi,
>>
>> Palette-base custom component "category.palette" is not showing when
>> embedded into beaneditform:
>>
>> <t:beaneditform t:id="content" exclude="id">
>>    <t:parameter name="categories">
>>        <t:category.palette t:id="categories"
>> t:currentCategories="content.categories" />
>>    </t:parameter>
>> </t:beaneditform>
>>
>> Otherwise it woks fine. There is no exception. PRODUCTION_MODE is set to
>> false.
>>
>> Can anyone help, please?
>>
>> I'm pretty new to Tapestry, sorry if I'm making dumb questions.
>>
>
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Palette-base component not showing

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Try using your component outside of a BeanEditForm please.

Em Mon, 26 Jan 2009 15:15:54 -0300, Davor Miku <da...@gmail.com>  
escreveu:

> Hi,
>
> Palette-base custom component "category.palette" is not showing when
> embedded into beaneditform:
>
> <t:beaneditform t:id="content" exclude="id">
>     <t:parameter name="categories">
>         <t:category.palette t:id="categories"
> t:currentCategories="content.categories" />
>     </t:parameter>
> </t:beaneditform>
>
> Otherwise it woks fine. There is no exception. PRODUCTION_MODE is set to
> false.
>
> Can anyone help, please?
>
> I'm pretty new to Tapestry, sorry if I'm making dumb questions.



-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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