Re: Bean Edit Form w/ Select Menu
Hi George, Maybe needs a ValueEncoder is needed to transform from an object to a text representation for your select. http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyobject That's just a guess by the way. Cheers Chris On 17/04/2012, at 12:22 AM, George Christman wrote: > Hello, I'm trying to use a beaneditform for the first time, but I'm currently > facing a problem getting a select menu to appear and work. I'm using Tap3.2 > along with hibernate > > Source code > > .tml > > submitlabel="Create Evaluator"> > > > value="evaluator.applicationUser" model="applicationUserModel"/> > > > > > .class > > public class Evaluator_Test { > >@Property >private Evaluator evaluator; > >@Property >private SelectModel applicationUserModel; > >@Inject >private SelectModelFactory selectModelFactory; > >@Component(id = "evaluatorForm") >private BeanEditForm evaluatorForm; > >@Inject >private Session session; > >void onPrepare() throws Exception { >evaluator = new Evaluator(); >this.applicationUserModel = > selectModelFactory.create(session.createCriteria(ApplicationUser.class).list(), > "name"); >} > > Entity > > @Entity > public class Evaluator extends AbstractBaseEntity { > >@Id >@GeneratedValue >@NonVisual >private Long evaluatorId; > >@ManyToOne(fetch = FetchType.EAGER, optional = false) >@JoinColumns(@JoinColumn(name = "application_user_id")) >private ApplicationUser applicationUser; > > getters/setters > > Could someone tell me what I'm doing wrong? > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Bean-Edit-Form-w-Select-Menu-tp5643951p5643951.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Bean Edit Form w/ Select Menu
On Mon, 16 Apr 2012 12:07:17 -0300, ICE Ernesto Arteaga Zavala wrote: Hehehe hi, Hi! I need the same explanation! I found that if, the entity has a user Object tapestry could not make the coercion object... so in the beaneditor or beaneditform I need to add it. Tapestry (actually, BeanModelSource) doesn't add a form field for it automatically because there's no Tapestry type (which is just a String) assigned for it. Why? Tapestry doesn't know which options to present for any object which isn't an enum. You can add edition and viewing blocks by following the instructions in the BeanEditForm page in the documentation. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Bean Edit Form w/ Select Menu
Hehehe hi, I need the same explanation! I found that if, the entity has a user Object tapestry could not make the coercion object... so in the beaneditor or beaneditform I need to add it. Some more clarification, please! 2012/4/16 George Christman > I answered my own question, looks like I just needed to add the parameter > "add". I didn't think I'd need to add the parameter since applicationUser > existed in my entity bean. Can some one explain the reasoning behind this> > Thanks. > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Bean-Edit-Form-w-Select-Menu-tp5643951p5644066.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Saludos, --- "Nada que se consiga sin pena y sin trabajo es verdaderamente valioso." Joseph Addison --- ICE Ernesto Arteaga Zavala Ingeniero de Desarrollo
Re: Bean Edit Form w/ Select Menu
I answered my own question, looks like I just needed to add the parameter "add". I didn't think I'd need to add the parameter since applicationUser existed in my entity bean. Can some one explain the reasoning behind this> Thanks. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Bean-Edit-Form-w-Select-Menu-tp5643951p5644066.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Bean Edit Form w/ Select Menu
Hello, I'm trying to use a beaneditform for the first time, but I'm currently facing a problem getting a select menu to appear and work. I'm using Tap3.2 along with hibernate Source code .tml .class public class Evaluator_Test { @Property private Evaluator evaluator; @Property private SelectModel applicationUserModel; @Inject private SelectModelFactory selectModelFactory; @Component(id = "evaluatorForm") private BeanEditForm evaluatorForm; @Inject private Session session; void onPrepare() throws Exception { evaluator = new Evaluator(); this.applicationUserModel = selectModelFactory.create(session.createCriteria(ApplicationUser.class).list(), "name"); } Entity @Entity public class Evaluator extends AbstractBaseEntity { @Id @GeneratedValue @NonVisual private Long evaluatorId; @ManyToOne(fetch = FetchType.EAGER, optional = false) @JoinColumns(@JoinColumn(name = "application_user_id")) private ApplicationUser applicationUser; getters/setters Could someone tell me what I'm doing wrong? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Bean-Edit-Form-w-Select-Menu-tp5643951p5643951.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org