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 it is important that the max-results page size is greater than the expected maximum size of the UI component that will be bound to the collection. |
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 this object on the Flex side and will update the server filter instance accordingly.
