Re: Blog post about Tapestry 5

2008-12-19 Thread Bill Holloway
Thanks, Borut, for this!  I especially appreciate the depth you went
to in discussing the use of the component message catalog with forms
and how you can factor regexp validation entirely into the catalog.
This is going to help some colleagues of mine become believers.

Bill

On Fri, Dec 19, 2008 at 11:57 AM, Borut Bolčina  wrote:
> Thanks to all,
>
> I have updated the post to include a case if you don't get listed all the
> arhetypes (including Tapestry quickstart).
>
> If anyone has an improvement to suggest please don't hesitate to leave a
> comment.
>
> Cheers,
> Borut
>
> 2008/12/18 Marcelo Lotif 
>
>> Very good, Borut, a really nice tutorial!
>> It shows an alternative way to create a tapestry project, you should
>> consider adding it to the wiki page.
>>
>> 2008/12/18 Inge Solvoll 
>>
>> > I agree!
>> >
>> > The examples on the wiki and jumpstart have been my primary resource for
>> > learning the concepts of T5 hands on. The framework itself has been
>> > relatively easy to understand by reading the documentation. But when it
>> > comes to actual coding, it makes a huge difference with ready-to-use real
>> > world examples of things you actually need to do, like for example
>> > implementing a security regime for your application, or adjusting the
>> > message system to your needs.
>> >
>> > The wiki examples are still excellent and a great resource, but we need
>> > more, we need them to be user friendly and readable, and we need them to
>> be
>> > very available! Great work by Borut here!
>> >
>> > Inge
>> >
>> > On Thu, Dec 18, 2008 at 10:54 AM, Jan Vissers > > >wrote:
>> >
>> > > > Borut Bolčina wrote:
>> > > >> Hi,
>> > > >>
>> > > >> I'd like some feedback / proofreading on
>> > > http://bbwebcraft.blogspot.com/
>> > > >> as
>> > > >> I want to smooth the first steps with Tapestry 5 for newbies
>> > (including
>> > > >> me).
>> > > >>
>> > > >>
>> > > > I think you step to step environment set-up is really good and
>> handily
>> > > > replace the now outdated "T5 tutorial#1" (
>> > > > http://tapestry.apache.org/tapestry5/tutorial1/ ).
>> > > >
>> > > > So, congratulation :)
>> > >
>> > > +1
>> > >
>> > > Now T5 is GA - there should be a 'push' in community related activities
>> > > like creating tutorials and examples the way you did!
>> > >
>> > > >
>> > > >
>> > > > --
>> > > > Francois Armand
>> > > > Etudes & Développements J2EE
>> > > > Groupe Linagora - http://www.linagora.com
>> > > > Tél.: +33 (0)1 58 18 68 28
>> > > > ---
>> > > > http://fanf42.blogspot.com
>> > > > InterLDAP - http://interldap.org
>> > > > FederID - http://www.federid.org/
>> > > > Open Source identities management and federation
>> > > >
>> > > >
>> > > > -
>> > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> > > > For additional commands, e-mail: users-h...@tapestry.apache.org
>> > > >
>> > > >
>> > >
>> > >
>> > >
>> > > -
>> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> > > For additional commands, e-mail: users-h...@tapestry.apache.org
>> > >
>> > >
>> >
>>
>>
>>
>> --
>> Atenciosamente,
>>
>> Marcelo Lotif
>> Programador Java e Tapestry
>> FIEC - Federação das Indústrias do Estado do Ceará
>> (85) 3421-5910
>>
>



-- 
Without coding you have no product
Without testing, no quality
Without refactoring, no future


Re: AppModule not loaded?? (No ClassLoaders found for: org.apache.tapestry5.services.FormSupport)

2008-12-19 Thread Howard Lewis Ship
Tapestry 5.1 helps with this by logging, to the console, the names of
all the module classes that are loaded at startup.

On Thu, Dec 18, 2008 at 10:13 PM, Jean Luc  wrote:
> Aaaarg... solved. I missed the second part of "Tapestry looks for a
> module builder class in the services package (under the root package). It
> capitalizes the  and appends "Module" and I recently renamed
> the default app to something else.
>
> I still had to do the workaround with
> javassist.runtime.Desc.useContextClassLoader = true;
>
>
> On Thu, Dec 18, 2008 at 10:04 PM, Jean Luc  wrote:
>
>> Tapestry 5.0.18/JBoss 4.2.3GA/Spring 2.5/Hibernate 3.2.4sp1 (coming with
>> JBoss)JDK1.6.0_10/S
>>
>> The following exception is thrown when hitting the Login page
>> (interestingly, the Start page is fine) - there is additional information
>> following it. The (emerging) application used to work before adding the
>> Hibernate integration.
>>
>>
>>  No ClassLoaders found for: org.apache.tapestry5.services.FormSupport [at
>> classpath:org/apache/tapestry5/corelib/components/ExceptionDisplay.tml, line
>> 3, column 45]
>> at
>> org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:84)
>> at
>> org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121)
>> at
>> $PageRenderQueue_11e4d1d2736.render($PageRenderQueue_11e4d1d2736.java)
>> at
>> $PageRenderQueue_11e4d1d2734.render($PageRenderQueue_11e4d1d2734.java)
>> at
>> org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200)
>> at
>> org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580)
>> at
>> $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java)
>> at
>> org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561)
>> at
>> $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java)
>> at
>> org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543)
>> at
>> $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java)
>> at
>> org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525)
>> at
>> $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java)
>> at
>> org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495)
>> at
>> $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java)
>> at
>> $MarkupRenderer_11e4d1d2733.renderMarkup($MarkupRenderer_11e4d1d2733.java)
>> at
>> org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64)
>> at
>> $PageMarkupRenderer_11e4d1d2731.renderPageMarkup($PageMarkupRenderer_11e4d1d2731.java)
>> at
>> org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57)
>> at
>> $PageResponseRenderer_11e4d1d2701.renderPageResponse($PageResponseRenderer_11e4d1d2701.java)
>> at
>> org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:77)
>> at
>> $RequestExceptionHandler_11e4d1d26ef.handleRequestException($RequestExceptionHandler_11e4d1d26ef.java)
>> at
>> org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42)
>> at
>> $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java)
>> at
>> org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:621)
>> at
>> $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java)
>> at
>> org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:611)
>> at
>> $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java)
>> at
>> org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
>> at
>> $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java)
>> at
>> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
>> at
>> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
>> at
>> org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83)
>> at
>> org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
>> at
>> $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java)
>> at
>> $RequestHandler_11e4d1d26e8.service($RequestHandler_11e4d1d26e8.java)
>> at
>> org.apache.tapestry5.services.TapestryModule$16.service(TapestryModule.java:1007)
>> at
>> org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
>> at
>> $HttpServletRequestHandler_11e4d1d26e9.service($HttpServletRequestHandler_11e4d1d26

Re: Blog post about Tapestry 5

2008-12-19 Thread Borut Bolčina
Thanks to all,

I have updated the post to include a case if you don't get listed all the
arhetypes (including Tapestry quickstart).

If anyone has an improvement to suggest please don't hesitate to leave a
comment.

Cheers,
Borut

2008/12/18 Marcelo Lotif 

> Very good, Borut, a really nice tutorial!
> It shows an alternative way to create a tapestry project, you should
> consider adding it to the wiki page.
>
> 2008/12/18 Inge Solvoll 
>
> > I agree!
> >
> > The examples on the wiki and jumpstart have been my primary resource for
> > learning the concepts of T5 hands on. The framework itself has been
> > relatively easy to understand by reading the documentation. But when it
> > comes to actual coding, it makes a huge difference with ready-to-use real
> > world examples of things you actually need to do, like for example
> > implementing a security regime for your application, or adjusting the
> > message system to your needs.
> >
> > The wiki examples are still excellent and a great resource, but we need
> > more, we need them to be user friendly and readable, and we need them to
> be
> > very available! Great work by Borut here!
> >
> > Inge
> >
> > On Thu, Dec 18, 2008 at 10:54 AM, Jan Vissers  > >wrote:
> >
> > > > Borut Bolčina wrote:
> > > >> Hi,
> > > >>
> > > >> I'd like some feedback / proofreading on
> > > http://bbwebcraft.blogspot.com/
> > > >> as
> > > >> I want to smooth the first steps with Tapestry 5 for newbies
> > (including
> > > >> me).
> > > >>
> > > >>
> > > > I think you step to step environment set-up is really good and
> handily
> > > > replace the now outdated "T5 tutorial#1" (
> > > > http://tapestry.apache.org/tapestry5/tutorial1/ ).
> > > >
> > > > So, congratulation :)
> > >
> > > +1
> > >
> > > Now T5 is GA - there should be a 'push' in community related activities
> > > like creating tutorials and examples the way you did!
> > >
> > > >
> > > >
> > > > --
> > > > Francois Armand
> > > > Etudes & Développements J2EE
> > > > Groupe Linagora - http://www.linagora.com
> > > > Tél.: +33 (0)1 58 18 68 28
> > > > ---
> > > > http://fanf42.blogspot.com
> > > > InterLDAP - http://interldap.org
> > > > FederID - http://www.federid.org/
> > > > Open Source identities management and federation
> > > >
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > > >
> > > >
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
>
>
>
> --
> Atenciosamente,
>
> Marcelo Lotif
> Programador Java e Tapestry
> FIEC - Federação das Indústrias do Estado do Ceará
> (85) 3421-5910
>


Re: [T5] GenericSelectModel Problem

2008-12-19 Thread CG
you save my life !  I keep thinking that the problem is at the idField
(because the error message) , and I does not realize that the
labelField is the culprit here ... the name is correct but I didn't hv
a getter/setter for the labelField !

troubleshooting for  1 week , finally solved  ... hurray, thx 

thx all ...


On Fri, Dec 19, 2008 at 9:07 PM, Marcelo Lotif  wrote:
> Just a quick hint: check if the name of your bean attributes are correct
> when you pass it to the GenericSelectionModel (labelField and idField). In
> my implementation, when the names are wrong, the list shows the toString()
> method.
>
> On Fri, Dec 19, 2008 at 3:59 AM, CG  wrote:
>
>> thx all ..
>> seems like I am not the one one face this problem ..
>> but very strange that only for some bean , it works , only this
>> particular one ...
>>
>>
>> On Fri, Dec 19, 2008 at 12:57 AM, Peter Stavrinides
>>  wrote:
>> > Don't know if this will help your but we had a similar issue (not using
>> the beanmodel though), we used to override toString() in an EnumSelectModel
>> but found this no longer works, the solution was to implement a properties
>> file instead to do the mapping... I haven't tried it but you might be able
>> to do something similar for your situation.
>> >
>> > cheers,
>> > Peter
>> >
>> >
>> > - Original Message -
>> > From: "Geoff Callender" 
>> > To: "Tapestry users" 
>> > Sent: Thursday, 18 December, 2008 10:24:18 AM GMT +02:00 Athens, Beirut,
>> Bucharest, Istanbul
>> > Subject: Re: [T5] GenericSelectModel Problem
>> >
>> > Unfortunately I don't have time to re-create your problem, but does
>> > the slightly different GenericSelectModel in JumpStart have the same
>> > problem?  http://localhost:8080/jumpstart/examples/select/easyobject
>> >
>> > Cheers,
>> >
>> > Geoff
>> >
>> > On 18/12/2008, at 12:02 PM, CG wrote:
>> >
>> >> anybody can help ? ...
>> >>
>> >> On Thu, Dec 18, 2008 at 12:00 AM, CG  wrote:
>> >>> I have implemented the GenericSelectModel as written in wiki
>> >>> (http://wiki.apache.org/tapestry/Tapestry5HowtoSelectWithObjects) and
>> >>> it worked fine.
>> >>> However, recently I add a new Bean class and create a
>> >>> GenericSelectModel for it , and the nightmare come.
>> >>>
>> >>> For other bean class , no problem. Only for this particular bean
>> >>> class.(UnitMeasurement)
>> >>>
>> >>> After debugging ..
>> >>> I found out that , in the function toClient(T object) , we suppose to
>> >>> receive parameter object as a bean class instance . however, for this
>> >>> UnitMeasurement class
>> >>> the object is String type, more precise , is a toString() value for
>> >>> the bean instance
>> >>>
>> >>> I hv checked whether I pass in the model and encoder correctly or not
>> >>> , yes, it is correct.  I really hv no idea to solve  .. please help.
>> >>> Thanks.
>> >>>
>> >>>
>> >>> T5 version : 5.0.18
>> >>>
>> >>> Rgds,
>> >>> CG
>> >>>
>> >>>
>> >>> Error
>> >>> 
>> >>> [toClient] obj : MaterialType: [id=1, type=R, description=Raw
>> >>> Material, isProduced=false, isPurchased=true, isForSales=false,
>> >>> isJIT=true, record status=A, session id=, create login=admin, create
>> >>> app=, create timestamp=2008-09-30 21:27:09.0, modify login=admin,
>> >>> modify app=MaterialTypeMaintenance, modify time=2008-10-06
>> >>> 21:44:51.0,
>> >>> version=0]
>> >>> [toClient] obj : MaterialType: [id=1, type=R, description=Raw
>> >>> Material, isProduced=false, isPurchased=true, isForSales=false,
>> >>> isJIT=true, record status=A, session id=, create login=admin, create
>> >>> app=, create timestamp=2008-09-30 21:27:09.0, modify login=admin,
>> >>> modify app=MaterialTypeMaintenance, modify time=2008-10-06
>> >>> 21:44:51.0,
>> >>> version=0]
>> >>> [toClient] obj : MaterialType: [id=2, type=S,
>> >>> description=Semi-Finished Material, isProduced=true,
>> >>> isPurchased=false, isForSales=false, isJIT=true, record status=A,
>> >>> session id=, create login=admin, create app=, create
>> >>> timestamp=2008-09-30 21:27:09.0, modify login=admin, modify
>> >>> app=MaterialTypeMaintenance, modify time=2008-10-25 00:48:43.0,
>> >>> version=0]
>> >>> [toClient] obj : MaterialType: [id=3, type=F, description=Finished
>> >>> Goods, isProduced=true, isPurchased=false, isForSales=true,
>> >>> isJIT=false, record status=A, session id=, create login=admin, create
>> >>> app=, create timestamp=2008-09-30 21:27:09.0, modify login=admin,
>> >>> modify app=, modify time=2008-09-30 21:27:09.0, version=0]
>> >>> [toClient] obj : MaterialType: [id=4, type=P, description=Phantom
>> >>> Material, isProduced=true, isPurchased=false, isForSales=false,
>> >>> isJIT=true, record status=A, session id=, create login=admin, create
>> >>> app=, create timestamp=2008-10-02 22:28:33.0, modify login=admin,
>> >>> modify app=MaterialTypeMaintenance, modify time=2008-10-25
>> >>> 00:51:09.0,
>> >>> version=0]
>> >>> [toClient] obj : MaterialType: [id=5, type=T, description=Trading
>> >>> Material, isProduced=false, isPurchased

Re: Select with @InjectSelectionModel problem (value passed in is null)

2008-12-19 Thread Marcelo Lotif
Great idea, it was corrected.

Thanks.

On Fri, Dec 19, 2008 at 10:17 AM, Joe123 ---  wrote:

>
> Hi,
>
> Thanks for your answer. I forgot to add the
> public void onPrepare() and therefore the list was empty.
>
> Thanks.
>
> One addition for the tapestry wiki page.
>
> I think it is better to replace:
> String accessActualName = transformation.addField(Modifier.PRIVATE,
> "org.apache.tapestry5.ioc.services.PropertyAccess", "_access");
> into:
> String accessActualName = transformation.addField(Modifier.PRIVATE,
> PropertyAccess.class.getName(), "_access");
>
> So we use no hardcoded package names.
>
>
>
> > Joe,
> >
> > There were some errors on the wiki page and I've already corrected it,
> but
> > was nothing related with this problem.
> > I can't reproduce it here, can you show some more of your code so I can
> test
> > it here?
>
> > >
> > > I have been debugging and noticed that the failure is in the
> > > GenericValueEncoder.toValue method
> > > The idFieldAdapter property is null and therefore it can't find a
> match.
> > >
> > > And why is the idFieldAdapter null?
> > > Because in the constructor(see below), the list parameter was null
> after
> > > submitting the form.
> > > Do I need to persist my List of objects? I don't want this
> > > And I think the example on the wiki doesn't work as well.
> > >
> > > Does anyone had this error earlier?
> > >
> > >
> > > public GenericValueEncoder(List list, String idField, PropertyAccess
> > > access) {
> > >if (idField != null && !idField.equalsIgnoreCase("null")) {
> > >if (list.size() > 0) {
> > >this.idFieldAdapter =
> > > access.getAdapter(list.get(0).getClass()).getPropertyAdapter(idField);
> > >}
> > >}
> > >this.list = list;
> > > }
> > >
> > > > Hello
> > > >
> > > > I use the select component with the @InjectSelectionModel annotation
> as
> > > described here:
> > > > http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects
> > > >
> > > >  > > model="categoriesSelectionModel" encoder="categoriesValueEncoder"
> > > value="selectedCategory" />
> > > >
> > > > The select is nicely loaded with categories. Next I submit the form
> and I
> > > notice that the setSelectedCategory method is called. But it prints
> > > "setSelectedCategory:  null"
> > > > See below for some the corresponding java code. What am I doing
> wrong?
> > > Why is the selectedCategory null, after I have selected a category and
> > > submitted the form?
> > > >
> > > > @InjectSelectionModel(labelField = "name", idField = "id")
> > > > @Property
> > > > private List categories = new ArrayList();
> > > >
> > > > @Persist
> > > > private Category selectedCategory;
> > > >
> > > > public void setSelectedCategory(Category selectedCategory) {
> > > >
> > > >   System.out.println("setSelectedCategory: " + selectedCategory);
> > > >
> > > >   this.selectedCategory = selectedCategory;
> > > >
> > > > }
> > > >
> > > > public Category getSelectedRootCategory() {
> > > >   return selectedRootCategory;
> > > > }
> > > >
> > > >
> > > >
> > > > _
> > > > More than messages–check out the rest of the Windows Live™.
> > > > http://www.microsoft.com/windows/windowslive/
> > >
> > > _
> > > Show them the way! Add maps and directions to your party invites.
> > > http://www.microsoft.com/windows/windowslive/events.aspx
> >
> >
> >
> >
> > --
> > Atenciosamente,
> >
> > Marcelo Lotif
> > Programador Java e Tapestry
> > FIEC - Federação das Indústrias do Estado do Ceará
> > (85) 3421-5910
>
> _
> Drag n' drop—Get easy photo sharing with Windows Live™ Photos.
>
> http://www.microsoft.com/windows/windowslive/photos.aspx




-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3421-5910


RE: Select with @InjectSelectionModel problem (value passed in is null)

2008-12-19 Thread Joe123 ---

Hi,

Thanks for your answer. I forgot to add the 
public void onPrepare() and therefore the list was empty.

Thanks.

One addition for the tapestry wiki page. 

I think it is better to replace:
String accessActualName = transformation.addField(Modifier.PRIVATE, 
"org.apache.tapestry5.ioc.services.PropertyAccess", "_access");
into:
String accessActualName = transformation.addField(Modifier.PRIVATE, 
PropertyAccess.class.getName(), "_access");

So we use no hardcoded package names.



> Joe,
> 
> There were some errors on the wiki page and I've already corrected it, but
> was nothing related with this problem.
> I can't reproduce it here, can you show some more of your code so I can test
> it here?

> >
> > I have been debugging and noticed that the failure is in the
> > GenericValueEncoder.toValue method
> > The idFieldAdapter property is null and therefore it can't find a match.
> >
> > And why is the idFieldAdapter null?
> > Because in the constructor(see below), the list parameter was null after
> > submitting the form.
> > Do I need to persist my List of objects? I don't want this
> > And I think the example on the wiki doesn't work as well.
> >
> > Does anyone had this error earlier?
> >
> >
> > public GenericValueEncoder(List list, String idField, PropertyAccess
> > access) {
> >if (idField != null && !idField.equalsIgnoreCase("null")) {
> >if (list.size() > 0) {
> >this.idFieldAdapter =
> > access.getAdapter(list.get(0).getClass()).getPropertyAdapter(idField);
> >}
> >}
> >this.list = list;
> > }
> >
> > > Hello
> > >
> > > I use the select component with the @InjectSelectionModel annotation as
> > described here:
> > > http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects
> > >
> > >  > model="categoriesSelectionModel" encoder="categoriesValueEncoder"
> > value="selectedCategory" />
> > >
> > > The select is nicely loaded with categories. Next I submit the form and I
> > notice that the setSelectedCategory method is called. But it prints
> > "setSelectedCategory:  null"
> > > See below for some the corresponding java code. What am I doing wrong?
> > Why is the selectedCategory null, after I have selected a category and
> > submitted the form?
> > >
> > > @InjectSelectionModel(labelField = "name", idField = "id")
> > > @Property
> > > private List categories = new ArrayList();
> > >
> > > @Persist
> > > private Category selectedCategory;
> > >
> > > public void setSelectedCategory(Category selectedCategory) {
> > >
> > >   System.out.println("setSelectedCategory: " + selectedCategory);
> > >
> > >   this.selectedCategory = selectedCategory;
> > >
> > > }
> > >
> > > public Category getSelectedRootCategory() {
> > >   return selectedRootCategory;
> > > }
> > >
> > >
> > >
> > > _
> > > More than messages–check out the rest of the Windows Live™.
> > > http://www.microsoft.com/windows/windowslive/
> >
> > _
> > Show them the way! Add maps and directions to your party invites.
> > http://www.microsoft.com/windows/windowslive/events.aspx
> 
> 
> 
> 
> -- 
> Atenciosamente,
> 
> Marcelo Lotif
> Programador Java e Tapestry
> FIEC - Federação das Indústrias do Estado do Ceará
> (85) 3421-5910

_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/photos.aspx

Re: [T5] GenericSelectModel Problem

2008-12-19 Thread Marcelo Lotif
Just a quick hint: check if the name of your bean attributes are correct
when you pass it to the GenericSelectionModel (labelField and idField). In
my implementation, when the names are wrong, the list shows the toString()
method.

On Fri, Dec 19, 2008 at 3:59 AM, CG  wrote:

> thx all ..
> seems like I am not the one one face this problem ..
> but very strange that only for some bean , it works , only this
> particular one ...
>
>
> On Fri, Dec 19, 2008 at 12:57 AM, Peter Stavrinides
>  wrote:
> > Don't know if this will help your but we had a similar issue (not using
> the beanmodel though), we used to override toString() in an EnumSelectModel
> but found this no longer works, the solution was to implement a properties
> file instead to do the mapping... I haven't tried it but you might be able
> to do something similar for your situation.
> >
> > cheers,
> > Peter
> >
> >
> > - Original Message -
> > From: "Geoff Callender" 
> > To: "Tapestry users" 
> > Sent: Thursday, 18 December, 2008 10:24:18 AM GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> > Subject: Re: [T5] GenericSelectModel Problem
> >
> > Unfortunately I don't have time to re-create your problem, but does
> > the slightly different GenericSelectModel in JumpStart have the same
> > problem?  http://localhost:8080/jumpstart/examples/select/easyobject
> >
> > Cheers,
> >
> > Geoff
> >
> > On 18/12/2008, at 12:02 PM, CG wrote:
> >
> >> anybody can help ? ...
> >>
> >> On Thu, Dec 18, 2008 at 12:00 AM, CG  wrote:
> >>> I have implemented the GenericSelectModel as written in wiki
> >>> (http://wiki.apache.org/tapestry/Tapestry5HowtoSelectWithObjects) and
> >>> it worked fine.
> >>> However, recently I add a new Bean class and create a
> >>> GenericSelectModel for it , and the nightmare come.
> >>>
> >>> For other bean class , no problem. Only for this particular bean
> >>> class.(UnitMeasurement)
> >>>
> >>> After debugging ..
> >>> I found out that , in the function toClient(T object) , we suppose to
> >>> receive parameter object as a bean class instance . however, for this
> >>> UnitMeasurement class
> >>> the object is String type, more precise , is a toString() value for
> >>> the bean instance
> >>>
> >>> I hv checked whether I pass in the model and encoder correctly or not
> >>> , yes, it is correct.  I really hv no idea to solve  .. please help.
> >>> Thanks.
> >>>
> >>>
> >>> T5 version : 5.0.18
> >>>
> >>> Rgds,
> >>> CG
> >>>
> >>>
> >>> Error
> >>> 
> >>> [toClient] obj : MaterialType: [id=1, type=R, description=Raw
> >>> Material, isProduced=false, isPurchased=true, isForSales=false,
> >>> isJIT=true, record status=A, session id=, create login=admin, create
> >>> app=, create timestamp=2008-09-30 21:27:09.0, modify login=admin,
> >>> modify app=MaterialTypeMaintenance, modify time=2008-10-06
> >>> 21:44:51.0,
> >>> version=0]
> >>> [toClient] obj : MaterialType: [id=1, type=R, description=Raw
> >>> Material, isProduced=false, isPurchased=true, isForSales=false,
> >>> isJIT=true, record status=A, session id=, create login=admin, create
> >>> app=, create timestamp=2008-09-30 21:27:09.0, modify login=admin,
> >>> modify app=MaterialTypeMaintenance, modify time=2008-10-06
> >>> 21:44:51.0,
> >>> version=0]
> >>> [toClient] obj : MaterialType: [id=2, type=S,
> >>> description=Semi-Finished Material, isProduced=true,
> >>> isPurchased=false, isForSales=false, isJIT=true, record status=A,
> >>> session id=, create login=admin, create app=, create
> >>> timestamp=2008-09-30 21:27:09.0, modify login=admin, modify
> >>> app=MaterialTypeMaintenance, modify time=2008-10-25 00:48:43.0,
> >>> version=0]
> >>> [toClient] obj : MaterialType: [id=3, type=F, description=Finished
> >>> Goods, isProduced=true, isPurchased=false, isForSales=true,
> >>> isJIT=false, record status=A, session id=, create login=admin, create
> >>> app=, create timestamp=2008-09-30 21:27:09.0, modify login=admin,
> >>> modify app=, modify time=2008-09-30 21:27:09.0, version=0]
> >>> [toClient] obj : MaterialType: [id=4, type=P, description=Phantom
> >>> Material, isProduced=true, isPurchased=false, isForSales=false,
> >>> isJIT=true, record status=A, session id=, create login=admin, create
> >>> app=, create timestamp=2008-10-02 22:28:33.0, modify login=admin,
> >>> modify app=MaterialTypeMaintenance, modify time=2008-10-25
> >>> 00:51:09.0,
> >>> version=0]
> >>> [toClient] obj : MaterialType: [id=5, type=T, description=Trading
> >>> Material, isProduced=false, isPurchased=true, isForSales=true,
> >>> isJIT=false, record status=A, session id=, create login=admin, create
> >>> app=, create timestamp=2008-10-04 00:36:53.0, modify login=admin,
> >>> modify app=MaterialTypeMaintenance, modify time=2008-10-25
> >>> 00:51:19.0,
> >>> version=0]
> >>> [toClient] obj : MaterialType: [id=6, type=C, description=Consumable
> >>> Material, isProduced=false, isPurchased=true, isForSales=false,
> >>> isJIT=false, record status=A, session id=, create login=admin, create
> >>

Re: How to refresh a component in a different html file

2008-12-19 Thread olip

Hey JoeMayo,

I am currently having the same problem. I use the onEvent component and have
a event handler for it. The eventhandler refreshes the page but my layout
component (which surrounds the page...such in the tapestry tutorial for
nonbelievers the layout.tml component) gets not refreshed every time the
page gets refreshed. Sometimes it gets refreshed sometimes not.

Greetings Oli

JoeMayo wrote:
> 
> 
> Hey, I have a small question in Tapestry.
> I need to know how to refresh a component in a different html file than
> the
> one I update from. 
> I have border.html which render inside some other html files (the border
> holds the header and the footer and the others hold the content between
> them). When the content files are being updated, only their content is
> refreshed but not the content of border.html. 
> 
> Now, in one of those content files I update a component in border.html,
> but
> as I said before, border.html is not refreshed (only for example when I
> change a tab in border.html, which causes it to refresh). I cannot refresh
> on demand because I can't access that component from the content html
> files
> since it's a different html file (the component is in border.html and I
> update it from another html file). 
> 
> BTW - border.html is refreshed only when I refresh the browser (f5)
> 
> Any ideas? hope I was clear. 
> 
> Thanks.
> -- 
> View this message in context:
> http://www.nabble.com/How-to-refresh-a-component-in-a-different-html-file-tp21078237p21078237.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/How-to-refresh-a-component-in-a-different-html-file-tp1674160p1677670.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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



Re: Select with @InjectSelectionModel problem (value passed in is null)

2008-12-19 Thread Marcelo Lotif
Joe,

There were some errors on the wiki page and I've already corrected it, but
was nothing related with this problem.
I can't reproduce it here, can you show some more of your code so I can test
it here?

On Fri, Dec 19, 2008 at 8:32 AM, Joe123 ---  wrote:

>
> I have been debugging and noticed that the failure is in the
> GenericValueEncoder.toValue method
> The idFieldAdapter property is null and therefore it can't find a match.
>
> And why is the idFieldAdapter null?
> Because in the constructor(see below), the list parameter was null after
> submitting the form.
> Do I need to persist my List of objects? I don't want this
> And I think the example on the wiki doesn't work as well.
>
> Does anyone had this error earlier?
>
>
> public GenericValueEncoder(List list, String idField, PropertyAccess
> access) {
>if (idField != null && !idField.equalsIgnoreCase("null")) {
>if (list.size() > 0) {
>this.idFieldAdapter =
> access.getAdapter(list.get(0).getClass()).getPropertyAdapter(idField);
>}
>}
>this.list = list;
> }
>
> > Hello
> >
> > I use the select component with the @InjectSelectionModel annotation as
> described here:
> > http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects
> >
> >  model="categoriesSelectionModel" encoder="categoriesValueEncoder"
> value="selectedCategory" />
> >
> > The select is nicely loaded with categories. Next I submit the form and I
> notice that the setSelectedCategory method is called. But it prints
> "setSelectedCategory:  null"
> > See below for some the corresponding java code. What am I doing wrong?
> Why is the selectedCategory null, after I have selected a category and
> submitted the form?
> >
> > @InjectSelectionModel(labelField = "name", idField = "id")
> > @Property
> > private List categories = new ArrayList();
> >
> > @Persist
> > private Category selectedCategory;
> >
> > public void setSelectedCategory(Category selectedCategory) {
> >
> >   System.out.println("setSelectedCategory: " + selectedCategory);
> >
> >   this.selectedCategory = selectedCategory;
> >
> > }
> >
> > public Category getSelectedRootCategory() {
> >   return selectedRootCategory;
> > }
> >
> >
> >
> > _
> > More than messages–check out the rest of the Windows Live™.
> > http://www.microsoft.com/windows/windowslive/
>
> _
> Show them the way! Add maps and directions to your party invites.
> http://www.microsoft.com/windows/windowslive/events.aspx




-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3421-5910


RE: Select with @InjectSelectionModel problem (value passed in is null)

2008-12-19 Thread Joe123 ---

I have been debugging and noticed that the failure is in the 
GenericValueEncoder.toValue method
The idFieldAdapter property is null and therefore it can't find a match.

And why is the idFieldAdapter null?
Because in the constructor(see below), the list parameter was null after 
submitting the form.
Do I need to persist my List of objects? I don't want this
And I think the example on the wiki doesn't work as well.

Does anyone had this error earlier?


public GenericValueEncoder(List list, String idField, PropertyAccess access) 
{
if (idField != null && !idField.equalsIgnoreCase("null")) {
if (list.size() > 0) {
this.idFieldAdapter = 
access.getAdapter(list.get(0).getClass()).getPropertyAdapter(idField);
}
}
this.list = list;
}

> Hello
> 
> I use the select component with the @InjectSelectionModel annotation as 
> described here:
> http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects
> 
>  model="categoriesSelectionModel" encoder="categoriesValueEncoder" 
> value="selectedCategory" />
> 
> The select is nicely loaded with categories. Next I submit the form and I 
> notice that the setSelectedCategory method is called. But it prints 
> "setSelectedCategory:  null"
> See below for some the corresponding java code. What am I doing wrong? Why is 
> the selectedCategory null, after I have selected a category and submitted the 
> form?
> 
> @InjectSelectionModel(labelField = "name", idField = "id")
> @Property
> private List categories = new ArrayList();
> 
> @Persist
> private Category selectedCategory;
> 
> public void setSelectedCategory(Category selectedCategory) {
> 
>   System.out.println("setSelectedCategory: " + selectedCategory);
> 
>   this.selectedCategory = selectedCategory;
> 
> }
> 
> public Category getSelectedRootCategory() {
>   return selectedRootCategory;
> }
> 
> 
> 
> _
> More than messages–check out the rest of the Windows Live™.
> http://www.microsoft.com/windows/windowslive/

_
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/events.aspx

Select with @InjectSelectionModel problem (value passed in is null)

2008-12-19 Thread Joe123 ---

Hello

I use the select component with the @InjectSelectionModel annotation as 
described here:
http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects



The select is nicely loaded with categories. Next I submit the form and I 
notice that the setSelectedCategory method is called. But it prints 
"setSelectedCategory:  null"
See below for some the corresponding java code. What am I doing wrong? Why is 
the selectedCategory null, after I have selected a category and submitted the 
form?

@InjectSelectionModel(labelField = "name", idField = "id")
@Property
private List categories = new ArrayList();

@Persist
private Category selectedCategory;

public void setSelectedCategory(Category selectedCategory) {

  System.out.println("setSelectedCategory: " + selectedCategory);

  this.selectedCategory = selectedCategory;

}

public Category getSelectedRootCategory() {
  return selectedRootCategory;
}



_
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/

Re: tapestry:parameter namespace

2008-12-19 Thread Andy Pahne



Oops. I am still on 5.0.18. But I really thought from the beginning that 
there might be something wrong with my setup.


Andy




Howard Lewis Ship schrieb:

What version of Tapestry are you using?  You need to be using
5.1.0.0-SNAPSHOT for this feature.

On Thu, Dec 18, 2008 at 12:21 AM, Andy Pahne  wrote:
  

I think that it does not work for me, too. I tried the simple example that
is given in the component docs for the If component (with an else block),
but it diesn't seem to work. But I did not have time to investigate further.

Andy



James Hillyerd schrieb:


I've tried using the xmlns:p="tapestry:parameter" namespace a couple
times, but it doesn't seem to work.  Also, the manual says t:parameter
is deprecated, but then says that the new namespace was introduced in
Tapestry 5.1 - which I don't think exists yet?
Any ideas?

From the manual:

Parameter Namespace

Parameter namespaces are a new feature introduced in Tapestry 5.1.
They are a more concise way of passing parameter blocks to components.

You must define a special namespace, usually given the prefix "p":

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
xmlns:p="tapestry:parameter">


-james

--
James A. Hillyerd 

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


  

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







  



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



T4 Reset page property

2008-12-19 Thread issoax

Hello I'm having the following problem I'm using a property in a page which i
want to reset when i go to another page /or refresh the current one/ 
I did it persist="flash" but it in that case it is reseted on the second
refresh or page load which doesnt work for me
So is there a way to find out that the page is refreshed or another is
loaded so then to reset my property

Regards
-- 
View this message in context: 
http://www.nabble.com/T4-Reset-page-property-tp21088341p21088341.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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