I have the entity A (id, age, B b) and B (id, name, description, amount, date etc).
In B I have @View(name="simple", members="id, name") and @Tab(name="simple", properties="id, name")
In A I can use @ReferenceView("simple") over B to use the simple view in detail mode .
But, when I click the magnifying glass icon to search for B, I'm presented with the main (unnamed) @Tab of B, if it exists, or all the columns for B if there is no @Tab defined.
Is there a way to reference an specific @Tab (like the "simple" above) for a reference? Similar to what we do with @ReferenceView? Something like @ReferenceTab("simple").
Don't know if it makes sense, but it would be useful not only to simplify the search Tab but to benefit from the filtering capabilities of @Tab like baseCondition, defaultOrder, filter.
I guess I can change the @SearchAction with some variation of this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you.
For now I just created a simplified version of the Entity mapping to the same table and defined a simplified @Tab with baseCondition for filtering.
Additionally, I had to use @AssertTrue with the same baseCondition of the @Tab to avoid the user to type a key and reference an instance that would not be selectable by clicking the magnifying glass.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since OpenXava 7.4 we have a new annotation, @SearchListTab to indicate the @Tab to use in the search dialog for references and collections. OpenXava 7.4 will be releases next month, in Septembre 2024.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the entity
A (id, age, B b)
andB (id, name, description, amount, date etc)
.In B I have
@View(name="simple", members="id, name")
and@Tab(name="simple", properties="id, name")
In A I can use
@ReferenceView("simple")
over B to use the simple view in detail mode .But, when I click the magnifying glass icon to search for B, I'm presented with the main (unnamed) @Tab of B, if it exists, or all the columns for B if there is no @Tab defined.
Is there a way to reference an specific @Tab (like the "simple" above) for a reference? Similar to what we do with @ReferenceView? Something like
@ReferenceTab("simple")
.Don't know if it makes sense, but it would be useful not only to simplify the search Tab but to benefit from the filtering capabilities of @Tab like baseCondition, defaultOrder, filter.
I guess I can change the @SearchAction with some variation of this.
Hi Gustavo:
That is not supported yet. Look at:
https://openxava.org/xavaprojects/o/OpenXava/m/Issue?detail=a0c98a1c57a24fbcb867d0d7bf42df11
In the meantime you can define the tab by code using @SearchAction. Look at:
https://openxava.org/OpenXavaDoc/docs/references-collections_en.html#refining-action-for-searching-reference-with-list
Help others in this forum as I help you.
Thank you.
For now I just created a simplified version of the Entity mapping to the same table and defined a simplified @Tab with baseCondition for filtering.
Additionally, I had to use @AssertTrue with the same baseCondition of the @Tab to avoid the user to type a key and reference an instance that would not be selectable by clicking the magnifying glass.
Hi Gustavo,
Since OpenXava 7.4 we have a new annotation, @SearchListTab to indicate the @Tab to use in the search dialog for references and collections. OpenXava 7.4 will be releases next month, in Septembre 2024.
Great. When it is out I'm going to change my code to see how it works.