8 Replies Latest reply on Dec 4, 2009 8:58 AM by Gregory Lafrance

    How do I get rid of this error?

    Jerry62712 Level 1

      In this code:

              private function processSearchRecord():void
              {
                  var psrSODC:String = dgSearchResults.selectedItem.colSODC as String;
                  var psrLastName:String = dgSearchResults.selectedItem.colLastName as String;
                  var psrFirstName:String = dgSearchResults.selectedItem.colFirstName as String;
                  var psrMHDDID:String = dgSearchResults.selectedItem.colMHDDID as String;
                  var psrRIN:String = dgSearchResults.selectedItem.colRIN as String;
                  var psrSSN:String = dgSearchResults.selectedItem.colSSN as String;

                  if (psrSODC != null && psrSODC.length > 0)

       

                  {
      ====>       XMLRecord.RecProcess = dmSearch.RecProcess(SODC == psrSODC);
                  }

       

      at the indicated line I get this error:

      1176: Comparison between a value with static type mx.controls:TextInput and a possibly
      unrelated type String.

       

      The XMLRecord is defined as:

              [Bindable] private var XMLRecord:XML;

       

      and the XML tag (is this the same as the above?):

      <mx:XML id="dmSearch">
          <data>
              <SearchResults>
                  <result>
      xxx

                 </result>
              </SearchResults>

       

              <SearchCriteria>
      xxx

             </SearchCriteria>

       

              <RecProcess>
                  <ADDRESS />
                  <AGE />
                  <AGENCYCONTACTNUMBER />

       

      I originally didn't have the "XMLRecord.RecProces" and just had "XMLRecord" which also gave this error:

      1176: Comparison between a value with static type mx.controls:TextInput and a possibly
      unrelated type String.

       

      TIA,

      Jerry

        • 1. Re: How do I get rid of this error?
          Gregory Lafrance Level 6

          I suspect SODC is a TextInput, thus you need SODC.text

          .

           

          If this post answers your question or helps, please mark it as such.


          Greg Lafrance
          www.ChikaraDev.com

          Flex Development and Support Services

          • 2. Re: How do I get rid of this error?
            Jerry62712 Level 1

            That's why I like talking to you.  You get things moving.  Yes, some of the fields are text (perhaps all - some are arrays).

             

            When I changed it to:

                            XMLRecord = dmResults(SODC.text == psrSODC);

             

            I get a new error:

            1180: Call to a possibly undefined method dmResults.

             

            "dmResults" is an id for an XML tag.  The goal is to filter the grid to one record.  I don't know how the magic of the grid and the XML item are connected.

            • 3. Re: How do I get rid of this error?
              Jerry62712 Level 1

              I changed to this:

                      [Bindable] private var XMLRecord:XML(dmResults);

               

              with the hope that XMLRecord would now look like the XML id="dmResults.  It gives me this error:

              Multiple markers at this line: -1086: Syntax error: expecting semicolon before colon. -1 changed
              line

               

              dmResults looks like this:

              <mx:XML id="dmResults">
                  <data>
                      <ADDRESS />
                      <AGE />
                      <AGENCYCONTACTNUMBER />
                      <AGENCYNAME />
              xxx

               

              Changing it to the above removed the error on this line:

                          if (psrSODC != null && psrSODC.length > 0)
                          {
                              XMLRecord = dmResults(SODC.text == psrSODC);
                          }
              (modified per your suggestion to include the ".text")

              • 4. Re: How do I get rid of this error?
                Gregory Lafrance Level 6

                Thanks for the nice words. I'm doing Flex consulting full-time now, so please tell your friends.

                 

                dmSearch.RecProcess(SODC.text == psrSODC);

                If this post answers your question or helps, please mark it as such.


                Greg Lafrance
                www.ChikaraDev.com

                Flex Development and Support Services

                • 5. Re: How do I get rid of this error?
                  Jerry62712 Level 1

                  Good for you.  I use to do consulting in Paradox, but now that I'm older I just want a stable job (and medical)!

                   

                  That did clear up the error on that line.  But I still have the error on the other line.

                  [Bindable] private var XMLRecord:XML(dmResults);

                   

                  where I'm trying to associate XMLRecord with the XML tag with the id of dmResults.  It complains:

                  Multiple markers at this line: -1086: Syntax error: expecting semicolon before colon. -1 changed
                  line

                   

                  Where are you located?  I'm in Springfield, Illinois as a state worker.

                  • 6. Re: How do I get rid of this error?
                    danny_run

                    the variable definition format is:

                    [Bindable]

                    private var your_var:VarType=VarType(value_you_want_to_cast_to_VarType);

                    In your case:

                    [Bindable]

                    private var XMLRecord:XML=XML(dmResults);

                    • 7. Re: How do I get rid of this error?
                      Jerry62712 Level 1

                      Again you pointed me in the right direction.  Here is what I ended up with:

                              [Bindable] private var XMLRecord:XML= dmResults;

                       

                      I get an error back here now:

                                      XMLRecord = dmResults(LASTNAME.text == psrLastName);

                       

                      What this is suppose to do is filter the datagrid (how that gets to the dmResults isn't clear to me) so one record gets to the XMLRecord.

                      • 8. Re: How do I get rid of this error?
                        Gregory Lafrance Level 6

                        What's the error, and try this:

                         

                        XMLRecord = dmResults.(LASTNAME.text == psrLastName);

                         

                        or this:

                         

                        XMLRecord = dmResults.@(LASTNAME.text == psrLastName);

                         

                        I'm located in Cupertino, CA. One thing I offer is Flex support $80/hour, billable in 15 minute increments. So if you have a question and don't want to go through the forum and I answer it quickly, 15 minutes minimum charge. For more involved questions, bug fixing, and development, charged for time spent.

                         

                        It is a model that works well for some people I'm working with. It allows them to tae on projects they otherwise would need to pass on.