Hi Isomorphic,
how is the following use case best solved?
Whole application is about 1 object type that is displayed in different lists depending on status (using the same DataSource for all those ListGrids).
This moving from list to list is working fine with criteria on the ListGrid and cacheSync when an entry moves from a to b.
Now depending on the status there are different fields important in different lists. Also, some clients don't use all fields (then the ListGridField is not added to list as of now) and some want fields to be hidden on start (hidden:true, canHide:true).
I see that this would involve way less Java code if I used an auxiliary Velocity object in viewRequires and just added all fields. With this, I'd also not query and transfer unneeded and most likely empty fields and potentially save some joins. From testing I do know this works as expected.
But I have a problem w.r.t. to the "displayed in different lists depending on status". Here I can't say viewRequires->true for one ListGrid and viewRequires->false for another with Velocity, correct?
How would I solve this best using as little code as possible. It would be great if I could get rid of all my e.g.
that do these checks now.
Also, from how I understand it, viewRequires needs to evaluate always to true if I want to use that field in some list. Actually it needs to evaluate always to the same result for a user within his or her session.
Do you have any pointers?
I could think of different outputs per OperationBinding, that is used just for a specific ListGrid, which would also safe some joins, but still would mean the same ListGridField-adding code.
Here I also do have an enhancement suggestion: It would be good if outputs were also a VelocityExpression and not a string, because now I'd have to use ServerDataSourceImplementation / DynamicDSGenerator to modify the outputs, which is way more complicated.
Thank you & Best regards
Blama
PS: For anyone else reading this: .ds.xml and it's attributes, in combination with Velocity and perhaps ServerDataSourceImplementation are a REALLY strong tool. If I had understood this from the beginning, I'm sure that I might have done many things way more efficient. With it, you get role base security for free with zero code (even on a field level!) as well as client and server side validation.
how is the following use case best solved?
Whole application is about 1 object type that is displayed in different lists depending on status (using the same DataSource for all those ListGrids).
This moving from list to list is working fine with criteria on the ListGrid and cacheSync when an entry moves from a to b.
Now depending on the status there are different fields important in different lists. Also, some clients don't use all fields (then the ListGridField is not added to list as of now) and some want fields to be hidden on start (hidden:true, canHide:true).
I see that this would involve way less Java code if I used an auxiliary Velocity object in viewRequires and just added all fields. With this, I'd also not query and transfer unneeded and most likely empty fields and potentially save some joins. From testing I do know this works as expected.
But I have a problem w.r.t. to the "displayed in different lists depending on status". Here I can't say viewRequires->true for one ListGrid and viewRequires->false for another with Velocity, correct?
How would I solve this best using as little code as possible. It would be great if I could get rid of all my e.g.
Code:
addFieldIfVisible("CAMPAIGN_ID", campaignLGF, fields);
Also, from how I understand it, viewRequires needs to evaluate always to true if I want to use that field in some list. Actually it needs to evaluate always to the same result for a user within his or her session.
Do you have any pointers?
I could think of different outputs per OperationBinding, that is used just for a specific ListGrid, which would also safe some joins, but still would mean the same ListGridField-adding code.
Here I also do have an enhancement suggestion: It would be good if outputs were also a VelocityExpression and not a string, because now I'd have to use ServerDataSourceImplementation / DynamicDSGenerator to modify the outputs, which is way more complicated.
Thank you & Best regards
Blama
PS: For anyone else reading this: .ds.xml and it's attributes, in combination with Velocity and perhaps ServerDataSourceImplementation are a REALLY strong tool. If I had understood this from the beginning, I'm sure that I might have done many things way more efficient. With it, you get role base security for free with zero code (even on a field level!) as well as client and server side validation.
Comment