This content has been marked as final.
Show 2 replies
-
1. Re: Programatic example for Query Objects
jimk1723 Dec 12, 2006 8:27 PM (in response to jboss-nth-fan)This may not be what you're looking for, but here's a sample where I'm using an EntityQuery to populate an auto-complete list of names (forgive any syntax errors, I cribbed this from my working code, but changed the names.).
@In(required = false) Person examplePerson; @Out(required = false) EntityQuery people; @Factory("people") public void refreshPeople() { List<String> restrictions = new ArrayList<String>(); restrictions.add("lower(name) like lower( #{examplePerson.name} || '%' )"); people = new EntityQuery(); people.setEjbql("from Person"); people.setOrder("name"); people.setMaxResults(10); people.setRestrictions(restrictions); }
<h:inputText value="#{examplePerson.name}"> <a4j:support event="onkeyup" reRender="autocompletePeople" action="#{personHome.refreshPeople}" requestDelay="100" /> </h:inputText> <a4j:outputPanel id="autocompletePeople"> <ul> <ui:repeat value="#{people.resultList}" var="p"> <li> <h:outputText value="#{p.name}" /> </li> </ui:repeat> </ul> </a4j:outputPanel>
-
2. Re: Programatic example for Query Objects
jboss-nth-fan Dec 13, 2006 9:36 PM (in response to jboss-nth-fan)That's perfect!, it does help me. Thanks
I was just trying to get my head around the concept but I think I got it.
BTW, it's extremely exciting to see 1.1.GA !
Congrats Seam guys!