5.4-ga-1 - problem when *add* a column to a *grid*, but it is working OK in 5.4-beta-26

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

5.4-ga-1 - problem when *add* a column to a *grid*, but it is working OK in 5.4-beta-26

Vangel V. Ajanovski-2
When adding a new column to a grid like this:

         <t:grid t:source="degrees" t:row="degree" t:add="delete">
             <p:deleteCell>
                     delete
             </p:deleteCell>
         </t:grid>

I am getting an
org.apache.tapestry5.ioc.internal.OperationException
Render queue error in CleanupRender[admin/DegreeList:grid]: Bean editor
model for mk.ukim.finki.isis.dossier.entities.Degree already contains a
property model for property 'delete'.

The error occurs on 5.4-rc-1, but not on 5.4-beta-26.
The same piece of code has been working without such a problem with
previous versions for the last 3 years at least.

Java:
openjdk version "1.8.0_66"
OpenJDK Runtime Environment (build 1.8.0_66-b17)
OpenJDK 64-Bit Server VM (build 25.66-b17, mixed mode)

Source where problem occurs:
https://develop.finki.ukim.mk/projects/isis/browser/trunk/src/main/resources/mk/ukim/finki/isis/dossier/pages/admin/DegreeList.tml
https://develop.finki.ukim.mk/projects/isis/browser/trunk/src/main/java/mk/ukim/finki/isis/dossier/pages/admin/DegreeList.java

Project pom.xml:
https://develop.finki.ukim.mk/projects/isis/browser/trunk/pom.xml


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: 5.4-ga-1 - problem when *add* a column to a *grid*, but it is working OK in 5.4-beta-26

Chris Poulsen
Hi,

I don't know if there is an issue with the GA, but you are relying on
introspection to find your bean properties; that is asking for trouble IMO.

Always use property whitelisting to achieve a stable set of properties for
your grids. Basically make sure to "include" the properties you want to
show. (If you are not using include, a number of things can go wrong like:
the Degree class may evolved, the hibernate stuff may have added extra
runtime properties that the introspector is picking up, the JDK version may
have changed which means that the introspector behavior may have changed,
new data type analyzers may have been added etc.)

--
Chris



On Mon, Dec 14, 2015 at 2:31 AM, Vangel V. Ajanovski <[hidden email]>
wrote:

> When adding a new column to a grid like this:
>
>         <t:grid t:source="degrees" t:row="degree" t:add="delete">
>             <p:deleteCell>
>                     delete
>             </p:deleteCell>
>         </t:grid>
>
> I am getting an
> org.apache.tapestry5.ioc.internal.OperationException
> Render queue error in CleanupRender[admin/DegreeList:grid]: Bean editor
> model for mk.ukim.finki.isis.dossier.entities.Degree already contains a
> property model for property 'delete'.
>
> The error occurs on 5.4-rc-1, but not on 5.4-beta-26.
> The same piece of code has been working without such a problem with
> previous versions for the last 3 years at least.
>
> Java:
> openjdk version "1.8.0_66"
> OpenJDK Runtime Environment (build 1.8.0_66-b17)
> OpenJDK 64-Bit Server VM (build 25.66-b17, mixed mode)
>
> Source where problem occurs:
>
> https://develop.finki.ukim.mk/projects/isis/browser/trunk/src/main/resources/mk/ukim/finki/isis/dossier/pages/admin/DegreeList.tml
>
> https://develop.finki.ukim.mk/projects/isis/browser/trunk/src/main/java/mk/ukim/finki/isis/dossier/pages/admin/DegreeList.java
>
> Project pom.xml:
> https://develop.finki.ukim.mk/projects/isis/browser/trunk/pom.xml
>
>
Reply | Threaded
Open this post in threaded view
|

Re: 5.4-rc-1 - problem when *add* a column to a *grid*, but it is working OK in 5.4-beta-26

Vangel V. Ajanovski-2
First of all, I have made a mistake in the subject - it was supposed to
be 5.4-rc-1

On 14.12.2015 09:18, Chris Poulsen wrote:
> show. (If you are not using include, a number of things can go wrong like:
> the Degree class may evolved, the hibernate stuff may have added extra
> runtime properties that the introspector is picking up, the JDK version may
> have changed which means that the introspector behavior may have changed,
> new data type analyzers may have been added etc.)
The added property is not a member of this class properties, so I see no
real reason why including the other properties should matter. But, I do
get why you are suggesting that.

On the other hand, I would prefer not to use the "include" since it
polutes the (H)THML with with internal (read: database) details. On the
other hand, "add" is just a view layer thing, since you add an
interaction element to the (H)TML.

But, this debate is fruitless, because it does not matter.
I tried using "include", the problem remains.

I guess the real reason for this happening is some incompatibility,
between some of the libraries, but I have spent many hours to find the
problem and tried many combinations  without luck. So any ideas towards
finding a solution would be great.


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: 5.4-rc-1 - problem when *add* a column to a *grid*, but it is working OK in 5.4-beta-26

Thiago H de Paula Figueiredo
On Mon, 14 Dec 2015 09:04:15 -0200, Vangel V. Ajanovski  
<[hidden email]> wrote:

> But, this debate is fruitless, because it does not matter.
> I tried using "include", the problem remains.

Have you tried to @Inject BeanModelSource and call  
beanModelSource.createDisplayModel(yourClass.class, messages) and see what  
are the properties (PropertyModel instances) it detects?

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 5.4-rc-1 - problem when *add* a column to a *grid*, but it is working OK in 5.4-beta-26

Chris Poulsen
In reply to this post by Vangel V. Ajanovski-2
I don't know what you mean by having tried many library combinations. But
Tapestry related libs should all be the same version and without duplicates
in your runtime.

The error you are getting happens because the BeanModel for your grid
already contains a property called "delete".

So if you actually tried using <t:grid include="degreeProperty1,
degreeProperty2" add="delete"> and got the error, something is really off...

You can try to attach a debugger to either Grid, BeanModelUtils or
BeanModelImpl to see what your generated model contains... or create / bind
a bean model explicitly and debug using that.

--
Chris

On Mon, Dec 14, 2015 at 12:04 PM, Vangel V. Ajanovski <[hidden email]>
wrote:

> First of all, I have made a mistake in the subject - it was supposed to be
> 5.4-rc-1
>
> On 14.12.2015 09:18, Chris Poulsen wrote:
>
>> show. (If you are not using include, a number of things can go wrong like:
>> the Degree class may evolved, the hibernate stuff may have added extra
>> runtime properties that the introspector is picking up, the JDK version
>> may
>> have changed which means that the introspector behavior may have changed,
>> new data type analyzers may have been added etc.)
>>
> The added property is not a member of this class properties, so I see no
> real reason why including the other properties should matter. But, I do get
> why you are suggesting that.
>
> On the other hand, I would prefer not to use the "include" since it
> polutes the (H)THML with with internal (read: database) details. On the
> other hand, "add" is just a view layer thing, since you add an interaction
> element to the (H)TML.
>
> But, this debate is fruitless, because it does not matter.
> I tried using "include", the problem remains.
>
> I guess the real reason for this happening is some incompatibility,
> between some of the libraries, but I have spent many hours to find the
> problem and tried many combinations  without luck. So any ideas towards
> finding a solution would be great.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: 5.4-rc-1 - problem when *add* a column to a *grid*, but it is working OK in 5.4-beta-26

Vangel V. Ajanovski-2
On 14.12.2015 12:50, Chris Poulsen wrote:
> The error you are getting happens because the BeanModel for your grid
> already contains a property called "delete".
If I replace
   add="delete"
with
   add="deleteHVUHDVIUDHVS"

I will get a message that the Model already contains "deleteHVUHDVIUDHVS"

> So if you actually tried using <t:grid include="degreeProperty1,
> degreeProperty2" add="delete"> and got the error, something is really off...
As I said, I did try that and still get the error.

> You can try to attach a debugger to either Grid, BeanModelUtils or
> BeanModelImpl to see what your generated model contains... or create / bind
> a bean model explicitly and debug using that.
Will try.


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: 5.4-rc-1 - problem when *add* a column to a *grid*, but it is working OK in 5.4-beta-26

Vangel V. Ajanovski-2
In reply to this post by Thiago H de Paula Figueiredo
On 14.12.2015 12:48, Thiago H de Paula Figueiredo wrote:
Have you tried to @Inject BeanModelSource and call beanModelSource.createDisplayModel(yourClass.class, messages) and see what are the properties (PropertyModel instances) it detects?


So in the tml I know have a random property name:

    <table t:type="grid" t:source="degrees" t:row="degree"
        t:add="deleteuh9uhco9qh98ehv">

Calling:
     model = bms.createDisplayModel(Degree.class, messages);
     System.out.println(model.getPropertyNames());
Printout:
     [degreeId, code, title, titleEn, terms, note]

As you see there is no property "deleteuh9uhco9qh98ehv" in the model.

But, the error occurs again:
Bean editor model for mk.ukim.finki.isis.dossier.entities.Degree already contains a property model for property 'deleteuh9uhco9qh98ehv'.

smime.p7s (5K) Download Attachment