You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mark <ma...@xeric.net> on 2011/07/01 21:14:56 UTC

Palette inside a beaneditor

I have a beaneditor inside an Ajax loop that is inside a form.  One of
the attributes needs to be a palette.  When I try to simply add it as
a parameter, it doesn't show up.  It looks like it would work if I
skip using the beaneditor and just add all the fields manually. Is
there a reason this doesn't seem to work or am I overlooking something
silly?

Also is there a way for me to tell Tapestry to use the Palette
automatically whenever it tries to render this particular attribute
inside of a beaneditor or beaneditorform?

Thanks for any suggestions.

Mark


        <div t:type="ajaxformloop"  t:id="ticketClasses"
source="event.ticketClasses"  encoder="ticketClassEncoder"
value="ticketClass">
			<t:beaneditor object="ticketClass">
<!-- This is the part that doesn't show up when it is within the beaneditor -->
				<p:discountDefinitions>
					<t:palette  t:id="discountDefinitions"
selected="ticketClass.discountDefinitions"
						encoder="discountDefinitionEncoder" model="discountDefinitionsModel"/>
				</p:discountDefinitions>

				</t:beaneditor>
          	<t:removerowlink>remove ticket class</t:removerowlink>
          		<p:addRow>
					<t:addRowLink t:zone="ticketClasses">Add a ticket class</t:addRowLink>
				</p:addRow>
        </div>

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


Re: Palette inside a beaneditor

Posted by Mark <ma...@xeric.net>.
> Please use the add parameter which adds fields not present in the default
> generated BeanModel.
>  <t:beaneditor object="ticketClass" add="discountDefinitions">

Ah ok. I see.  I knew to add this when I was trying to show something
that wasn't present in the object, but I didn't realize I needed to do
it for things that were present, but the beaneditor didn't know how to
display.  It makes perfect sense now, but I'm embarrassed at how much
time I spent trying to figure it out. :)

Thank you!

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


Re: Palette inside a beaneditor

Posted by "dragan.sahpaskix@gmail.com" <dr...@gmail.com>.
Hi,

On Fri, Jul 1, 2011 at 9:14 PM, Mark <ma...@xeric.net> wrote:

> I have a beaneditor inside an Ajax loop that is inside a form.  One of
> the attributes needs to be a palette.  When I try to simply add it as
> a parameter, it doesn't show up.  It looks like it would work if I
> skip using the beaneditor and just add all the fields manually. Is
> there a reason this doesn't seem to work or am I overlooking something
> silly?
>

Please use the add parameter which adds fields not present in the default
generated BeanModel.
 <t:beaneditor object="ticketClass" add="discountDefinitions">


> Also is there a way for me to tell Tapestry to use the Palette
> automatically whenever it tries to render this particular attribute
> inside of a beaneditor or beaneditorform?
>

Yes. You have to  contribute to BeanBlockSource etc.
There is a nice explanation in the tapestry
documentation<http://tapestry.apache.org/beaneditform-guide.html#BeanEditFormGuide-AddingNewPropertyEditors>
.


> Thanks for any suggestions.
>
> Mark
>
>
>        <div t:type="ajaxformloop"  t:id="ticketClasses"
> source="event.ticketClasses"  encoder="ticketClassEncoder"
> value="ticketClass">
>                        <t:beaneditor object="ticketClass">
> <!-- This is the part that doesn't show up when it is within the beaneditor
> -->
>                                <p:discountDefinitions>
>                                        <t:palette
>  t:id="discountDefinitions"
> selected="ticketClass.discountDefinitions"
>
>  encoder="discountDefinitionEncoder" model="discountDefinitionsModel"/>
>                                </p:discountDefinitions>
>
>                                </t:beaneditor>
>                <t:removerowlink>remove ticket class</t:removerowlink>
>                        <p:addRow>
>                                        <t:addRowLink
> t:zone="ticketClasses">Add a ticket class</t:addRowLink>
>                                </p:addRow>
>        </div>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>