[Help] writabilitygate on table

9 posts / 0 new
Last post
Marc
Offline
Joined: 07/08/2009
[Help] writabilitygate on table

Hello,

 

I try to apply writabilitygates on a table (collection) but without success. I tried to put the writabilitygate once on the model and once the table-view, both without succes. In both cases, the behaviour I get contains an error:

 

I can create and edit rows in the table, but when I log out and again in as the same user, without having changed the table or surrounding entity, I ca no longer edit.

 

My question first is how to put writability constraints on tables. Perhaps there is another way that what I am doing.

 

For reasons of completeness I already attach the model and view where I encountered the strange behavior: The model contains the entity "Deal" that contains the table "attachment_table". The scenario to reproduce the problem is as follows: Log in as SalesExecutive, create a deal, enter a name, open the deal and make a row attachment, choose “submit” as value for the status field and save. Now you can still edit the row. Log out and log in again: now you can no longer edit the row.

 

 

Perhaps this question is related to bug-issue 3041251 where I ask explanation on writabilitygates on components.

 

Thanks,

Marc

AttachmentSize
model.xml12.46 KB
view.xml10.4 KB
frontend.xml13.04 KB
maxime
Offline
Joined: 06/23/2008
Hello Marc I do not really

Hello Marc

I do not really understand how gates are supposed to work when they are declared on entities... for my own i'm using gates on entity's fields... and it works well. I also used on view action and it works two (i'm using SJS not xml beans)

Regards

Maxime

 

Marc
Offline
Joined: 07/08/2009
Maxime, Thanks for your

Maxime,

Thanks for your experience report. I also used writability gates sucessfull on fields and on views containing a component. But now I would like to apply it on tables as well. It is not urgent (I am leaving on holiday for 2 weeks soon anyway).

regards,

Marc

maxime
Offline
Joined: 06/23/2008
If you set gates on fields it

If you set gates on fields it applies on forms and on table also... if your using master-detail view, you have to setup "collectionBased" attribut to specify if the gate is a about master or about child items...

Marc
Offline
Joined: 07/08/2009
Maxime, I reason with you

Maxime, I reason with you about the possibilities here:

1) possibility one: declare the writabilitygate within the fields within the table-row-entity ("s_entityattachment)". Then I am confronted with the following difficulty (as far as I can see now): my writabilitygate relies on a property ("s_state") of the surrounding (master) entity ("Deal"). This "s_state" property is unknown in the table-row-entity "s_entityattachment". Probably this can be worked around by adding a backward reference (from "s_entityattachment" to "Deal") and a customised gate trigger. But it seems to become complex then.

2) possibility two: my table ("attachment_table") resides immediately in the surrounding entity ("Deal"). I do not see a reason to specify master-detal (this is the same as putting cascadingmodels to true, isn't it?) because cascading entities only seem appropriate in case of 3 entities A->B->C while I only have 2 here("Deal" -> "s_entityattachment"). So I do not see immediately how I could use the master-detail facility.

Marc

maxime
Offline
Joined: 06/23/2008
Hi I suggest this solution

Hi

I suggest this solution :

a) adding the reverse reference (from s_entityattachment to deal)

b) adding a computed boolean field on s_entityattachment (return getDeal().getState()==....)

c) setup a gate that use this computed field on each concerned field of s_entityattachment (i.e in model.xml)

This solution should work on form and table also.

Have a nice holiday

Regards

Maxime

vvandens
Offline
Joined: 05/29/2008
[Help] writabilitygate on table

Hi Marc,

bug #3041251 is fixed. Does it help ?

 

Vincent

Marc
Offline
Joined: 07/08/2009
Vincent, the bug #3041251 is

Vincent, the bug #3041251 is fixed indeed: nice!

But it does not solve this issue.

Perhaps the best way to proceed this issue is just to look at the erroneous behaviour as described in the first lines of this issue: the writability gate only takes effect after logging out and in again (as the same user).

Kind regards,

Marc

vvandens
Offline
Joined: 05/29/2008
[Help] writabilitygate on table

Hi Marc,

You are right, a notification was missing. It should be fine on tomorrow's snapshot.

Thanks for the report and the test-case !

 

Vincent