Drop down menu defaults [SOLVED]

A place for users and developers of the Xataface to discuss and receive support.

Drop down menu defaults [SOLVED]

Postby cantlep » Tue May 25, 2010 4:05 am

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
Last edited by cantlep on Tue May 25, 2010 8:34 am, edited 1 time in total.
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Drop down menu defaults

Postby shannah » Tue May 25, 2010 8:30 am

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Drop down menu defaults [SOLVED]

Postby cantlep » Tue May 25, 2010 8:35 am

Awesome! You really have thought of everything.

Thanks very much as always

Paul
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 35 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved