[jboss-user] [JBoss Seam] - Re: Simple selectOneMenu Example/seamgen

griffitm do-not-reply at jboss.com
Tue Oct 2 09:36:29 EDT 2007


Damian, 

Thanks for the reply. I thought I was on the right track from looking at this related link: http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamEntityConverter

Here is my deliverableHome class:

  | package gov.hhs.fda.ocio.fdaaa.entity;
  | 
  | import org.jboss.seam.annotations.In;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.framework.EntityHome;
  | 
  | @Name("deliverableHome")
  | public class DeliverableHome extends EntityHome<Deliverable> {
  | 
  | 	@In(create = true)
  | 	StatusHome statusHome;
  | 
  | 	public void setDeliverableId(Integer id) {
  | 		setId(id);
  | 	}
  | 
  | 	public Integer getDeliverableId() {
  | 		return (Integer) getId();
  | 	}
  | 
  | 	@Override
  | 	protected Deliverable createInstance() {
  | 		Deliverable deliverable = new Deliverable();
  | 		return deliverable;
  | 	}
  | 
  | 	public void wire() {
  | 		Status status = statusHome.getDefinedInstance();
  | 		if (status != null) {
  | 			getInstance().setStatus(status);
  | 		}
  | 	}
  | 
  | 	public boolean isWired() {
  | 		if (getInstance().getType() == null)
  | 			return false;
  | 		if (getInstance().getStatus() == null)
  | 			return false;
  | 		if (getInstance().getConsequence() == null)
  | 			return false;
  | 		return true;
  | 	}
  | 
  | 	public Deliverable getDefinedInstance() {
  | 		return isIdDefined() ? getInstance() : null;
  | 	}
  | 
  | }
  | 

As for the right package, I believe so. It was all generated by seamgen. Does the entity-query need to specify the entire package? I tend to think this is a problem with mapping to the deliverableHome.status property.  I have 2 records in the status table which looks like this:

  | ID       Description
  | 1         In-Progress
  | 2         On-Hold
  | 

I set the status_id to 2, and when I bring up the record to edit it, the status selected in the select box is 1, In-Progress.  In the struts world, this would tell me that the HTML fragment generated doesn't match the struts bean mapped to the action.

Any thoughts?

Thanks in advance!

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

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



More information about the jboss-user mailing list