When I specify @Editor(value="MyCustomList") module shows collection list tab for @OneToMany(mappedBy="master" data, not for private Collection details.
I tried to name @View, @Tab, @View & @Tab in Details entity module and specify forViews and value syntax for @Editor but no correct result. Even if I specify @Editor("List") witch is pure standard List editor, I get data from master, not detail. If I don't specify @Editor it works fine and shows detail data specified in @ListProperties
Last edit: Dusan Djuric 2021-02-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That's the problem, listEditor.jsp is for list mode, not for collection. You should use collectionEditor.jsp, that yes, it calls to listEditor.jsp but before configures some things. Have a look at collectionEditor,jsp.
Help others in this forum as I help you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My goal is to have simple Tab display, no customization, no filtering, no column sorting. Just column names and data.
Can you give me a tip? I tried with copy of collectionEditor.jsp but have no clue where is the point where I can swap listEditor.jsp include with my own? Am I doing it right? Is there some other list editor (jsp) called by collectionEditor.jsp where I can disable custom, filter, column order icons and logic?
Last edit: Dusan Djuric 2021-02-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is CSS technique I used at the end to have simple no customization, no filtering, no column sorting collection list presentation.
/* removing customization and filters for specific module-subview-collection */
#ox_<myApplicationName>_<ModulName>__customize_<subViewCollectionName>,
#ox_<myApplicationName>_<ModulName>__list_filter_<subViewCollectionName>,
#ox_<myApplicationName>_<ModulName>__show_filter_<subViewCollectionName>
{
display: none;
}
/* removing href for specific module-subview-collections tab */
#ox_<myApplicationName>_<ModulName>__<subViewCollectionName> .ox-list-headerdivspana[href]
{
cursor: not-allowed;pointer-events: none;text-decoration: none;
}
/* removing sort icons for specific module-subview-collections tab */
#ox_<myApplicationName>_<ModulName>__<subViewCollectionName> .ox-list-headerdivspana[href] i
{
display: none;
}
This will probably work fine until OX team decide to change something in jsp(s). Therefore, it would be much appreciated to give some methods, properties and annotations of @ListProperties, @Tabs and columns, something like
or even more flexible
Tab.Property.setCustomizeAllowed(boolean)
Tab.Property.setFilteringAllowed(boolean)
Tab.Property.setSortableAllowed(boolean)
so we can have some fields customizable, filterable, sortable and others don't.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Pending feature is from 2016. If I may suggest so: @Simple shuld be @Options an should have few or more properties (customization=true/false, filter=true/fale, order=true/fale, resize=true/false ... ), I earlier mentioned adequate properties and methods.
By now you can create a calculated collection from your persistent collection, something that simplified the UI a lot, thus:
I tried calculated collection, which is by my opinion both quite scriptical and not very clear, and implicates that the citation in @View does not seem to be based on the Collection object name but on the name of the getter function. Pretty confusing I think. However, it does not suit me for several reasons:
@ListSubcontroller disapiers
Thows primitiv type error
SEVERE: Null value was assigned to a property [class com.istratech.attendancerecord.model.TimeRecords.paidFlag] of primitive type setter of com.istratech.attendancerecord.model.TimeRecords.paidFlag
org.hibernate.PropertyAccessException: Null value was assigned to a property [class com.istratech.attendancerecord.model.TimeRecords.paidFlag] of primitive type setter of com.istratech.attendancerecord.model.TimeRecords.paidFlag
Caused by: java.lang.IllegalArgumentException: Can not set int field com.istratech.attendancerecord.model.TimeRecords.paidFlag to null value
(I removed setters but get same exception anyway)
Thows
org.openxava.controller.ModuleManager manageRegularException
SEVERE: View.getCollectionTab() not allowed for @ManyToMany, @OrderColumn or calculated collections
java.lang.IllegalStateException: View.getCollectionTab() not allowed for @ManyToMany, @OrderColumn or calculated collections
List header and all rows gets remove option, and rows get update options
although seting are @ReadOnly @NoCreate @NoModify @RemoveAction("") @ RemoveSelectedAction("") @ViewAction("") @NewAction("") @AddAction("") @SaveAction("")
Last edit: Dusan Djuric 2021-02-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From 2016 to 2020 we have added 447 new features to OpenXava and fixed 435 bugs. You can verify it here: https://openxava.org/changelog/
I don't in favor of increasing the amount of features added in each version, because new features are inmature, they fail, no matter you test all possible cases with all possible browser, in production they fail. I remember when we added @ElementCollection support or creation our own editor (to replace the HTML select) for the @DescriptionsList, in the first version they failed. And recently with the new upload editor. That is, a new version with a huge quantity of new feature would create a fragile product. That is, the current amount of new features by year is good for keeping a good quality level. I'm even thinking in increasing the amount of bug fixes and decreasing the amount of new features.
On the other hand, the amount of nice-to-have ideas is huge, and in each version we have to leave out some of them, because more important features are implemented.
That is, probably we'll implement @Simple some day, but you cannot expect that all the pending features will be implemented for the next version, even more, you can expect all the request feature would be implemented at all. Personally, I would like to have a @Simple annotation for collection, and also it would be useful to have a more granulated alternative as you suggest.
in @View does not seem to be based on the Collection object name but on the name of the getter function
This is because you have mapped an int property to a column that have nulls in database. You should not to do that. Given that the calculated collection shows all records, without paging it fails, I suspect.
List header and all rows gets remove option
Yes, calculated collection still allows customization. You can remove customization, though that is a topic for a new thread.
rows get update option
Did you try @EditAction("")
Help others in this forum as I help you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From 2016 to 2020 we have added 447 new features to OpenXava and fixed 435 bugs. You can verify it here:
I appreciate your framework and your development efforts very much, otherwise I would not have asked my company to buy XavaPro. I just mention that I must get some solution to problem and have not much time left with my project to deliver, so CSS it is for now.
Furthermore, I consider your development progress, and support consistency and response the one of the most agile among even "famous" companies. So don't get me wrong, and please keep in mind that my English is not my native so sometimes I sound different from what I had in mind.
When I wrote "List header and all rows gets remove option" I meant to option to delete selected rows of data, not customization column removal option. I didn't try @EditAction("") because I put @ReadOnly @NoCreate @NoModify and I thought that that is enough. Thx for pointing me out on that, and thank you for all other useful informations you provided.
With regards.
Last edit: Dusan Djuric 2021-02-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Don't worry. I like the people that complains, because it improves OpenXava. In that case, for example, I just give more priority for this @Simple option for collection, plannig for 6.6. Surely it will not in 6.6, but perhaps in 6.7.
I meant to option to delete selected rows of data
Try @ReadOnly. Also you can use @ViewAction(""), if you dont want the row action for view a read only dialog with the detail. If it fails put here the source code for your collection definition and a screenshot of the result, so I understand better.
Help others in this forum as I help you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Capture1.jpg shows "normal" Collection
Capture2.jpg shows same but calculated Collection
It is the same collection but calculated version losses column and collection title translations, and shows (I don't know way) all columns, although only few are specified in @ListProperties
In calculated version you can see (in read circles) Update and Delete icons, but in annotations is clearly specified @ReadOnly @NoModify @RemoveAction("") @RemoveSelectedAction("") @EditAction("") . Even Add and New are there although @NewAction("") @AddAction("") are specified. So calculated collection trick gives more headache than CSS.
Only column sorting icons disappears, with is desirable in my particular case, but does not provide the flexibility like by CSS to keep sorting as an option.
@ReadOnlypublic Collection<Carrier> getFellowCarriersCalculated() { return getFellowCarriers(); // We call to the persistent counterpart}
To get the attached result.
That is @ReadOnly works nicely for calculated collections. Remeber that you have to annotated the getter of the colletion and that a calculated collection only has the getter, it has not field and setter. If you don't find the problem, attach here the class code of the entity that contains the calculated collection configured to use it in the view. I'll have a look.
I probably copied the wrong code, in the one I intended to put is
public Collection <timerecordsevtgrpsum> getSimpleTimeRecordsEvtGrpSum () {return getTimeRecordsEvtGrpSum ();}</timerecordsevtgrpsum>
but with setter procedure also.
I'll try this variant for sure and get back to you with results.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I get exactly the same result like before (have a look at the picture). In addition, export PDF and Excel actions disappear. Also, @ListProperties is not consulted at all, but all the fields from the original collection class are displayed. It's clear to me why the labels weren't translated, but I don't understand why all the columns are displayed instead of just those in @ListProperties.
I probably didn’t understand you well and I’m doing something fundamentally wrong.
The attached code is long, but it is about "private Collection <timerecords> timeRecords", or "getTimeRecordsCalculated" and "timeRecordsCalculated" as stated in @View.</timerecords>
In your code the property timeRecordsCalculated has no annotations at all. You should annotate the collection timeRecordsCalculated with @ReadOnly and @ListProperties. In this way:
Calculated collections have no field. In the moment you use a field that is a persistent collection, your even use @OneToMany, calculated collections have no persistence annotations.
Finally, we have added the annotation @SimpleList to OpenXava, to have a collection displayed without filtering, sorting, customization, paging, actions, etc. The code is already in the master and will be included in OpenXava 7.4, available in September 2024.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm banging my head to screen for some time now having hard time to implement custom List editor for my Collection @ListProperties:
module
xava/editors.xml
myCustomList.jsp is exact copy of ListEditor.jsp
When I specify @Editor(value="MyCustomList") module shows collection list tab for @OneToMany(mappedBy="master" data, not for private Collection details.
I tried to name @View, @Tab, @View & @Tab in Details entity module and specify forViews and value syntax for @Editor but no correct result. Even if I specify @Editor("List") witch is pure standard List editor, I get data from master, not detail. If I don't specify @Editor it works fine and shows detail data specified in @ListProperties
Last edit: Dusan Djuric 2021-02-10
Hi Dusan:
That's the problem, listEditor.jsp is for list mode, not for collection. You should use collectionEditor.jsp, that yes, it calls to listEditor.jsp but before configures some things. Have a look at collectionEditor,jsp.
Help others in this forum as I help you.
Great!
My goal is to have simple Tab display, no customization, no filtering, no column sorting. Just column names and data.
Can you give me a tip? I tried with copy of collectionEditor.jsp but have no clue where is the point where I can swap listEditor.jsp include with my own? Am I doing it right? Is there some other list editor (jsp) called by collectionEditor.jsp where I can disable custom, filter, column order icons and logic?
Last edit: Dusan Djuric 2021-02-12
This is CSS technique I used at the end to have simple no customization, no filtering, no column sorting collection list presentation.
This will probably work fine until OX team decide to change something in jsp(s). Therefore, it would be much appreciated to give some methods, properties and annotations of @ListProperties, @Tabs and columns, something like
Tab.setCustomizeAllowed(boolean)
Tab.setFilteringAllowed(boolean)
Tab.setSortableAllowed(boolean)
or even more flexible
Tab.Property.setCustomizeAllowed(boolean)
Tab.Property.setFilteringAllowed(boolean)
Tab.Property.setSortableAllowed(boolean)
so we can have some fields customizable, filterable, sortable and others don't.
Hi Dusan:
Look at this pending feature:
https://openxava.org/XavaProjects/o/OpenXava/m/Issue?detail=536371b7f1ab4eef936dc7de140e8b67
By now you can create a calculated collection from your persistent collection, something that simplified the UI a lot, thus:
Then you can put simpleDetails in your @View definition instead of details.
Help others in this forum as I help you.
Pending feature is from 2016. If I may suggest so: @Simple shuld be @Options an should have few or more properties (customization=true/false, filter=true/fale, order=true/fale, resize=true/false ... ), I earlier mentioned adequate properties and methods.
I tried calculated collection, which is by my opinion both quite scriptical and not very clear, and implicates that the citation in @View does not seem to be based on the Collection object name but on the name of the getter function. Pretty confusing I think. However, it does not suit me for several reasons:
@ListSubcontroller disapiers
Thows primitiv type error
SEVERE: Null value was assigned to a property [class com.istratech.attendancerecord.model.TimeRecords.paidFlag] of primitive type setter of com.istratech.attendancerecord.model.TimeRecords.paidFlag
org.hibernate.PropertyAccessException: Null value was assigned to a property [class com.istratech.attendancerecord.model.TimeRecords.paidFlag] of primitive type setter of com.istratech.attendancerecord.model.TimeRecords.paidFlag
Caused by: java.lang.IllegalArgumentException: Can not set int field com.istratech.attendancerecord.model.TimeRecords.paidFlag to null value
(I removed setters but get same exception anyway)
Thows
org.openxava.controller.ModuleManager manageRegularException
SEVERE: View.getCollectionTab() not allowed for @ManyToMany, @OrderColumn or calculated collections
java.lang.IllegalStateException: View.getCollectionTab() not allowed for @ManyToMany, @OrderColumn or calculated collections
List header and all rows gets remove option, and rows get update options
although seting are @ReadOnly @NoCreate @NoModify @RemoveAction("") @ RemoveSelectedAction("") @ViewAction("") @NewAction("") @AddAction("") @SaveAction("")
Last edit: Dusan Djuric 2021-02-15
Hi Dusan:
From 2016 to 2020 we have added 447 new features to OpenXava and fixed 435 bugs. You can verify it here:
https://openxava.org/changelog/
I don't in favor of increasing the amount of features added in each version, because new features are inmature, they fail, no matter you test all possible cases with all possible browser, in production they fail. I remember when we added @ElementCollection support or creation our own editor (to replace the HTML select) for the @DescriptionsList, in the first version they failed. And recently with the new upload editor. That is, a new version with a huge quantity of new feature would create a fragile product. That is, the current amount of new features by year is good for keeping a good quality level. I'm even thinking in increasing the amount of bug fixes and decreasing the amount of new features.
On the other hand, the amount of nice-to-have ideas is huge, and in each version we have to leave out some of them, because more important features are implemented.
That is, probably we'll implement @Simple some day, but you cannot expect that all the pending features will be implemented for the next version, even more, you can expect all the request feature would be implemented at all. Personally, I would like to have a @Simple annotation for collection, and also it would be useful to have a more granulated alternative as you suggest.
The @View annotation is always based in the getter function, for all members, never in the attribute. OpenXava follow the JavaBean convention for property definition. Read my explanation about calculated properties:
https://openxava.org/OpenXavaDoc/docs/basic-business-logic_en.html#Lesson%205:%20Basic%20business%20logic-Calculated%20properties
It could be a bug.
This is because you have mapped an int property to a column that have nulls in database. You should not to do that. Given that the calculated collection shows all records, without paging it fails, I suspect.
Yes, calculated collection still allows customization. You can remove customization, though that is a topic for a new thread.
Did you try @EditAction("")
Help others in this forum as I help you.
Hi Javier
I appreciate your framework and your development efforts very much, otherwise I would not have asked my company to buy XavaPro. I just mention that I must get some solution to problem and have not much time left with my project to deliver, so CSS it is for now.
Furthermore, I consider your development progress, and support consistency and response the one of the most agile among even "famous" companies. So don't get me wrong, and please keep in mind that my English is not my native so sometimes I sound different from what I had in mind.
When I wrote "List header and all rows gets remove option" I meant to option to delete selected rows of data, not customization column removal option. I didn't try @EditAction("") because I put @ReadOnly @NoCreate @NoModify and I thought that that is enough. Thx for pointing me out on that, and thank you for all other useful informations you provided.
With regards.
Last edit: Dusan Djuric 2021-02-19
Hi Dusan,
Don't worry. I like the people that complains, because it improves OpenXava. In that case, for example, I just give more priority for this @Simple option for collection, plannig for 6.6. Surely it will not in 6.6, but perhaps in 6.7.
Try @ReadOnly. Also you can use @ViewAction(""), if you dont want the row action for view a read only dialog with the detail. If it fails put here the source code for your collection definition and a screenshot of the result, so I understand better.
Help others in this forum as I help you.
Hi Javier
This is my example.
Capture1.jpg shows "normal" Collection
Capture2.jpg shows same but calculated Collection
It is the same collection but calculated version losses column and collection title translations, and shows (I don't know way) all columns, although only few are specified in @ListProperties
In calculated version you can see (in read circles) Update and Delete icons, but in annotations is clearly specified @ReadOnly @NoModify @RemoveAction("") @RemoveSelectedAction("") @EditAction("") . Even Add and New are there although @NewAction("") @AddAction("") are specified. So calculated collection trick gives more headache than CSS.
Only column sorting icons disappears, with is desirable in my particular case, but does not provide the flexibility like by CSS to keep sorting as an option.
Last edit: Dusan Djuric 2021-02-19
Hi Dusan,
I just tried this code:
To get the attached result.
That is @ReadOnly works nicely for calculated collections. Remeber that you have to annotated the getter of the colletion and that a calculated collection only has the getter, it has not field and setter. If you don't find the problem, attach here the class code of the entity that contains the calculated collection configured to use it in the view. I'll have a look.
Help others in this forum as I help you.
Hi Javier,
I probably copied the wrong code, in the one I intended to put is
public Collection <timerecordsevtgrpsum> getSimpleTimeRecordsEvtGrpSum () {return getTimeRecordsEvtGrpSum ();}</timerecordsevtgrpsum>
but with setter procedure also.
I'll try this variant for sure and get back to you with results.
Hi Javier
I get exactly the same result like before (have a look at the picture). In addition, export PDF and Excel actions disappear. Also, @ListProperties is not consulted at all, but all the fields from the original collection class are displayed. It's clear to me why the labels weren't translated, but I don't understand why all the columns are displayed instead of just those in @ListProperties.
I probably didn’t understand you well and I’m doing something fundamentally wrong.
The attached code is long, but it is about "private Collection <timerecords> timeRecords", or "getTimeRecordsCalculated" and "timeRecordsCalculated" as stated in @View.</timerecords>
I'm sorry to waste your precious time.
Regards
Hi Dusan,
In your code the property timeRecordsCalculated has no annotations at all. You should annotate the collection timeRecordsCalculated with @ReadOnly and @ListProperties. In this way:
Remember that a calculated property or a calculate collection is just a getter, without setter and without field. You have to annotate that getter.
Help others in this forum as I help you.
Hi Javire
I get it now. Thx!
Sorry, but I'm completely confused and still can get trough.
this is my code
timeRecordsCalculated is defined in @View and this is what I get:
Adding @ViewAction("") solves View (eye icon) but customization, filtering, sorting is still there.
I give up and go back to CSS solution, sorry.
Last edit: Dusan Djuric 2021-02-25
Hi Dusan:
Calculated collections have no field. In the moment you use a field that is a persistent collection, your even use @OneToMany, calculated collections have no persistence annotations.
Write it in this way:
Note, without @OneToMany and without attribute.
Read this explanation about collections where there is an example of a calculated collection:
https://openxava.org/OpenXavaDoc/docs/model_en.html#Model-Collections
Read also this explanation about calculated properties in general:
https://openxava.org/OpenXavaDoc/docs/basic-business-logic_en.html#Lesson%205:%20Basic%20business%20logic-Calculated%20properties
Help others in this forum as I help you.
Hi Dusan,
Finally, we have added the annotation @SimpleList to OpenXava, to have a collection displayed without filtering, sorting, customization, paging, actions, etc. The code is already in the master and will be included in OpenXava 7.4, available in September 2024.