Hi,

If I understand you question correctly, all you need to do is define the
value of the PropertySelection component to your Class's teacher's property.
Since you didn't show any code, here is an example I made up:

   <component id="teacherSelection" type="PropertySelection">
      <binding name="model" expression="teachersSelectionModel"/>
      <binding name="value" expression="class.teacher"/>
   </component>  
 
That's all you really have to do.

Hope this will help,
Ben
 
 

> -----Original Message-----
> From: Todd Orr [mailto:[EMAIL PROTECTED]
> Sent: Sunday, May 14, 2006 11:16 AM
> To: Tapestry users
> Subject: Default Selection of PropertySelectionModel
> 
> I know there is going to be a simple answer, but I've been pulling my
> hair out for a day now. I have an object Class that has a property
> Teacher. I have a page that allows you to edit the class details. On
> this page there is a drop down of teachers. The drop down is created
> using a custom TeachersSelectionModel that implements
> IPropertySelectionModel. My java class has abstract methods
> get/setTeacher for the PropertySelection component's value.
> 
> Almost everything works. When you change the teacher and submit the
> form, it is updated correctly in the database. The list is populated
> correctly, etc. The problem is that when you first go to edit the
> class, I cannot figure out how to get the teacher that is already tied
> to the class to be the selected teach in the drop down. I've tried
> implementing PageBeginRenderListener and attempting to setTeacher
> based on the current Class. This doesn't work. It is just ignored.
> I've tried implementing getTeacher so that it will get the teacher
> with the id of the current Class that is being edited. Again, this is
> just ignored. I've tried many different variations of code to no
> avail.
> 
> I've already trolled the archives and google and the tapestry docs. I
> must be missing something, but it looks like I'm the first person to
> ever attempt this. Does anybody have a solution to this?
> 
> Thanks
> T
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to