You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by CG <le...@gmail.com> on 2008/12/17 17:00:27 UTC

[T5] GenericSelectModel Problem

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
app=MaterialTypeMaintenance, create timestamp=2008-10-06 21:49:31.0,
modify login=admin, modify app=MaterialTypeMaintenance, modify
time=2008-10-25 00:51:29.0, version=0]
[toClient] obj : UOM: [id=1, record status=A, session id=1, create
login=manual, create app=manual, create timestamp=2008-12-15
00:00:00.0, modify login=manual, modify app=manual, modify
time=2008-12-15 00:00:00.0, version=1]
23:43:23,759 ERROR [MaterialMaintenance] Render queue error in
BeforeRenderTemplate[MaterialMaintenance:uom]: Error reading property
'id' of UOM: [id=1, record status=A, session id=1, create
login=manual, create app=manual, create timestamp=2008-12-15
00:00:00.0, modify login=manual, modify app=manual, modify
time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
declaring class
org.apache.tapestry5.ioc.internal.util.TapestryException: Error
reading property 'id' of UOM: [id=1, record status=A, session id=1,
create login=manual, create app=manual, create timestamp=2008-12-15
00:00:00.0, modify login=manual, modify app=manual, modify
time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
declaring class [at context:MaterialMaintenance.tml, line 60, column
129]
	at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:932)
	at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50)
	at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$10.render(ComponentPageElementImpl.java:325)
	at org.apache.

Page class Code
==========
    	uomsSelect = null;
    	materialTypesSelect = null;
	uomsSelect = new
GenericSelectModel<UnitMeasurement>(uoms,UnitMeasurement.class,"shortForm","id",_access_uom);
	materialTypesSelect = new
GenericSelectModel<MaterialType>(materialTypes,MaterialType.class,"typeDescription","id",_access);
		




Tml template
========
                       <tr>
                           <th><t:label
t:for="MaterialType">MaterialType</t:label>:</th>
                           <td>   <select  t:type="select"
t:id="materialType" t:model="materialTypesSelect"
encoder="materialTypesSelect" t:value="materialType" /> </td>
                       </tr>
                       <tr>
                           <th><t:label t:for="UOM">Unit Of
Measurement</t:label>:</th>
                           <td>   <select  t:type="select" t:id="UOM"
t:model="uomsSelect" encoder="uomsSelect" t:value="UOM" /> </td>
                       </tr>

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


Re: JSONStreamResponse. How to return an array?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Francois is right, the client side can not directly invoke methods of
Tapestry pages or components; this is by design. The component side
can send events to specific components, and then what happens is
totally defined by the server (and therefore, more predictable and
less hackable).

Component event URLs encapsulate the following information:
- Name of containing page
- Id of component
- Name of event
- Event context

By injecting the ComponentResources object into your page, you can
invoke the method createEventLink().  This Link object can be
converted to a string via it's method toAbsoluteURI().  That's the
string your client-side JavaScript needs.

Example:

@Inject
private ComponentResources resources;

@Envrionmental
private RenderSupport renderSupport;

void afterRender()
{
  Link link = resources.createEventLink("getnodes");

  renderSupport.addScript("new MyClientSideObject('%s');",
link.toAbsoluteURI());
}

JSONArray onGetNodes()
{
  return . . . ;
}


The event handler method does not have to be public.  The Link in this
case identifies the page and event name, indicates a null component
(meaning, the page's root component), and has no context.  The URL
will looking something like  /mypage:getnodes  (mypage is the page
name, getnodes is the event name).

On Thu, Dec 18, 2008 at 4:42 AM, Francois Armand <fa...@linagora.com> wrote:
> superoverdrive@gmx.de wrote:
>>
>> Where is this "autocomple mixin" example? I have looked everywhere, but
>> can't find it.
>> Also read about this on the Tapestry website...
>>
>> So you mean something like:
>>
>>
>> @OnEvent(component = "getnodes")
>>
>
> Would be value in place of component, or name your method "onGetnodes()
> {...}
>
> The autocomplete mixin is in the core lib, so you can get the source with T5
> core lib, for example:
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Autocomplete.java?view=markup
>
> --
> 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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: JSONStreamResponse. How to return an array?

Posted by Francois Armand <fa...@linagora.com>.
superoverdrive@gmx.de wrote:
> Where is this "autocomple mixin" example? I have looked everywhere, but can't find it.
> Also read about this on the Tapestry website...
>
> So you mean something like:
>
>
> @OnEvent(component = "getnodes")
>   
Would be value in place of component, or name your method "onGetnodes() 
{...}

The autocomplete mixin is in the core lib, so you can get the source 
with T5 core lib, for example: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Autocomplete.java?view=markup

-- 
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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: JSONStreamResponse. How to return an array?

Posted by su...@gmx.de.
Where is this "autocomple mixin" example? I have looked everywhere, but can't find it.
Also read about this on the Tapestry website...

So you mean something like:


@OnEvent(component = "getnodes")
	public JSONArray getNodes() {

		Request request = requestGlobals.getRequest();
		
		
		JSONArray record = new JSONArray();
			
		JSONObject jsObject = new JSONObject();
			
			jsObject.put("text", "adapter");
			jsObject.put("id", "/adapter");
			jsObject.put("cls", "folder");
			
			record.put(jsObject);
		
		
		return record;
	}

?

http://localhost:8080/reorder:getnodes

says:

"Request event 'getnodes' (on component Reorder) was not handled; you must provide a matching event handler method in the component or in one of its containers."

Thanks!

-------- Original-Nachricht --------
> Datum: Thu, 18 Dec 2008 12:46:23 +0100
> Von: Francois Armand <fa...@linagora.com>
> An: Tapestry users <us...@tapestry.apache.org>
> Betreff: Re: JSONStreamResponse. How to return an array?

> superoverdrive@gmx.de wrote:
> > http://localhost:8080/reorder.getnodes
> >
> > I get:
> >
> > "Component Reorder does not contain an embedded component with id
> 'getnodes'. Available components: (none)."
> >
> >   
> It's because what you actually asked here is : call the "getnodes" 
> component on page reorder. Dot in T5 url are for component navigation, 
> for instance "http://context/page.comp1.comp2 means is the component 
> with t:id "comp2" in component with t:id "comp1" in page "page". Events 
> are denoted with colons, as in "http://context/page.comp1.comp2:event".
> 
> So, what you want is to fire a T5 events on the Java side. For that, you 
> will have to create an evenLink (the link with colon), call it with JS, 
> and handle the event in Java with "onMY_EVENT".
> There is an example in the autocomple mixin.
> 
> If you had a zone, you could return a block or a component with just:
> - on client side, call: $T('zoneId').zoneManager.updateFromURL('theUrl') 
> with theUrl somethink that looks like: "mypage:eventName"
> - on the java side, handle the event with an onEventName handler 
> returning your block or updated component.
> 
> 
> -- 
> 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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org

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


Re: JSONStreamResponse. How to return an array?

Posted by Francois Armand <fa...@linagora.com>.
superoverdrive@gmx.de wrote:
> http://localhost:8080/reorder.getnodes
>
> I get:
>
> "Component Reorder does not contain an embedded component with id 'getnodes'. Available components: (none)."
>
>   
It's because what you actually asked here is : call the "getnodes" 
component on page reorder. Dot in T5 url are for component navigation, 
for instance "http://context/page.comp1.comp2 means is the component 
with t:id "comp2" in component with t:id "comp1" in page "page". Events 
are denoted with colons, as in "http://context/page.comp1.comp2:event".

So, what you want is to fire a T5 events on the Java side. For that, you 
will have to create an evenLink (the link with colon), call it with JS, 
and handle the event in Java with "onMY_EVENT".
There is an example in the autocomple mixin.

If you had a zone, you could return a block or a component with just:
- on client side, call: $T('zoneId').zoneManager.updateFromURL('theUrl') 
with theUrl somethink that looks like: "mypage:eventName"
- on the java side, handle the event with an onEventName handler 
returning your block or updated component.


-- 
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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: JSONStreamResponse. How to return an array?

Posted by su...@gmx.de.
p.s.:



public JSONArray getNodes() {

		Request request = requestGlobals.getRequest();
		
		
		JSONArray record = new JSONArray();
			
		JSONObject jsObject = new JSONObject();
			
			jsObject.put("text", "adapter");
			jsObject.put("id", "/adapter");
			jsObject.put("cls", "folder");
			
			record.put(jsObject);
		
		
		return record;
	}


When I then access: 

http://localhost:8080/reorder.getnodes

I get:

"Component Reorder does not contain an embedded component with id 'getnodes'. Available components: (none)."


-------- Original-Nachricht --------
> Datum: Thu, 18 Dec 2008 10:33:12 +0100
> Von: superoverdrive@gmx.de
> An: users@tapestry.apache.org
> Betreff: JSONStreamResponse. How to return an array?

> I am trying to return a JSON Array from a Page:
> 
> Array
> (
>     [0] => Array
>         (
>             [text] => adapter
>             [id] => /adapter
>             [cls] => folder
>         )
> 
>     [1] => Array
>         (
>             [text] => air
>             [id] => /air
>             [cls] => folder
>         )
> 
>     [2] => Array
>         (
>             [text] => build
>             [id] => /build
>             [cls] => folder
>         )
> 
> 
> However JSONStreamResponse only returns a single JSON object and not an
> array of objects,
> 
> How is this supposed to work in Tapestry5?
> 
> Thanks!
> 
> Toby
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org

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


JSONStreamResponse. How to return an array?

Posted by su...@gmx.de.
I am trying to return a JSON Array from a Page:

Array
(
    [0] => Array
        (
            [text] => adapter
            [id] => /adapter
            [cls] => folder
        )

    [1] => Array
        (
            [text] => air
            [id] => /air
            [cls] => folder
        )

    [2] => Array
        (
            [text] => build
            [id] => /build
            [cls] => folder
        )


However JSONStreamResponse only returns a single JSON object and not an array of objects,

How is this supposed to work in Tapestry5?

Thanks!

Toby

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


Re: [T5] GenericSelectModel Problem

Posted by CG <le...@gmail.com>.
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 <ml...@gmail.com> 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 <le...@gmail.com> 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
>> <P....@albourne.com> 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" <ge...@gmail.com>
>> > To: "Tapestry users" <us...@tapestry.apache.org>
>> > 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 <le...@gmail.com> 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
>> >>> app=MaterialTypeMaintenance, create timestamp=2008-10-06 21:49:31.0,
>> >>> modify login=admin, modify app=MaterialTypeMaintenance, modify
>> >>> time=2008-10-25 00:51:29.0, version=0]
>> >>> [toClient] obj : UOM: [id=1, record status=A, session id=1, create
>> >>> login=manual, create app=manual, create timestamp=2008-12-15
>> >>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> >>> time=2008-12-15 00:00:00.0, version=1]
>> >>> 23:43:23,759 ERROR [MaterialMaintenance] Render queue error in
>> >>> BeforeRenderTemplate[MaterialMaintenance:uom]: Error reading property
>> >>> 'id' of UOM: [id=1, record status=A, session id=1, create
>> >>> login=manual, create app=manual, create timestamp=2008-12-15
>> >>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> >>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
>> >>> declaring class
>> >>> org.apache.tapestry5.ioc.internal.util.TapestryException: Error
>> >>> reading property 'id' of UOM: [id=1, record status=A, session id=1,
>> >>> create login=manual, create app=manual, create timestamp=2008-12-15
>> >>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> >>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
>> >>> declaring class [at context:MaterialMaintenance.tml, line 60, column
>> >>> 129]
>> >>>       at
>> >>> org
>> >>> .apache
>> >>> .tapestry5
>> >>> .internal
>> >>> .structure
>> >>> .ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:932)
>> >>>       at
>> >>> org
>> >>> .apache.tapestry5.internal.structure.ComponentPageElementImpl.access
>> >>> $200(ComponentPageElementImpl.java:50)
>> >>>       at
>> >>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl
>> >>> $10.render(ComponentPageElementImpl.java:325)
>> >>>       at org.apache.
>> >>>
>> >>> Page class Code
>> >>> ==========
>> >>>       uomsSelect = null;
>> >>>       materialTypesSelect = null;
>> >>>       uomsSelect = new
>> >>> GenericSelectModel
>> >>> <
>> >>> UnitMeasurement
>> >>> >(uoms,UnitMeasurement.class,"shortForm","id",_access_uom);
>> >>>       materialTypesSelect = new
>> >>> GenericSelectModel
>> >>> <
>> >>> MaterialType
>> >>> >(materialTypes,MaterialType.class,"typeDescription","id",_access);
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> Tml template
>> >>> ========
>> >>>                      <tr>
>> >>>                          <th><t:label
>> >>> t:for="MaterialType">MaterialType</t:label>:</th>
>> >>>                          <td>   <select  t:type="select"
>> >>> t:id="materialType" t:model="materialTypesSelect"
>> >>> encoder="materialTypesSelect" t:value="materialType" /> </td>
>> >>>                      </tr>
>> >>>                      <tr>
>> >>>                          <th><t:label t:for="UOM">Unit Of
>> >>> Measurement</t:label>:</th>
>> >>>                          <td>   <select  t:type="select" t:id="UOM"
>> >>> t:model="uomsSelect" encoder="uomsSelect" t:value="UOM" /> </td>
>> >>>                      </tr>
>> >>>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> --
> Atenciosamente,
>
> Marcelo Lotif
> Programador Java e Tapestry
> FIEC - Federação das Indústrias do Estado do Ceará
> (85) 3421-5910
>

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


Re: [T5] GenericSelectModel Problem

Posted by Marcelo Lotif <ml...@gmail.com>.
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 <le...@gmail.com> 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
> <P....@albourne.com> 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" <ge...@gmail.com>
> > To: "Tapestry users" <us...@tapestry.apache.org>
> > 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 <le...@gmail.com> 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
> >>> app=MaterialTypeMaintenance, create timestamp=2008-10-06 21:49:31.0,
> >>> modify login=admin, modify app=MaterialTypeMaintenance, modify
> >>> time=2008-10-25 00:51:29.0, version=0]
> >>> [toClient] obj : UOM: [id=1, record status=A, session id=1, create
> >>> login=manual, create app=manual, create timestamp=2008-12-15
> >>> 00:00:00.0, modify login=manual, modify app=manual, modify
> >>> time=2008-12-15 00:00:00.0, version=1]
> >>> 23:43:23,759 ERROR [MaterialMaintenance] Render queue error in
> >>> BeforeRenderTemplate[MaterialMaintenance:uom]: Error reading property
> >>> 'id' of UOM: [id=1, record status=A, session id=1, create
> >>> login=manual, create app=manual, create timestamp=2008-12-15
> >>> 00:00:00.0, modify login=manual, modify app=manual, modify
> >>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
> >>> declaring class
> >>> org.apache.tapestry5.ioc.internal.util.TapestryException: Error
> >>> reading property 'id' of UOM: [id=1, record status=A, session id=1,
> >>> create login=manual, create app=manual, create timestamp=2008-12-15
> >>> 00:00:00.0, modify login=manual, modify app=manual, modify
> >>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
> >>> declaring class [at context:MaterialMaintenance.tml, line 60, column
> >>> 129]
> >>>       at
> >>> org
> >>> .apache
> >>> .tapestry5
> >>> .internal
> >>> .structure
> >>> .ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:932)
> >>>       at
> >>> org
> >>> .apache.tapestry5.internal.structure.ComponentPageElementImpl.access
> >>> $200(ComponentPageElementImpl.java:50)
> >>>       at
> >>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl
> >>> $10.render(ComponentPageElementImpl.java:325)
> >>>       at org.apache.
> >>>
> >>> Page class Code
> >>> ==========
> >>>       uomsSelect = null;
> >>>       materialTypesSelect = null;
> >>>       uomsSelect = new
> >>> GenericSelectModel
> >>> <
> >>> UnitMeasurement
> >>> >(uoms,UnitMeasurement.class,"shortForm","id",_access_uom);
> >>>       materialTypesSelect = new
> >>> GenericSelectModel
> >>> <
> >>> MaterialType
> >>> >(materialTypes,MaterialType.class,"typeDescription","id",_access);
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> Tml template
> >>> ========
> >>>                      <tr>
> >>>                          <th><t:label
> >>> t:for="MaterialType">MaterialType</t:label>:</th>
> >>>                          <td>   <select  t:type="select"
> >>> t:id="materialType" t:model="materialTypesSelect"
> >>> encoder="materialTypesSelect" t:value="materialType" /> </td>
> >>>                      </tr>
> >>>                      <tr>
> >>>                          <th><t:label t:for="UOM">Unit Of
> >>> Measurement</t:label>:</th>
> >>>                          <td>   <select  t:type="select" t:id="UOM"
> >>> t:model="uomsSelect" encoder="uomsSelect" t:value="UOM" /> </td>
> >>>                      </tr>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@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

Posted by CG <le...@gmail.com>.
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
<P....@albourne.com> 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" <ge...@gmail.com>
> To: "Tapestry users" <us...@tapestry.apache.org>
> 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 <le...@gmail.com> 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
>>> app=MaterialTypeMaintenance, create timestamp=2008-10-06 21:49:31.0,
>>> modify login=admin, modify app=MaterialTypeMaintenance, modify
>>> time=2008-10-25 00:51:29.0, version=0]
>>> [toClient] obj : UOM: [id=1, record status=A, session id=1, create
>>> login=manual, create app=manual, create timestamp=2008-12-15
>>> 00:00:00.0, modify login=manual, modify app=manual, modify
>>> time=2008-12-15 00:00:00.0, version=1]
>>> 23:43:23,759 ERROR [MaterialMaintenance] Render queue error in
>>> BeforeRenderTemplate[MaterialMaintenance:uom]: Error reading property
>>> 'id' of UOM: [id=1, record status=A, session id=1, create
>>> login=manual, create app=manual, create timestamp=2008-12-15
>>> 00:00:00.0, modify login=manual, modify app=manual, modify
>>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
>>> declaring class
>>> org.apache.tapestry5.ioc.internal.util.TapestryException: Error
>>> reading property 'id' of UOM: [id=1, record status=A, session id=1,
>>> create login=manual, create app=manual, create timestamp=2008-12-15
>>> 00:00:00.0, modify login=manual, modify app=manual, modify
>>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
>>> declaring class [at context:MaterialMaintenance.tml, line 60, column
>>> 129]
>>>       at
>>> org
>>> .apache
>>> .tapestry5
>>> .internal
>>> .structure
>>> .ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:932)
>>>       at
>>> org
>>> .apache.tapestry5.internal.structure.ComponentPageElementImpl.access
>>> $200(ComponentPageElementImpl.java:50)
>>>       at
>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl
>>> $10.render(ComponentPageElementImpl.java:325)
>>>       at org.apache.
>>>
>>> Page class Code
>>> ==========
>>>       uomsSelect = null;
>>>       materialTypesSelect = null;
>>>       uomsSelect = new
>>> GenericSelectModel
>>> <
>>> UnitMeasurement
>>> >(uoms,UnitMeasurement.class,"shortForm","id",_access_uom);
>>>       materialTypesSelect = new
>>> GenericSelectModel
>>> <
>>> MaterialType
>>> >(materialTypes,MaterialType.class,"typeDescription","id",_access);
>>>
>>>
>>>
>>>
>>>
>>> Tml template
>>> ========
>>>                      <tr>
>>>                          <th><t:label
>>> t:for="MaterialType">MaterialType</t:label>:</th>
>>>                          <td>   <select  t:type="select"
>>> t:id="materialType" t:model="materialTypesSelect"
>>> encoder="materialTypesSelect" t:value="materialType" /> </td>
>>>                      </tr>
>>>                      <tr>
>>>                          <th><t:label t:for="UOM">Unit Of
>>> Measurement</t:label>:</th>
>>>                          <td>   <select  t:type="select" t:id="UOM"
>>> t:model="uomsSelect" encoder="uomsSelect" t:value="UOM" /> </td>
>>>                      </tr>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: [T5] GenericSelectModel Problem

Posted by Peter Stavrinides <P....@albourne.com>.
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" <ge...@gmail.com>
To: "Tapestry users" <us...@tapestry.apache.org>
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 <le...@gmail.com> 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
>> app=MaterialTypeMaintenance, create timestamp=2008-10-06 21:49:31.0,
>> modify login=admin, modify app=MaterialTypeMaintenance, modify
>> time=2008-10-25 00:51:29.0, version=0]
>> [toClient] obj : UOM: [id=1, record status=A, session id=1, create
>> login=manual, create app=manual, create timestamp=2008-12-15
>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> time=2008-12-15 00:00:00.0, version=1]
>> 23:43:23,759 ERROR [MaterialMaintenance] Render queue error in
>> BeforeRenderTemplate[MaterialMaintenance:uom]: Error reading property
>> 'id' of UOM: [id=1, record status=A, session id=1, create
>> login=manual, create app=manual, create timestamp=2008-12-15
>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
>> declaring class
>> org.apache.tapestry5.ioc.internal.util.TapestryException: Error
>> reading property 'id' of UOM: [id=1, record status=A, session id=1,
>> create login=manual, create app=manual, create timestamp=2008-12-15
>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
>> declaring class [at context:MaterialMaintenance.tml, line 60, column
>> 129]
>>       at  
>> org 
>> .apache 
>> .tapestry5 
>> .internal 
>> .structure 
>> .ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:932)
>>       at  
>> org 
>> .apache.tapestry5.internal.structure.ComponentPageElementImpl.access 
>> $200(ComponentPageElementImpl.java:50)
>>       at  
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl 
>> $10.render(ComponentPageElementImpl.java:325)
>>       at org.apache.
>>
>> Page class Code
>> ==========
>>       uomsSelect = null;
>>       materialTypesSelect = null;
>>       uomsSelect = new
>> GenericSelectModel 
>> < 
>> UnitMeasurement 
>> >(uoms,UnitMeasurement.class,"shortForm","id",_access_uom);
>>       materialTypesSelect = new
>> GenericSelectModel 
>> < 
>> MaterialType 
>> >(materialTypes,MaterialType.class,"typeDescription","id",_access);
>>
>>
>>
>>
>>
>> Tml template
>> ========
>>                      <tr>
>>                          <th><t:label
>> t:for="MaterialType">MaterialType</t:label>:</th>
>>                          <td>   <select  t:type="select"
>> t:id="materialType" t:model="materialTypesSelect"
>> encoder="materialTypesSelect" t:value="materialType" /> </td>
>>                      </tr>
>>                      <tr>
>>                          <th><t:label t:for="UOM">Unit Of
>> Measurement</t:label>:</th>
>>                          <td>   <select  t:type="select" t:id="UOM"
>> t:model="uomsSelect" encoder="uomsSelect" t:value="UOM" /> </td>
>>                      </tr>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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


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


Re: [T5] GenericSelectModel Problem

Posted by Geoff Callender <ge...@gmail.com>.
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 <le...@gmail.com> 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
>> app=MaterialTypeMaintenance, create timestamp=2008-10-06 21:49:31.0,
>> modify login=admin, modify app=MaterialTypeMaintenance, modify
>> time=2008-10-25 00:51:29.0, version=0]
>> [toClient] obj : UOM: [id=1, record status=A, session id=1, create
>> login=manual, create app=manual, create timestamp=2008-12-15
>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> time=2008-12-15 00:00:00.0, version=1]
>> 23:43:23,759 ERROR [MaterialMaintenance] Render queue error in
>> BeforeRenderTemplate[MaterialMaintenance:uom]: Error reading property
>> 'id' of UOM: [id=1, record status=A, session id=1, create
>> login=manual, create app=manual, create timestamp=2008-12-15
>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
>> declaring class
>> org.apache.tapestry5.ioc.internal.util.TapestryException: Error
>> reading property 'id' of UOM: [id=1, record status=A, session id=1,
>> create login=manual, create app=manual, create timestamp=2008-12-15
>> 00:00:00.0, modify login=manual, modify app=manual, modify
>> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
>> declaring class [at context:MaterialMaintenance.tml, line 60, column
>> 129]
>>       at  
>> org 
>> .apache 
>> .tapestry5 
>> .internal 
>> .structure 
>> .ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:932)
>>       at  
>> org 
>> .apache.tapestry5.internal.structure.ComponentPageElementImpl.access 
>> $200(ComponentPageElementImpl.java:50)
>>       at  
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl 
>> $10.render(ComponentPageElementImpl.java:325)
>>       at org.apache.
>>
>> Page class Code
>> ==========
>>       uomsSelect = null;
>>       materialTypesSelect = null;
>>       uomsSelect = new
>> GenericSelectModel 
>> < 
>> UnitMeasurement 
>> >(uoms,UnitMeasurement.class,"shortForm","id",_access_uom);
>>       materialTypesSelect = new
>> GenericSelectModel 
>> < 
>> MaterialType 
>> >(materialTypes,MaterialType.class,"typeDescription","id",_access);
>>
>>
>>
>>
>>
>> Tml template
>> ========
>>                      <tr>
>>                          <th><t:label
>> t:for="MaterialType">MaterialType</t:label>:</th>
>>                          <td>   <select  t:type="select"
>> t:id="materialType" t:model="materialTypesSelect"
>> encoder="materialTypesSelect" t:value="materialType" /> </td>
>>                      </tr>
>>                      <tr>
>>                          <th><t:label t:for="UOM">Unit Of
>> Measurement</t:label>:</th>
>>                          <td>   <select  t:type="select" t:id="UOM"
>> t:model="uomsSelect" encoder="uomsSelect" t:value="UOM" /> </td>
>>                      </tr>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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


Re: [T5] GenericSelectModel Problem

Posted by CG <le...@gmail.com>.
anybody can help ? ...

On Thu, Dec 18, 2008 at 12:00 AM, CG <le...@gmail.com> 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
> app=MaterialTypeMaintenance, create timestamp=2008-10-06 21:49:31.0,
> modify login=admin, modify app=MaterialTypeMaintenance, modify
> time=2008-10-25 00:51:29.0, version=0]
> [toClient] obj : UOM: [id=1, record status=A, session id=1, create
> login=manual, create app=manual, create timestamp=2008-12-15
> 00:00:00.0, modify login=manual, modify app=manual, modify
> time=2008-12-15 00:00:00.0, version=1]
> 23:43:23,759 ERROR [MaterialMaintenance] Render queue error in
> BeforeRenderTemplate[MaterialMaintenance:uom]: Error reading property
> 'id' of UOM: [id=1, record status=A, session id=1, create
> login=manual, create app=manual, create timestamp=2008-12-15
> 00:00:00.0, modify login=manual, modify app=manual, modify
> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
> declaring class
> org.apache.tapestry5.ioc.internal.util.TapestryException: Error
> reading property 'id' of UOM: [id=1, record status=A, session id=1,
> create login=manual, create app=manual, create timestamp=2008-12-15
> 00:00:00.0, modify login=manual, modify app=manual, modify
> time=2008-12-15 00:00:00.0, version=1]: object is not an instance of
> declaring class [at context:MaterialMaintenance.tml, line 60, column
> 129]
>        at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:932)
>        at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50)
>        at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$10.render(ComponentPageElementImpl.java:325)
>        at org.apache.
>
> Page class Code
> ==========
>        uomsSelect = null;
>        materialTypesSelect = null;
>        uomsSelect = new
> GenericSelectModel<UnitMeasurement>(uoms,UnitMeasurement.class,"shortForm","id",_access_uom);
>        materialTypesSelect = new
> GenericSelectModel<MaterialType>(materialTypes,MaterialType.class,"typeDescription","id",_access);
>
>
>
>
>
> Tml template
> ========
>                       <tr>
>                           <th><t:label
> t:for="MaterialType">MaterialType</t:label>:</th>
>                           <td>   <select  t:type="select"
> t:id="materialType" t:model="materialTypesSelect"
> encoder="materialTypesSelect" t:value="materialType" /> </td>
>                       </tr>
>                       <tr>
>                           <th><t:label t:for="UOM">Unit Of
> Measurement</t:label>:</th>
>                           <td>   <select  t:type="select" t:id="UOM"
> t:model="uomsSelect" encoder="uomsSelect" t:value="UOM" /> </td>
>                       </tr>
>

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


Re: ExtJS configuration for T5 / interference with scriptaculous

Posted by Geoff Callender <ge...@gmail.com>.
Superoverdrive - please stop hijacking existing threads.  This one has  
hijacked a thread about GenericSelectModel.  When you have a new  
question can you please start a new thread.

On 18/12/2008, at 7:12 AM, superoverdrive@gmx.de wrote:

> In the following page you can define your own ExtJS library:
>
> http://extjs.com/products/extjs/build/index.php?ver=2.2&lib=Prototype
>
> What do you need to select/deselect in order to avoid interference  
> with the scriptaculous components that are built into the latest  
> Tapestry5?
>
> Thanks!
>
> Toby
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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


ExtJS configuration for T5 / interference with scriptaculous

Posted by su...@gmx.de.
In the following page you can define your own ExtJS library:

http://extjs.com/products/extjs/build/index.php?ver=2.2&lib=Prototype

What do you need to select/deselect in order to avoid interference with the scriptaculous components that are built into the latest Tapestry5?

Thanks!

Toby

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


http://code.google.com/p/extjs-tapestry/

Posted by su...@gmx.de.
Unfortunately there is no code (yet?).

http://code.google.com/p/extjs-tapestry/

but are there many any other projects that tried to integrate extjs with Tapestry5?

Thanks!

Toby

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


T5 Ajax Tree control?

Posted by su...@gmx.de.
I am looking for a T5 ajax tree control, such as this one here:

http://www.mathertel.de/AjaxEngine/S03_AJAXControls/TreeView.aspx

or this one:

http://samples.gaiaware.net/TreeView.aspx

however with right-mouse-click context menus....

Does something like this already exist for T5 ?

If not, what would be the best approach? Using existing Javascript code or do it all from scratch the "Tapestry" way to do it?

Thanks!

Toby

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