@@ -1669,13 +1669,14 @@ def field(self, showid=0, size=None):
16691669 return '<input name="%s" value="%s" size="%s">' % (self ._formname ,
16701670 value , size )
16711671
1672- def menu (self , size = None , height = None , showid = 0 , additional = [],
1672+ def menu (self , size = None , height = None , showid = 0 , additional = [], value = None ,
16731673 sort_on = None , ** conditions ):
16741674 ''' Render a form select list for this property
16751675
16761676 "size" is used to limit the length of the list labels
16771677 "height" is used to set the <select> tag's "size" attribute
16781678 "showid" includes the item ids in the list labels
1679+ "value" specifies which item is pre-selected
16791680 "additional" lists properties which should be included in the
16801681 label
16811682 "sort_on" indicates the property to sort the list on as
@@ -1692,7 +1693,8 @@ def menu(self, size=None, height=None, showid=0, additional=[],
16921693 if not self .is_edit_ok ():
16931694 return self .plain ()
16941695
1695- value = self ._value
1696+ if value is None :
1697+ value = self ._value
16961698
16971699 linkcl = self ._db .getclass (self ._prop .classname )
16981700 l = ['<select name="%s">' % self ._formname ]
@@ -1857,14 +1859,15 @@ def field(self, size=30, showid=0):
18571859 return self .input (name = self ._formname ,size = size ,value = value )
18581860
18591861 def menu (self , size = None , height = None , showid = 0 , additional = [],
1860- sort_on = None , ** conditions ):
1862+ value = None , sort_on = None , ** conditions ):
18611863 ''' Render a form <select> list for this property.
18621864
18631865 "size" is used to limit the length of the list labels
18641866 "height" is used to set the <select> tag's "size" attribute
18651867 "showid" includes the item ids in the list labels
18661868 "additional" lists properties which should be included in the
18671869 label
1870+ "value" specifies which item is pre-selected
18681871 "sort_on" indicates the property to sort the list on as
18691872 (direction, property) where direction is '+' or '-'. A
18701873 single string with the direction prepended may be used.
@@ -1879,7 +1882,8 @@ def menu(self, size=None, height=None, showid=0, additional=[],
18791882 if not self .is_edit_ok ():
18801883 return self .plain ()
18811884
1882- value = self ._value
1885+ if value is None :
1886+ value = self ._value
18831887
18841888 linkcl = self ._db .getclass (self ._prop .classname )
18851889
0 commit comments