Re: T5, newbie: Grid use w dynamic columns

2008-03-16 Thread Alec Leamas

One of these days... it works to add a property to a BeanModel. If I
-  RTFM i. e., the javadocs.
- Provide a PropertyConduit to add().  (I missed that)

Sorry for wasting bandwidth

--alec.


Michael Kolmodin wrote:

Thanks for taking time for silly me :-)

Should have said that, but I tried to add a property to a BeanModel. 
However, this seems to fail if the class which was fed to the model's 
constructor doesn't have the property getter. As I understand it, I 
can enable/disable existing properties on a bean, but not create new 
ones?!


-
BeanModel model  =  beanModelSource.create( LdapRow.getClass(), false, 
componentResources);

model.add( "orvar");   -> Exception:

Error: Render queue error in SetupRender[ReportPage:grid]: Failure 
reading parameter 'model' of component ReportPage:grid: Class 
net.kln.yalt.pages.ReportPage$LdapRow does not contain a property 
named 'orvar' (within property expression 'orvar'). Available 
properties: class.



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



Re: T5, newbie: Grid use w dynamic columns

2008-03-16 Thread Michael Kolmodin

Thanks for taking time for silly me :-)

Should have said that, but I tried to add a property to a BeanModel. 
However, this seems to fail if the class which was fed to the model's 
constructor doesn't have the property getter. As I understand it, I can 
enable/disable existing properties on a bean, but not create new ones?!


-
BeanModel model  =  beanModelSource.create( LdapRow.getClass(), false, 
componentResources);

model.add( "orvar");   -> Exception:

Error: Render queue error in SetupRender[ReportPage:grid]: Failure 
reading parameter 'model' of component ReportPage:grid: Class 
net.kln.yalt.pages.ReportPage$LdapRow does not contain a property named 
'orvar' (within property expression 'orvar'). Available properties: class.






Davor Hrg wrote:

Grid uses BeanModel, no need to mess with javassist

you can create default one by
injecting BeanModelSource and create it with it
after that you can play with the model.

or you can provide a list of columns to the grid to include/exclude



--
--
Michael KolmodinFredsgatan 2
Phone:  +46 920 269413  S-972 35 Lulea
Mobile  +46 70 551 6507 Sweden

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



Re: T5, newbie: Grid use w dynamic columns

2008-03-16 Thread Davor Hrg
Grid uses BeanModel, no need to mess with javassist

you can create default one by
injecting BeanModelSource and create it with it
after that you can play with the model.

or you can provide a list of columns to the grid to include/exclude

Davor Hrg

On Sun, Mar 16, 2008 at 4:47 PM, Alec Leamas <[EMAIL PROTECTED]> wrote:
> Trying the hard parts first, I'm trying to create a table where the
>  columns are not known until runtime. The application is basically a
>  viewer, and the underlying database schema varies from time to time.
>
>  My question: is it somehow possible to define what columns to use in the
>  Grid component in runtime?  The T4 variant accepts a list, so it's no
>  problem. The T5 variant uses a bean to define the columns, and this is
>  trickier.
>
>  I've tried to use javassist to modify a a bean dynamically, but the Grid
>  complains that it cannot find the source for the getter method I added
>  to the bean.  This might just be the wrong way to do it, something wrong
>  with my first attemps to use javassist, or some problem with the idea to
>  use these kind of modified beans as source for the Grid.
>
>  Thanks for any help...
>
>  --Alec
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



T5, newbie: Grid use w dynamic columns

2008-03-16 Thread Alec Leamas
Trying the hard parts first, I'm trying to create a table where the 
columns are not known until runtime. The application is basically a 
viewer, and the underlying database schema varies from time to time.


My question: is it somehow possible to define what columns to use in the 
Grid component in runtime?  The T4 variant accepts a list, so it's no 
problem. The T5 variant uses a bean to define the columns, and this is 
trickier.


I've tried to use javassist to modify a a bean dynamically, but the Grid 
complains that it cannot find the source for the getter method I added 
to the bean.  This might just be the wrong way to do it, something wrong 
with my first attemps to use javassist, or some problem with the idea to 
use these kind of modified beans as source for the Grid.


Thanks for any help...

--Alec

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