1. Integration with Seam Query Component
Integration with Seam Query Component
In the case of Seam, the server-side of a paged collection will be provided by a Query component. In particular filtering is supported by the use of Seam Query restrictions.
You first have to define your Seam Query component:
<component name="examplePerson" class="test.granite.ejb3.entity.Person"/> <framework:entity-query name="people" ejbql="select p from Person p" max-results="36"> <framework:restrictions> <value>lower(p.lastName) like lower( #{examplePerson.lastName} || '%' )</value> </framework:restrictions> </framework:entity-query>
This is a very standard Seam Query definition, only the max-results property is important as it will be used as the page size for the client component.
| Note that defining max-results is mandatory when using server page size and it is necessary that the max-results page size is greater than the expected maximum size of the UI component that will be bound to the collection. |
When using client side page size definition, you can omit max-results.
To change filter parameters on the client-side, you just have to set values on the restriction object (here examplePerson). Tide tracks the changes on the object on the Flex side and will update the server filter instance accordingly.
