[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?
tony.herstell@gmail.com
do-not-reply at jboss.com
Tue Mar 6 15:04:19 EST 2007
I map it to the "model"...
@DataModel
private Organisation[] organisations;
(Easier to work with IceFaces with an Array!)
Thats all..
>From Page...
| <ice:dataTable id="organisationsTableComponent" value="#{organisations}" var="the_organisation" sortColumn="#{findOrganisationController.sortColumn}" sortAscending="#{findOrganisationController.ascending}" rows="10">
|
>From backing Bean....
| /**
| * @author Tony Herstell
| * @version $Revision: 1.5 $ $Date: 2007-02-13 04:46:40 $
| */
| @CacheConfig(idleTimeoutSeconds=1800)
| @Stateful
| @Name("findOrganisationController")
| @Scope(ScopeType.SESSION)
| public class FindOrganisationControllerImpl implements Serializable, FindOrganisationController {
|
| @PersistenceContext(type = EXTENDED)
| private EntityManager em;
|
| @DataModel
| private Organisation[] organisations;
|
| @Logger
| private Log log;
|
| @In(create=true)
| @Out
| private Organisation organisation;
|
| @In(value="organisationSearchCriteria", create=true)
| private Organisation organisationSearchCriteria;
|
| @In
| private Map<String, String> messages;
|
| /*
| * GUI Support
| */
| public static final String ALL_OPTION = "all";
| public static final String FILTERED_OPTION = "filtered";
| private String selectedSearchCriteriaPanel = ALL_OPTION;
|
| private String sortColumn;
| private boolean ascending = false;
|
| private boolean physicalDontCare = true; // Used for filtering only.
| private static final String PHYSICAL_VALUE_REQUIRED = "physical_required";
| private static final String PHYSICAL_VALUE_NOT_REQUIRED = "physical_not_required";
| private String physicalValueRequiredPanel = PHYSICAL_VALUE_REQUIRED;
|
| /*
| * Searh String
| */
| private static final String ALL_QUERY = "select o from Organisation o";
|
| private Query query;
|
| /*
| * Methods
| */
| @Factory("organisations") // Is run whenever this bean is created (we know its going to be the "All" query.
| public void initOrganisations() {
| log.info("> initOrganisations");
| applyAllQuery();
| log.info("< initOrganisations");
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025557#4025557
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025557
More information about the jboss-user
mailing list