Suppse your PropertySelection component looks something like <component id="teacherPS" type="PropertySelection"> <binding name="value" value="ognl:teacher" /> <binding name="model" value="ognl:teacherSelectionModel"/> </component> and you would like to set the drop down list to have an initial selected value of 'myTeacher', say. One way is use the translateValue method in TeacherSelectionModel to return 'myTeacher' and then set teacher to be this returned value. Another way is to overwrite the equal() method in the class for Teacher.
Shing --- Todd Orr <[EMAIL PROTECTED]> wrote: > 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] > > Home page : http://uk.geocities.com/matmsh/index.html Send instant messages to your online friends http://uk.messenger.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]