-
1. Re: Component Binding don't work in Seam?
g00se24 May 21, 2007 4:27 AM (in response to smithbstl)Hello.
It's works fine for me, but the documentation is a little bit strange in that.
You can inject a Component into your bean.
package de.psi.support.gui;
import java.util.List;
import javax.ejb.Remove;
import javax.faces.component.html.HtmlDataTable;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
public abstract class Selection {
@PersistenceContext
protected EntityManager em;
private Object selected;
@In("#{uiComponent['form:table']}")
protected HtmlDataTable table;
public String getSearch() {
return search;
}
public void setSearch(String search) {
this.search = search;
}
protected List getResult() {
List query = em.createQuery(getQuery()).getResultList();
return query;
}
public Object getSelected() {
return selected;
}
public void setSelected(Object selected) {
this.selected = selected;
}
public void select() {
setSelected(table.getRowData());
}
It's a snippet of some of my classes (it's used only for inheritance -> abstract, try not to wonder about that.).
@In("#{uiComponent['form:table']}")
protected HtmlDataTable table;
That's your solution, keep in mind that the 'form:table' is the path (id!) to the component. The ":" splits the id's and not "." like it is mentioned in the seam documentation.
Good luck! -
2. Re: Component Binding don't work in Seam?
smithbstl May 21, 2007 9:45 AM (in response to smithbstl)Thanks goose,
So I have to use injection, I can't use regular JSF style binding?<h:inputText binding="#{mySFSB.someUIInputComponent}"/>
Can you tell me where you found this in the Seam Documentation?
Using your method, do I still need to wire up the binding (like shown above) in the JSF page? It appears that I don't since you don't have any getters or setters.........or are you simply binding to #{table}? -
3. Re: Component Binding don't work in Seam?
smithbstl May 21, 2007 10:54 AM (in response to smithbstl)Also, what does #{uiComponent} reference?