4 Replies Latest reply on Apr 9, 2008 9:21 AM by kdennis4

    Having trouble with cfreturn to a <mx:Text> field

    kdennis4
      I have done a return to populate a DataGrid, but I need to populate a text field. My code is as follows in my CFC where I first check a previous query for the recordcount:

      <cfif checkThisLogin.recordcount eq 1>

      <cfquery name="userInfo" datasource="ds">
      Select firstName, department, email, role
      From userTable
      Where loginID = '#arguments.thisLogin#'
      </cfquery>

      <cfreturn userInfo.firstName>
      </cfif>

      Now my code within the mxml template:

      private function checkUser(userLogin:String,userPassword:String):void {
      if (userLogin == ""){
      Alert.show("You must enter a Login.");
      }else if (userPassword == ""){
      Alert.show("You must enter a Password.");
      }else{
      creativeLogin.verifyLogin(userLogin,userPassword);
      }
      }

      private function resultHandlerCheckUser(event:ResultEvent):void{
      creativeViewStack.selectedChild = newProjects;
      }

      <mx:method name="verifyLogin" result="resultHandlerCheckUser(event)">
      <mx:arguments>
      <firstName></firstName>
      <department></department>
      <email></email>
      <role></role>
      </mx:arguments>
      </mx:method>

      <mx:Text x="1017.15" y="10" text="{creativeLogin.firstName}" fontWeight="bold" fontSize="14"/>

      I have tried multiple ways to get the "firstName" to display, but no luck... Any suggestions would be appreciated!