2 Replies Latest reply on Apr 10, 2008 12:10 PM by pope on acid

    Why does CFC returns the wrong value?

    pope on acid Level 1
      (autologin.cfm sets the session.kntbazarplaatser variable to 'yes')'

      CFC Function:
      <cffunction name="checkPermission" access="public" returntype="boolean">
      <cfif isDefined('session.ktnbazarplaatser') and session.ktnbazarplaatser eq 'yes'>
      <cfset permis = true>
      <cfelse>
      <cfset permis = false>
      </cfif>
      <cfreturn permis>
      </cffunction>


      COLDFUSION PAGE (returns the correct value):
      <cfif isDefined('session.isLoggedIn') and session.isLoggedIn eq 'yes'>
      <cfinvoke component="/components/ktnbazar" method="checkPermission" returnvariable="dees">
      <cfform>
      <cfoutput>
      return value = #dees#
      </cfoutput>
      </cfform>
      <cfelse>
      <cfset session.req = #CGI.PATH_INFO# >
      <cflocation url="autologin.cfm">
      </cfif>

      FLEX (returns always 'false'):
      <mx:RemoteObject id="productService" destination="ColdFusion" source="components.ktnbazar" showBusyCursor="true">
      <mx:method name="checkPermission" result="permissionHandling(event)" fault="Alert.show(event.fault.message)"/>
      </mx:RemoteObject>

      public function permissionHandling(permEvt:ResultEvent):Boolean
      {
      if(permEvt.result == true)
      {
      this.currentState='DetailsContact';
      }
      else if(permEvt.result == false)
      {
      this.currentState='DetailsNoContact';
      }
      return permEvt as Boolean;
      }