3 Replies Latest reply on Dec 6, 2010 11:59 PM by Shongrunden

    MobileIconItemRenderer: label vs. labelField

    Marvin Blase Level 1

      Hey,

      I'm just wondering what the exact difference between the label and the labelField property is. Well, the thing is, I'm curious about this behaviour concerning the passed in String:

       

      <s:MobileIconItemRenderer label="{data.name}"/>
      

      > works

       

      <s:MobileIconItemRenderer labelField="{data.name}"/>

      > does not work. therefor using this syntax for messageField won't work either.

       

      Now I wouldn't mind as long as the data-object isn't nested and there'd be a message property. But there isn't - you need to use messageField which cannot accept a nested syntax (please correct me if I'm wrong). So how can I achieve the following (of course this won't work but you'll get it)?

       

      <s:MobileIconItemRenderer label="{data.name}" messageField="{data.entry.text}"/>
        • 1. Re: MobileIconItemRenderer: label vs. labelField
          Marvin Blase Level 1

          Basically this works but isn't pretty smart to me:

           

          <s:MobileIconItemRenderer height="150" label="{data.name}" messageFunction="msgParse">
               <fx:Script>
                    <![CDATA[
                         private function msgParse(item:Object):String {
                              return item.status.text;
                         }
                    ]]>
               </fx:Script>
          </s:MobileIconItemRenderer>
          

           

          edit: highlight.

          • 2. Re: MobileIconItemRenderer: label vs. labelField
            iGuzi.com

            Hi, Label & LabelField is different, Label ={data.Name}", LabelField ="Name", Name is a table colloun, like Select NO,Name, Sex from Emploree.

            1 person found this helpful
            • 3. Re: MobileIconItemRenderer: label vs. labelField
              Shongrunden Adobe Employee

              labelField is the name of theproperty on the data item, for example:

              <s:List>
                  <s:dataProvider>
                      <s:ArrayList>
                          <fx:Object firstName="Steve" lastName="Smith" />
                          <fx:Object firstName="Brenda" lastName="Page" />
                          <fx:Object firstName="Nate" lastName="Hudson" />
                      </s:ArrayList>
                  </s:dataProvider>
                  <s:itemRenderer>
                      <fx:Component>
                          <s:MobileIconItemRenderer labelField="firstName" />
                      </fx:Component>
                  </s:itemRenderer>
              </s:List>

               

              This is better than using label="{data.firstName}" as it avoids unneccessary data binding.

               

              The way you are using messageFunction seems correct.

              1 person found this helpful