Hmm you're probably right, I'll just look it over again, and I think it is because I'm loading the values from database that it is a bit confusing...
/Martin -----Original Message----- From: Ben Gidley [mailto:[EMAIL PROTECTED] Sent: 5. juli 2004 16:05 To: Turbine Users List Subject: Re: Penguin extension... Martin, I am slightly confused - I think what should happen is 1 - In your screen class you fill any values up you want. You set option objects onto field. You don't save field.values. So you have a field object with a array of option objects. The field object.values[] will give you what ever the user selected last time The option[] will give you the possible options The option.caption will give you the caption for a possible value and option.value will give you an id for a possible value. Ben Martin Wendel wrote: >Well i did look at that, but the thing is that i'm using the Value as holder >of an ID number. > >In the MyScreen.java I load in values used in the MyScreen.vm from a >database... And as I need the ID numbers of those values when I later >associate the selections with my profile, I can't leave them unset. > >Unless im wrong and that when it return the values it only sends along those >who have been selected? > >/martin > >-----Original Message----- >From: Ben Gidley [mailto:[EMAIL PROTECTED] >Sent: 4. juli 2004 11:43 >To: Turbine Users List >Subject: Re: Penguin extension... > >Martin, > You can figure out which one(s) are selected by used the getValues >function on the field object. A helper function could be useful - (there >already is one for Checkboxes/radio buttons). I have added one to CVS >for penguin - I will put out a new version in a few days - once I have >checked for side effects. > >The code is >private static final String SELECTED = "selected=\"selected\""; > >/** > * Returns the HTML attribute for selected within an option group > * @param value > * @return > */ > public String isSelected(String value) { > // We can always uses the array as values is always filled by >validation > for (int i = 0; i < values.length; i++) { > if (values[i].equals(value)) { return SELECTED; } > } > return ""; > } > >Ben > >Martin Wendel wrote: > > > >>Hey guys, i think the penguin tool is nice, however it is missing the value >>of "selected" for options in select lists... >> >>I thought about just adding a Selected to the Option class, but I'm not >> >> >sure > > >>about what else to do. Any help here? >> >>/Martin >> >> >>--------------------------------------------------------------------- >>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] > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > >Scanned for viruses by MessageLabs > > Scanned for viruses by MessageLabs. The integrity and security of this message cannot be guaranteed. This email is intended for the named recipient only, and may contain confidential information and proprietary material. Any unauthorised use or disclosure is prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
