<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Setting a custom required indicator skin on a FormItem container in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 19:26:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jens</title>
		<link>http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/comment-page-1/#comment-2693</link>
		<dc:creator>Jens</dc:creator>
		<pubDate>Tue, 24 Feb 2009 09:46:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/#comment-2693</guid>
		<description>Ok this took me couple of hours to figure out, so i want to share this with you.

I needed a required indicator placed directly after the label like John McPeek.

So I decided to extend FormItem, here´s the code:

package custom
{
	import mx.containers.FormItem;
	import mx.controls.Label;
	import mx.controls.Text;
	import mx.events.FlexEvent;

	public class FormItemReqLabel extends FormItem
	{

		private static var REQ_INDICATOR : String = &quot;*&quot;;
		private static var REQ_COLOR : String = &quot;#ffec19&quot;;

		// recognized values: left, right
		private static var REQ_ALIGN : String = &quot;right&quot;;

		public function FormItemReqLabel()
		{
			super();

			addEventListener(FlexEvent.CREATION_COMPLETE, init);
		}

		private function init(e : FlexEvent) : void {

			if ( REQ_ALIGN == &quot;left&quot; ) {
				Label (itemLabel).htmlText = &#039;&#039; +REQ_INDICATOR +&#039;&#039;+ label;
			} else {
				Label (itemLabel).htmlText = label + &#039;&#039; +REQ_INDICATOR +&#039;&#039;;
			}

		}

	}
}


You can use it just like FormItem. I gugled alot to find a solution for this, but i couldnt find anything. It would be nicer to use the original required option, but i couldnt figure out how. Any improvements are welcome.</description>
		<content:encoded><![CDATA[<p>Ok this took me couple of hours to figure out, so i want to share this with you.</p>
<p>I needed a required indicator placed directly after the label like John McPeek.</p>
<p>So I decided to extend FormItem, here´s the code:</p>
<p>package custom<br />
{<br />
	import mx.containers.FormItem;<br />
	import mx.controls.Label;<br />
	import mx.controls.Text;<br />
	import mx.events.FlexEvent;</p>
<p>	public class FormItemReqLabel extends FormItem<br />
	{</p>
<p>		private static var REQ_INDICATOR : String = &#8220;*&#8221;;<br />
		private static var REQ_COLOR : String = &#8220;#ffec19&#8243;;</p>
<p>		// recognized values: left, right<br />
		private static var REQ_ALIGN : String = &#8220;right&#8221;;</p>
<p>		public function FormItemReqLabel()<br />
		{<br />
			super();</p>
<p>			addEventListener(FlexEvent.CREATION_COMPLETE, init);<br />
		}</p>
<p>		private function init(e : FlexEvent) : void {</p>
<p>			if ( REQ_ALIGN == &#8220;left&#8221; ) {<br />
				Label (itemLabel).htmlText = &#8221; +REQ_INDICATOR +&#8221;+ label;<br />
			} else {<br />
				Label (itemLabel).htmlText = label + &#8221; +REQ_INDICATOR +&#8221;;<br />
			}</p>
<p>		}</p>
<p>	}<br />
}</p>
<p>You can use it just like FormItem. I gugled alot to find a solution for this, but i couldnt find anything. It would be nicer to use the original required option, but i couldnt figure out how. Any improvements are welcome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/comment-page-1/#comment-2691</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Tue, 11 Mar 2008 21:00:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/#comment-2691</guid>
		<description>René,

I tried a quick test but wasn&#039;t able to get the indicator skin to change at runtime.
I&#039;ve filed a bug at http://bugs.adobe.com/jira/browse/SDK-14925. Feel free to sign up for the bug base if you haven&#039;t already and subscribe to the bug.

Thanks,
Peter</description>
		<content:encoded><![CDATA[<p>René,</p>
<p>I tried a quick test but wasn&#8217;t able to get the indicator skin to change at runtime.<br />
I&#8217;ve filed a bug at <a href="http://bugs.adobe.com/jira/browse/SDK-14925" rel="nofollow">http://bugs.adobe.com/jira/browse/SDK-14925</a>. Feel free to sign up for the bug base if you haven&#8217;t already and subscribe to the bug.</p>
<p>Thanks,<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: René</title>
		<link>http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/comment-page-1/#comment-2692</link>
		<dc:creator>René</dc:creator>
		<pubDate>Tue, 11 Mar 2008 08:08:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/#comment-2692</guid>
		<description>Can you change the indicator skin at runtime as well ?
Or put more practically: How can I make the FormItem display different icons depending on the content of associated Text-Fields ? For instance to show the default red one when the field is empty but switch to green when filled ?</description>
		<content:encoded><![CDATA[<p>Can you change the indicator skin at runtime as well ?<br />
Or put more practically: How can I make the FormItem display different icons depending on the content of associated Text-Fields ? For instance to show the default red one when the field is empty but switch to green when filled ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McPeek</title>
		<link>http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/comment-page-1/#comment-2690</link>
		<dc:creator>John McPeek</dc:creator>
		<pubDate>Fri, 07 Mar 2008 18:59:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/03/setting-a-custom-required-indicator-skin-on-a-formitem-container-in-flex/#comment-2690</guid>
		<description>Can you put the indicator on the left side of the label like &#039;*blah&#039;?</description>
		<content:encoded><![CDATA[<p>Can you put the indicator on the left side of the label like &#8216;*blah&#8217;?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

