You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in Nashua <kc...@live.com> on 2012/09/21 03:15:39 UTC
T4 to T5
Guys/Gals (if any),
I am upgrading some T4 code to T5
I have a T4 <select> component configuration/usage as follows:
--- TML snippet ---
<tr>
<td width="25%" align="left" nowrap="NOWRAP">
<t:Label>Items Per Page</t:Label>
<select t:type="Select" id="itemsPerPageSelect"
model="literal:5,10,15,25,50,100,250,500,1000,5000,10000"
value="itemsPerPage"
defaultValue="9"
onchange="tapestry.form.refresh(this.form)"
/>
--- JAVA snippet ---
@Component(parameters =
{ "event=itemsPerPageChange", "clientId=itemsPerPageSelect" })
private Select itemsPerPageSelect;
@OnEvent(value = "action", component = "select")
public Object onItemsPerPageChange()
{
...
Am I missing something ? I don't understand the error below as to why this configuration is not sufficient.
Thanks in advance...
kcolassi@live.com
An unexpected application exception has occurred.java.lang.RuntimeExceptionException
assembling root component of page Home: Embedded component(s)
itemsPerPageSelect, page, tableColumnsSelect are defined within
component class org.tynamo.examples.hibernatesecurity.components.Gallery
(or a super-class of Gallery), but are not present in the component
template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).org.apache.tapestry5.ioc.internal.OperationExceptionEmbedded
component(s) itemsPerPageSelect, page, tableColumnsSelect are defined
within component class
org.tynamo.examples.hibernatesecurity.components.Gallery (or a
super-class of Gallery), but are not present in the component template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).traceConstructing instance of page class org.tynamo.examples.hibernatesecurity.pages.HomeAssembling root component for page HomeCreating ComponentAssembler for org.tynamo.examples.hibernatesecurity.components.Galleryjava.lang.RuntimeExceptionEmbedded
component(s) itemsPerPageSelect, page, tableColumnsSelect are defined
within component class
org.tynamo.examples.hibernatesecurity.components.Gallery (or a
super-class of Gallery), but are not present in the component template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).
RE: T4 to T5
Posted by Ken in Nashua <kc...@live.com>.
Ivan,
Preeviette !!!
Thanks for the generous contribution and good faith. I am excited.
I will give that a shot over the weekend.
Your tech support for tapestry 5 looks good.
I will be as generous to post my widget when I get it QA'd... going to be some weeks though... each month I think i have time and keep getting clobbered with interference.
I meant to get this gallery going months ago but been pre-empted.
I will be sure to share when done.
have a great week
KEN
Re: T4 to T5
Posted by Ivan Khalopik <ik...@gmail.com>.
1. To place components defined in java class on your template you should
use t:id attribute equal to field name(id attribute references clientId
logic). As you don't use this attribute in your code snippet you have 2
separate selects. One of this selects are defined within java class and
doesn't present on template, so you have an exception(As far as I
understand you have such mistakes with page and tableColumnsSelect components
too). To fix this issue you can:
1) set t:id attribute:
<select t:type="Select" t:id="itemsPerPageSelect"
model="literal:5,10,15,25,50,
100,250,500,1000,5000,10000"
value="itemsPerPage"
/>
2) remove component definition from java class(if you don't use it for
custom validation)
2. To use select component dynamic behaviour you should wrap it with zone
component and define its zone parameter. Default event propogated will be
EventConstants.VALUE_CHANGED:
TML:
<t:zone t:id="updateZone">
...
<select t:type="Select" t:id="itemsPerPageSelect"
model="literal:5,10,15,25,50,
100,250,500,1000,5000,10000"
value="itemsPerPage"
zone="prop:updateZone"
/>
...
</t:zone>
JAVA:
@Component
private Zone updateZone;
public String getUpdateZoneId() {
return updateZone.getClientId();
}
@OnEvent(value = EventConstants.VALUE_CHANGED, component = "
itemsPerPageSelect ")
public Object onItemsPerPageChange() {
...
return updateZone;
}
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html
3. Select component doesn't have defaultValue parameter.
On Fri, Sep 21, 2012 at 6:10 AM, Ken in Nashua <kc...@live.com> wrote:
>
> Referring to syntax... nothing personal.
> kcolassi@live.com
>
>
>
>
> From: kcolassi@live.com
> To: users@tapestry.apache.org
> Subject: RE: T4 to T5 <select> component usage
> Date: Thu, 20 Sep 2012 23:06:27 -0400
>
>
>
>
>
> Apologies for post... I uncovered some additional configurations that I
> failed to migrate to my T5 code base.
>
> The actual definitions of the components usage I am attempting to use...
> inside my Home.tml
>
> <h1>
> <div id="page.title">
> <span jwcid="@Insert" value="Listings"/>
> </div>
> </h1>
>
> <form jwcid="galleryForm@Form" listener="listener:galleryFormSubmit">
> <div jwcid="galleryWidget@custom:Gallery"
> collectionType="ognl:@org.trails.demo.Listing@class"
> itemsPerPage="ognl:itemsPerPage"
> tableColumns="ognl:tableColumns"
> cursor="ognl:cursor"
> >
>
> <span jwcid="@RenderBody">content goes here</span>
> </div>
> </form>
>
>
> <span jwcid="@Script" script="/org/trails/demo/components/Gallery.script"
> component = "ognl:components.galleryWidget"
> itemsPerPage = "ognl:components.galleryWidget.itemsPerPage"
> tableColumns = "ognl:components.galleryWidget.tableColumns"
> itemCount="ognl:components.galleryWidget.collection.size"
> cursor="ognl:cursor"
> />
>
> ghack... glad ognl is gone... and thats no fluff
>
> kcolassi@live.com
>
>
>
>
> From: kcolassi@live.com
> To: users@tapestry.apache.org
> Subject: T4 to T5 <select> component usage
> Date: Thu, 20 Sep 2012 21:15:39 -0400
>
>
>
>
>
> Guys/Gals (if any),
>
> I am upgrading some T4 code to T5
>
> I have a T4 <select> component configuration/usage as follows:
>
> --- TML snippet ---
> <tr>
> <td width="25%" align="left" nowrap="NOWRAP">
> <t:Label>Items Per Page</t:Label>
> <select t:type="Select" id="itemsPerPageSelect"
>
> model="literal:5,10,15,25,50,100,250,500,1000,5000,10000"
> value="itemsPerPage"
> defaultValue="9"
> onchange="tapestry.form.refresh(this.form)"
> />
>
> --- JAVA snippet ---
>
> @Component(parameters =
> { "event=itemsPerPageChange", "clientId=itemsPerPageSelect" })
>
> private Select itemsPerPageSelect;
>
> @OnEvent(value = "action", component = "select")
> public Object onItemsPerPageChange()
> {
> ...
>
> Am I missing something ? I don't understand the error below as to why this
> configuration is not sufficient.
>
> Thanks in advance...
>
> kcolassi@live.com
>
> An unexpected application exception has
> occurred.java.lang.RuntimeExceptionException
> assembling root component of page Home: Embedded component(s)
> itemsPerPageSelect, page, tableColumnsSelect are defined within
> component class org.tynamo.examples.hibernatesecurity.components.Gallery
> (or a super-class of Gallery), but are not present in the component
> template
>
> (classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).org.apache.tapestry5.ioc.internal.OperationExceptionEmbedded
> component(s) itemsPerPageSelect, page, tableColumnsSelect are defined
> within component class
> org.tynamo.examples.hibernatesecurity.components.Gallery (or a
> super-class of Gallery), but are not present in the component template
> (classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).traceConstructing
> instance of page class
> org.tynamo.examples.hibernatesecurity.pages.HomeAssembling root component
> for page HomeCreating ComponentAssembler for
> org.tynamo.examples.hibernatesecurity.components.Galleryjava.lang.RuntimeExceptionEmbedded
> component(s) itemsPerPageSelect, page, tableColumnsSelect are defined
> within component class
> org.tynamo.examples.hibernatesecurity.components.Gallery (or a
> super-class of Gallery), but are not present in the component template
> (classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).
>
>
>
>
>
--
BR
Ivan
RE: T4 to T5
Posted by Ken in Nashua <kc...@live.com>.
Referring to syntax... nothing personal.
kcolassi@live.com
From: kcolassi@live.com
To: users@tapestry.apache.org
Subject: RE: T4 to T5 <select> component usage
Date: Thu, 20 Sep 2012 23:06:27 -0400
Apologies for post... I uncovered some additional configurations that I failed to migrate to my T5 code base.
The actual definitions of the components usage I am attempting to use... inside my Home.tml
<h1>
<div id="page.title">
<span jwcid="@Insert" value="Listings"/>
</div>
</h1>
<form jwcid="galleryForm@Form" listener="listener:galleryFormSubmit">
<div jwcid="galleryWidget@custom:Gallery"
collectionType="ognl:@org.trails.demo.Listing@class"
itemsPerPage="ognl:itemsPerPage"
tableColumns="ognl:tableColumns"
cursor="ognl:cursor"
>
<span jwcid="@RenderBody">content goes here</span>
</div>
</form>
<span jwcid="@Script" script="/org/trails/demo/components/Gallery.script"
component = "ognl:components.galleryWidget"
itemsPerPage = "ognl:components.galleryWidget.itemsPerPage"
tableColumns = "ognl:components.galleryWidget.tableColumns"
itemCount="ognl:components.galleryWidget.collection.size"
cursor="ognl:cursor"
/>
ghack... glad ognl is gone... and thats no fluff
kcolassi@live.com
From: kcolassi@live.com
To: users@tapestry.apache.org
Subject: T4 to T5 <select> component usage
Date: Thu, 20 Sep 2012 21:15:39 -0400
Guys/Gals (if any),
I am upgrading some T4 code to T5
I have a T4 <select> component configuration/usage as follows:
--- TML snippet ---
<tr>
<td width="25%" align="left" nowrap="NOWRAP">
<t:Label>Items Per Page</t:Label>
<select t:type="Select" id="itemsPerPageSelect"
model="literal:5,10,15,25,50,100,250,500,1000,5000,10000"
value="itemsPerPage"
defaultValue="9"
onchange="tapestry.form.refresh(this.form)"
/>
--- JAVA snippet ---
@Component(parameters =
{ "event=itemsPerPageChange", "clientId=itemsPerPageSelect" })
private Select itemsPerPageSelect;
@OnEvent(value = "action", component = "select")
public Object onItemsPerPageChange()
{
...
Am I missing something ? I don't understand the error below as to why this configuration is not sufficient.
Thanks in advance...
kcolassi@live.com
An unexpected application exception has occurred.java.lang.RuntimeExceptionException
assembling root component of page Home: Embedded component(s)
itemsPerPageSelect, page, tableColumnsSelect are defined within
component class org.tynamo.examples.hibernatesecurity.components.Gallery
(or a super-class of Gallery), but are not present in the component
template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).org.apache.tapestry5.ioc.internal.OperationExceptionEmbedded
component(s) itemsPerPageSelect, page, tableColumnsSelect are defined
within component class
org.tynamo.examples.hibernatesecurity.components.Gallery (or a
super-class of Gallery), but are not present in the component template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).traceConstructing instance of page class org.tynamo.examples.hibernatesecurity.pages.HomeAssembling root component for page HomeCreating ComponentAssembler for org.tynamo.examples.hibernatesecurity.components.Galleryjava.lang.RuntimeExceptionEmbedded
component(s) itemsPerPageSelect, page, tableColumnsSelect are defined
within component class
org.tynamo.examples.hibernatesecurity.components.Gallery (or a
super-class of Gallery), but are not present in the component template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).
RE: T4 to T5
Posted by Ken in Nashua <kc...@live.com>.
Apologies for post... I uncovered some additional configurations that I failed to migrate to my T5 code base.
The actual definitions of the components usage I am attempting to use... inside my Home.tml
<h1>
<div id="page.title">
<span jwcid="@Insert" value="Listings"/>
</div>
</h1>
<form jwcid="galleryForm@Form" listener="listener:galleryFormSubmit">
<div jwcid="galleryWidget@custom:Gallery"
collectionType="ognl:@org.trails.demo.Listing@class"
itemsPerPage="ognl:itemsPerPage"
tableColumns="ognl:tableColumns"
cursor="ognl:cursor"
>
<span jwcid="@RenderBody">content goes here</span>
</div>
</form>
<span jwcid="@Script" script="/org/trails/demo/components/Gallery.script"
component = "ognl:components.galleryWidget"
itemsPerPage = "ognl:components.galleryWidget.itemsPerPage"
tableColumns = "ognl:components.galleryWidget.tableColumns"
itemCount="ognl:components.galleryWidget.collection.size"
cursor="ognl:cursor"
/>
ghack... glad ognl is gone... and thats no fluff
kcolassi@live.com
From: kcolassi@live.com
To: users@tapestry.apache.org
Subject: T4 to T5 <select> component usage
Date: Thu, 20 Sep 2012 21:15:39 -0400
Guys/Gals (if any),
I am upgrading some T4 code to T5
I have a T4 <select> component configuration/usage as follows:
--- TML snippet ---
<tr>
<td width="25%" align="left" nowrap="NOWRAP">
<t:Label>Items Per Page</t:Label>
<select t:type="Select" id="itemsPerPageSelect"
model="literal:5,10,15,25,50,100,250,500,1000,5000,10000"
value="itemsPerPage"
defaultValue="9"
onchange="tapestry.form.refresh(this.form)"
/>
--- JAVA snippet ---
@Component(parameters =
{ "event=itemsPerPageChange", "clientId=itemsPerPageSelect" })
private Select itemsPerPageSelect;
@OnEvent(value = "action", component = "select")
public Object onItemsPerPageChange()
{
...
Am I missing something ? I don't understand the error below as to why this configuration is not sufficient.
Thanks in advance...
kcolassi@live.com
An unexpected application exception has occurred.java.lang.RuntimeExceptionException
assembling root component of page Home: Embedded component(s)
itemsPerPageSelect, page, tableColumnsSelect are defined within
component class org.tynamo.examples.hibernatesecurity.components.Gallery
(or a super-class of Gallery), but are not present in the component
template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).org.apache.tapestry5.ioc.internal.OperationExceptionEmbedded
component(s) itemsPerPageSelect, page, tableColumnsSelect are defined
within component class
org.tynamo.examples.hibernatesecurity.components.Gallery (or a
super-class of Gallery), but are not present in the component template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).traceConstructing instance of page class org.tynamo.examples.hibernatesecurity.pages.HomeAssembling root component for page HomeCreating ComponentAssembler for org.tynamo.examples.hibernatesecurity.components.Galleryjava.lang.RuntimeExceptionEmbedded
component(s) itemsPerPageSelect, page, tableColumnsSelect are defined
within component class
org.tynamo.examples.hibernatesecurity.components.Gallery (or a
super-class of Gallery), but are not present in the component template
(classpath:org/tynamo/examples/hibernatesecurity/components/Gallery.tml).