[jboss-user] [JBoss Seam] - selectitems-1.1.1beta2 problem

grdzeli_kaci do-not-reply at jboss.com
Thu Jul 19 11:02:42 EDT 2007


hi Peter Muir,
i tried to use your selectitems-1.1.1beta2, but i got an error like this :

  | avax.faces.el.PropertyNotFoundException: javax.el.PropertyNotFoundException: /home.xhtml @23,117 label="#{application.remark}": Property 'remark' not found on type org.apache.catalina.core.ApplicationContextFacade
  |         at javax.faces.component.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:104)
  |         at org.jboss.seam.ui.component.html.HtmlSelectItems.getLabel(HtmlSelectItems.java:108)
  |         at org.jboss.seam.ui.component.UISelectItems.asSelectItems(UISelectItems.java:154)
  |         at org.jboss.seam.ui.component.UISelectItems.getValue(UISelectItems.java:99)
  |         at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:323)
  |         at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:675)
  | 
  | /code]
  | 
  | but remark into my bean exist, here is my example :
  | 1.components.xml
  | 
  | 
  |   |     <framework:entity-home name="applicationHome"
  |   |                            entity-class="com.liliko.billing.businesslayer.beans.entity.jits.Application" />
  |   |     <factory name="application" value="#{applicationHome.instance}" />    
  |   |     <framework:entity-query name="applications" ejbql="select a from Application a"/>
  |   | 
  |   | 
  | 2.Application Bean:
  | 
  |   | 
  |   | @Entity
  |   | @Table(name = "APPLICATION",schema="JITS")
  |   | 
  |   | public class Application implements Serializable {
  |   | 
  |   |     @Id
  |   |     @Column(name = "ID", nullable = false)
  |   |     private BigDecimal id;
  |   | 
  |   |     @Column(name = "CODE")
  |   |     private BigInteger code;
  |   | 
  |   |     @Column(name = "REMARK")
  |   |     private String remark;
  |   | 
  |   |     @Column(name = "REC_STATUS")
  |   |     private BigInteger recStatus;
  |   | 
  |   |     @Column(name = "REG_DATE")
  |   |     @Temporal(TemporalType.DATE)
  |   |     private Date regDate;
  |   | 
  |   |     @Column(name = "UPD_DATE")
  |   |     @Temporal(TemporalType.DATE)
  |   |     private Date updDate;
  |   | 
  |   |     @JoinColumn(name = "DESCRIPTION_ID", referencedColumnName = "ID")
  |   |     @ManyToOne
  |   |     private Description descriptionId;
  |   | 
  |   |     @JoinColumn(name = "USER_ID", referencedColumnName = "ID")
  |   |     @ManyToOne
  |   |     private Users userId;
  |   | 
  |   |     @OneToMany(mappedBy = "applicationId")
  |   |     private Collection<ApplicationsConfig> applicationsConfigCollection;
  |   |     
  |   |     /** Creates a new instance of Application */
  |   |     public Application() {
  |   |     }
  |   | 
  |   |     public Application(BigDecimal id) {
  |   |         this.id = id;
  |   |     }
  |   |     public BigDecimal getId() {
  |   |         return this.id;
  |   |     }
  |   |     public void setId(BigDecimal id) {
  |   |         this.id = id;
  |   |     }
  |   |     public BigInteger getCode() {
  |   |         return this.code;
  |   |     }
  |   |     public void setCode(BigInteger code) {
  |   |         this.code = code;
  |   |     }
  |   |     public String getRemark() {
  |   |         return this.remark;
  |   |     }
  |   |     public void setRemark(String remark) {
  |   |         this.remark = remark;
  |   |     }
  |   | 
  |   |     public BigInteger getRecStatus() {
  |   |         return this.recStatus;
  |   |     }
  |   | 
  |   |     public void setRecStatus(BigInteger recStatus) {
  |   |         this.recStatus = recStatus;
  |   |     }
  |   |     public Date getRegDate() {
  |   |         return this.regDate;
  |   |     }
  |   |     public void setRegDate(Date regDate) {
  |   |         this.regDate = regDate;
  |   |     }
  |   |     public Date getUpdDate() {
  |   |         return this.updDate;
  |   |     }
  |   |     public void setUpdDate(Date updDate) {
  |   |         this.updDate = updDate;
  |   |     }
  |   |     public Description getDescriptionId() {
  |   |         return this.descriptionId;
  |   |     }
  |   |     public void setDescriptionId(Description descriptionId) {
  |   |         this.descriptionId = descriptionId;
  |   |     }
  |   |     public Users getUserId() {
  |   |         return this.userId;
  |   |     }
  |   |     public void setUserId(Users userId) {
  |   |         this.userId = userId;
  |   |     }
  |   |     public Collection<ApplicationsConfig> getApplicationsConfigCollection() {
  |   |         return this.applicationsConfigCollection;
  |   |     }
  |   |     public void setApplicationsConfigCollection(Collection<ApplicationsConfig> applicationsConfigCollection) {
  |   |         this.applicationsConfigCollection = applicationsConfigCollection;
  |   |     }
  |   |     @Override
  |   |     public int hashCode() {
  |   |         int hash = 0;
  |   |         hash += (this.id != null ? this.id.hashCode() : 0);
  |   |         return hash;
  |   |     }
  |   |     @Override
  |   |     public boolean equals(Object object) {
  |   |         // TODO: Warning - this method won't work in the case the id fields are not set
  |   |         if (!(object instanceof Application)) {
  |   |             return false;
  |   |         }
  |   |         Application other = (Application)object;
  |   |         if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
  |   |         return true;
  |   |     }
  |   |     @Override
  |   |     public String toString() {
  |   |         return "tmp.Application[id=" + id + "]";
  |   |     }
  |   |     
  |   | }
  |   | 
  | 3. and view.xhtml :
  | 
  |   | <h:selectOneMenu>
  |   |                 <s:selectItems value="#{applications.resultList}" var="application" label="#{application.remark}" />
  |   |                 <si:convertEntity entityClass="com.liliko.billing.businesslayer.beans.entity.jits.Application"/>
  |   |             </h:selectOneMenu>
  |   | 
  | 
  | did i something incorrect ????
  | 
  | ___________
  | Regards,
  | Paata.
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065856#4065856

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065856



More information about the jboss-user mailing list