Page 1 of 1

Drop down menu defaults [SOLVED]

PostPosted: Tue May 25, 2010 4:05 am
by cantlep
Hiya,

I have some drop down menus where data is populated from a valuelist. Is there anyway to have the select menu display one of those values (instead of "Please Select") as the first option?

Thanks

Paul

Re: Drop down menu defaults

PostPosted: Tue May 25, 2010 8:30 am
by shannah
Use the fieldname__default() method in the delegate class to specify a default value for your field:

Code: Select all
function myfield__default(){
    return 'foo';
}


(Note that in the case where the field stores an int but you're using a valuelist to display a different label, then you should return an int from this method and not the string that is associated with it).

_Steve

Re: Drop down menu defaults [SOLVED]

PostPosted: Tue May 25, 2010 8:35 am
by cantlep
Awesome! You really have thought of everything.

Thanks very much as always

Paul