Re: Another example of Select with Objects

2008-02-20 Thread Marcelo Lotif
Bugs fixed =)

Thanks!

2008/2/20, Davor Hrg [EMAIL PROTECTED]:

 public static void

 contributeComponentClassTransformWorker(OrderedConfigurationComponentClassTransformWorker
 configuration, PropertyAccess propertyAccess)
 {
 configuration.add(InjectSelectionModel, new
 InjectSelectionModelWorker(propertyAccess), after:Inject*);
 }

 
 public InjectSelectionModelWorker(PropertyAccess propertyAccess)
 _propertyAccess = propertyAccess;
 }

 
 transformation.injectField(accessActualName, _propertyAccess);




 Davor Hrg

 On Feb 20, 2008 1:30 AM, Marcelo Lotif [EMAIL PROTECTED] wrote:
  Yeah, i know about that
 
  What i tried to do was just an attempt of doing things better and less
  effortlessly. I did this way because i don't want to say the bean type
  explicitly, this will be another parameter for the annotation. Thank's
 for
  the JIRA, I'll fix it, this is really a creepy piece of code...
 
  Another thing that i want to fix are these lines on the worker:
 
  String accessActualName = transformation.addField(Modifier.PRIVATE,
org.apache.tapestry.ioc.services.PropertyAccess,
  _access);
  transformation.injectField(accessActualName, new PropertyAccessImpl());
 
  I read about the PropertyAccess, and it should really be Injected, not
  directly instantiated like this, but i just can't do this, seems like
 the
  InjectSelectionModel worker class does not allow, i ever get no value.
 Is
  that any way of get the PropertyAccess with any other way without having
 to
  declare it explicitly on the page class?
 
 
  2008/2/19, Davor Hrg [EMAIL PROTECTED]:
 
  
   nice :)
  
   ...
   you should add this also in the warning section:
   the list must never be empty so that element type can be discovered...
   or this will fail:
  
 this.idFieldAdapter =
   access.getAdapter(list.get(0).getClass()).getPropertyAdapter(idField);
  
  
   or you could do some nasty reflection to get generic info from the
   field...
   some code for that can be found here:
   https://issues.apache.org/jira/browse/TAPESTRY-2053
   ...
   or just skip resolving idFieldAdapter because you don't actualy need
   it when list is empty
  
  
  
   Davor Hrg
  
  
   On Feb 19, 2008 8:16 PM, Marcelo Lotif [EMAIL PROTECTED] wrote:
Hi all,
I posted on the wiki another example on how to make a select with
   objects,
now i used an annotation to do this is a simpler way.
   
http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects
   
Cheers,
Marcelo Lotif
   
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
  Atenciosamente,
  Marcelo Lotif
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Atenciosamente,
Marcelo Lotif


Another example of Select with Objects

2008-02-19 Thread Marcelo Lotif
Hi all,
I posted on the wiki another example on how to make a select with objects,
now i used an annotation to do this is a simpler way.

http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects

Cheers,
Marcelo Lotif


Re: Another example of Select with Objects

2008-02-19 Thread Davor Hrg
nice :)

...
you should add this also in the warning section:
the list must never be empty so that element type can be discovered...
or this will fail:

 this.idFieldAdapter =
access.getAdapter(list.get(0).getClass()).getPropertyAdapter(idField);


or you could do some nasty reflection to get generic info from the field...
some code for that can be found here:
https://issues.apache.org/jira/browse/TAPESTRY-2053
...
or just skip resolving idFieldAdapter because you don't actualy need
it when list is empty



Davor Hrg

On Feb 19, 2008 8:16 PM, Marcelo Lotif [EMAIL PROTECTED] wrote:
 Hi all,
 I posted on the wiki another example on how to make a select with objects,
 now i used an annotation to do this is a simpler way.

 http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects

 Cheers,
 Marcelo Lotif


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Another example of Select with Objects

2008-02-19 Thread Marcelo Lotif
Yeah, i know about that

What i tried to do was just an attempt of doing things better and less
effortlessly. I did this way because i don't want to say the bean type
explicitly, this will be another parameter for the annotation. Thank's for
the JIRA, I'll fix it, this is really a creepy piece of code...

Another thing that i want to fix are these lines on the worker:

String accessActualName = transformation.addField(Modifier.PRIVATE,
  org.apache.tapestry.ioc.services.PropertyAccess,
_access);
transformation.injectField(accessActualName, new PropertyAccessImpl());

I read about the PropertyAccess, and it should really be Injected, not
directly instantiated like this, but i just can't do this, seems like the
InjectSelectionModel worker class does not allow, i ever get no value. Is
that any way of get the PropertyAccess with any other way without having to
declare it explicitly on the page class?


2008/2/19, Davor Hrg [EMAIL PROTECTED]:

 nice :)

 ...
 you should add this also in the warning section:
 the list must never be empty so that element type can be discovered...
 or this will fail:

   this.idFieldAdapter =
 access.getAdapter(list.get(0).getClass()).getPropertyAdapter(idField);


 or you could do some nasty reflection to get generic info from the
 field...
 some code for that can be found here:
 https://issues.apache.org/jira/browse/TAPESTRY-2053
 ...
 or just skip resolving idFieldAdapter because you don't actualy need
 it when list is empty



 Davor Hrg


 On Feb 19, 2008 8:16 PM, Marcelo Lotif [EMAIL PROTECTED] wrote:
  Hi all,
  I posted on the wiki another example on how to make a select with
 objects,
  now i used an annotation to do this is a simpler way.
 
  http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects
 
  Cheers,
  Marcelo Lotif
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Atenciosamente,
Marcelo Lotif


Re: Another example of Select with Objects

2008-02-19 Thread Davor Hrg
public static void
contributeComponentClassTransformWorker(OrderedConfigurationComponentClassTransformWorker
configuration, PropertyAccess propertyAccess)
{
configuration.add(InjectSelectionModel, new
InjectSelectionModelWorker(propertyAccess), after:Inject*);
}


public InjectSelectionModelWorker(PropertyAccess propertyAccess)
_propertyAccess = propertyAccess;
}


transformation.injectField(accessActualName, _propertyAccess);



Davor Hrg
On Feb 20, 2008 1:30 AM, Marcelo Lotif [EMAIL PROTECTED] wrote:
 Yeah, i know about that

 What i tried to do was just an attempt of doing things better and less
 effortlessly. I did this way because i don't want to say the bean type
 explicitly, this will be another parameter for the annotation. Thank's for
 the JIRA, I'll fix it, this is really a creepy piece of code...

 Another thing that i want to fix are these lines on the worker:

 String accessActualName = transformation.addField(Modifier.PRIVATE,
   org.apache.tapestry.ioc.services.PropertyAccess,
 _access);
 transformation.injectField(accessActualName, new PropertyAccessImpl());

 I read about the PropertyAccess, and it should really be Injected, not
 directly instantiated like this, but i just can't do this, seems like the
 InjectSelectionModel worker class does not allow, i ever get no value. Is
 that any way of get the PropertyAccess with any other way without having to
 declare it explicitly on the page class?


 2008/2/19, Davor Hrg [EMAIL PROTECTED]:

 
  nice :)
 
  ...
  you should add this also in the warning section:
  the list must never be empty so that element type can be discovered...
  or this will fail:
 
this.idFieldAdapter =
  access.getAdapter(list.get(0).getClass()).getPropertyAdapter(idField);
 
 
  or you could do some nasty reflection to get generic info from the
  field...
  some code for that can be found here:
  https://issues.apache.org/jira/browse/TAPESTRY-2053
  ...
  or just skip resolving idFieldAdapter because you don't actualy need
  it when list is empty
 
 
 
  Davor Hrg
 
 
  On Feb 19, 2008 8:16 PM, Marcelo Lotif [EMAIL PROTECTED] wrote:
   Hi all,
   I posted on the wiki another example on how to make a select with
  objects,
   now i used an annotation to do this is a simpler way.
  
   http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects
  
   Cheers,
   Marcelo Lotif
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Atenciosamente,
 Marcelo Lotif


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]