<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Forum posts to 'General Questions'</title>
		<link>http://www.silverstripe.org/general-questions/rss</link>
		<atom:link href="http://www.silverstripe.org/general-questions/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: Default selected value - OptionsetField</title>
			<link>http://www.silverstripe.org/general-questions/show/251972?start=0#post254406</link>
			<description>&lt;p&gt;I don't really know what the code for the $source is doing, but the documentation is here - &lt;a href=&quot;http://doc.silverstripe.com/doku.php?id=optionsetfield&quot;&gt;http://doc.silverstripe.com/doku.php?id=optionsetfield&lt;/a&gt; - and note that $value refers to the index used in the $source array, not the number of the element in that array. Sorry, language is failing me here, but if your $source is&lt;/p&gt;&lt;p&gt;2 =&amp;gt; &quot;Apple&quot;&lt;br /&gt;54 =&amp;gt; &quot;Orange&quot;&lt;br /&gt;512 =&amp;gt; &quot;Banana&quot;&lt;/p&gt;&lt;p&gt;then $value=&quot;2&quot; will mean the default will be &quot;Apple&quot;.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Default selected value - OptionsetField &lt;a href=&quot;http://www.silverstripe.org/general-questions/show/251972?start=0#post254406&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/general-questions/reply/251972?start=0#post254406&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 19 Feb 2009 16:06:16 +1300</pubDate>
			<dc:creator>tobych</dc:creator>
			<guid>http://www.silverstripe.org/general-questions/show/251972?start=0#post254406</guid>
		</item>
		
		<item>
			<title>Default selected value - OptionsetField</title>
			<link>http://www.silverstripe.org/general-questions/show/251972#post251972</link>
			<description>&lt;p&gt;Hi, I'm having some issues changing the default selected value when I make an OptionsetField in Page.php for use inside SilverStripe.&lt;/p&gt;&lt;p&gt;Here is my code:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;new OptionsetField(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  $name = 'Options',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  $title = 'Options',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  $source = singleton('Page')-&amp;gt;dbObject('Options')-&amp;gt;enumValues(),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  $value = &quot;2&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   )&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;However, no matter what I set &quot;$value&quot; to, whenever I create a new page in the CMS, the first option is always selected. Does anyone know why this is the case?&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Default selected value - OptionsetField &lt;a href=&quot;http://www.silverstripe.org/general-questions/show/251972#post251972&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/general-questions/show/251972#post251972&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sat, 10 Jan 2009 08:53:12 +1300</pubDate>
			<dc:creator>quamsta</dc:creator>
			<guid>http://www.silverstripe.org/general-questions/show/251972#post251972</guid>
		</item>
		

	</channel>
</rss>