Module ActionView::Helpers::MxmlHelper
In: lib/mxml_helper.rb

Provides functionality for working with MXML in your views.

If you wish to use this library and its helpers (ActionView::Helpers::MxmlHelper), you must:

  • Use flex_scaffold :model in your controller.

Methods

Public Instance methods

Returns the application mxml tag

Example:

   <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute"
        width="100%"
        height="100%"
        creationComplete="{list<%= singular_name %>.send();}"
        xmlns:egenial="*"
        backgroundColor="#808080"
        backgroundGradientColors="[#808080, #ffffff]">

[Source]

    # File lib/mxml_helper.rb, line 88
88:       def mx_application(name, *args, &block)
89:       
90:       end

Returns the ActionScript that link to the model to the server as a REST resource

Example:

        <mx:Script>
                <![CDATA[

                private function clearForm():void  {
              field_name.text = '';
           field_title.text = '';
           field_size.text = '';
           field_uri.text = '';
           field_desc.text = '';
            }

                public function deletegraphics(id:String):void {
                        deletegraphic.url = "/graphics/" + id + ".xml";
                        deletegraphic.send({_method: "DELETE"});
                }

         private function sendgraphicUpdate():void {

               var params:Object = new Object();
               params['_method'] = "PUT";
               params['graphic[name]'] = field_name.text;
               params['graphic[title]'] = field_title.text;
               params['graphic[size]'] = field_size.text;
               params['graphic[uri]'] = field_uri.text;
               params['graphic[desc]'] = field_desc.text;

                           updategraphic.url = "/graphics/" + graphic_grid.selectedItem.id + ".xml";
                   updategraphic.send(params);
         }

         ]]>
        </mx:Script>

[Source]

    # File lib/mxml_helper.rb, line 50
50:       def mx_resource(model, *args)
51:       
52:       end

Returns the mx HTTPSService defined for a REST service call to rails

Example:

    <mx:HTTPService id="listimage" url="/images.xml" useProxy="false" method="GET"/>
        <mx:HTTPService id="updateimage" useProxy="false" method="POST" result="listimage.send()"/>
        <mx:HTTPService id="deleteimage" useProxy="false" method="POST" result="listimage.send()"/>
        <mx:HTTPService id="createimage" url="/images.xml" useProxy="false" method="POST" result="listimage.send()"
           contentType="application/xml">
           <mx:request xmlns="">
               <image>
                  <title>{field_title.text}</title>
                  <filename>{field_filename.text}</filename>
                  <desc>{field_desc.text}</desc>
                  <size>{field_size.text}</size>
               </image>
           </mx:request>
        </mx:HTTPService>

[Source]

    # File lib/mxml_helper.rb, line 72
72:       def mx_service
73:       
74:       end

Returns the validators mxml tag

Example:

     <mx:StringValidator source="{field_create_title}" property="text"
       tooShortError="This string is shorter than the minimum allowed length of 4."
       tooLongError="This string is longer than the maximum allowed length of 255."
       minLength="4" maxLength="255"
       trigger="{btn_add_create}" triggerEvent="click" />

[Source]

     # File lib/mxml_helper.rb, line 101
101:       def mx_validators
102:       
103:       end

[Validate]