Skip navigation
Currently Being Moderated

Custom check in dialog

Sep 13, 2011 4:44 AM

Hi,

 

we are currently implementing a custom check-in dialog for Bridge.

The dialog contains a Combobox.

The available items in the combobox are loaded from a web-service, called from Bridge. How is it possible to provide the Flex UI with data from Bridge?

 

Thanks

 
Replies
  • Currently Being Moderated
    Sep 13, 2011 10:19 PM   in reply to JoeriADAM

    Hi,

     

    for the setContextInfo() function, you should write it like the below:

     

    public function setContextInfo(info:Object):void

    {

         if(info == null

              return

     

         var items:Array = new Array();

     

         if (info.hasOwnProperty("key1"))
              items["key1"] = info["key1"];
       
         if (info.hasOwnProperty("key2"))
              items["key2"] = info["key2"];

     

       

        workflowCombo.dataProvider = items;

    }

     

     

    The context info object sent from your Java connector will be wrapped into a generic Flex Object class instance, all the keys will become its properties, all the values will become property values. you cannot cast it directly into an Array instance.

     

    Thanks

     

    Gang

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2011 8:33 PM   in reply to JoeriADAM

    Hi,

     

    Sorry for late response.

     

    There are two reasons causing your problems.

     

    1) It's too early to bind Combobox in the SetContextInfo() function, SetContextInfo() function is called by AdobeDrive in the ModuleLoader.ready Module Event handler, during this time, the creation of Combobox is not finished, you should simply preserve the context info passed to you in SetContextInfo(), then bind Combobox with it in its creation complete event handler.

     

    2) The dataprovider of ComboBox should be an ICollectionView instance, Array class doesn't meet this requirement

     

    The sample code is as follows:

     

    protected function module1_creationCompleteHandler(event:FlexEvent):void
    {
        if (_contextInfo == null)
         return;   
          
        var items:ArrayCollection = new ArrayCollection();   
       
        items.addItem("value1");   
        items.addItem("value2");
       
        testCombo.dataProvider = items;

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2011 12:30 AM   in reply to JoeriADAM

    Hi,

     

    I tried to reproduce the issue with your code on my side, however everything was fine, the source code is attached below, please try it

     

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" 
         height="100" implements="com.adobe.drive.customui.moduleinterface.ICustomCheckInUI" creationComplete="module1_creationCompleteHandler(event)">
    <mx:Script>
      <![CDATA[
       import com.adobe.drive.customui.moduleinterface.ICustomCheckInUI;
       
       import mx.events.FlexEvent;
       import mx.collections.ArrayCollection;
       
       private var _contextInfo:Object;
       
       public function setLocale(locale:String):void
       {
        return;
       }
       
       
       public function setContextInfo(info:Object):void
       {
        _contextInfo = info;    
       }   
       
       public function getWidth():int
       {
        return 400; 
       }
       
       
       public function getHeight():int
       {
        return 100;
       }
       
       
       public function getInteractionResults():Object
       {
        var returnValue:Array = new Array();
        
        returnValue[key] = value;
        
        return returnValue;
       }
       
       protected function module1_creationCompleteHandler(event:FlexEvent):void
       {
        if (_contextInfo == null)
         return;    
        
        if (_contextInfo.hasOwnProperty(defaultValue))
         this.TestPropertyValue.text =  _contextInfo[defaultValue];
        
        var items:ArrayCollection = new ArrayCollection();    
        
        items.addItem(value1);    
        items.addItem(value2);
        
        testCombo.dataProvider = items;
       }
      ]]>
    
    
    
    
    </mx:Script>  
    <mx:Canvas width="100%" height="100%" borderStyle="inset">
      <mx:Label id="TestPropertyName" x="32" y="37" text="TestProperty:" width="100"/>
      <mx:TextInput id="TestPropertyValue" x="195" y="35" width="164"/>
      <mx:ComboBox id="testCombo" x="32" y="64"></mx:ComboBox>
    </mx:Canvas>
    
    
    
       
    </mx:Module>
    
    
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2011 1:50 AM   in reply to JoeriADAM

    Hi,

     

    No, on my side, requestItem.getCustomParameters() returns the correct interaction result

     

    item CheckInRequest$Item  (id=212) 
     content InputStreamReadableByteChannel  (id=214) 
     contentSize 109753 
     customParameters CustomParameters  (id=219) 
      parameter HashMap<K,V>  (id=223) 
       entrySet HashMap$EntrySet  (id=231) 
       keySet null 
       loadFactor 0.75 
       modCount 1 
       size 1 
       table HashMap$Entry<K,V>[16]  (id=224) 
        [0] null 
        [1] null 
        [2] null 
        [3] null 
        [4] null 
        [5] null 
        [6] null 
        [7] null 
        [8] null 
        [9] null 
        [10] null 
        [11] null 
        [12] null 
        [13] null 
        [14] null 
        [15] HashMap$Entry<K,V>  (id=225) 
         hash -922089969 
         key "key" (id=143) 
         next null 
         value "value" (id=144) 
       threshold 12 
       values null 
     identity RemoteAssetIdentity  (id=221) 
     lockToken null 
     mimeType null 
     modificationDate 1307635200000 
     replace false 
     versionProperties null 
     xmp null 
    


    Please do the following steps to re-test your connector

     

    1) unmount all the drives

    2) kill CS5ServiceManager

    3) make sure getInteractionResults() in the Flex part return the correct value

    4) Compile you Flex module and replace the old one

    5) re-connect your server

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2011 2:36 AM   in reply to JoeriADAM

    Hi,

     

    Please use Flex SDK 3.5 to compile your module swf, and give it another try

     

    thanks

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2011 3:09 AM   in reply to JoeriADAM

    This is what I got, , I still can not reproduce your issue

     

    item CheckInRequest$Item  (id=593) 
     content InputStreamReadableByteChannel  (id=596) 
     contentSize 75579 
     customParameters CustomParameters  (id=597) 
      parameter HashMap<K,V>  (id=598) 
       entrySet HashMap$EntrySet  (id=666) 
       keySet null 
       loadFactor 0.75 
       modCount 1 
       size 1 
       table HashMap$Entry<K,V>[16]  (id=599) 
        [0] null 
        [1] null 
        [2] null 
        [3] null 
        [4] null 
        [5] null 
        [6] null 
        [7] null 
        [8] null 
        [9] null 
        [10] null 
        [11] null 
        [12] null 
        [13] HashMap$Entry<K,V>  (id=602) 
         hash -199977139 
         key "myKey" (id=584) 
         next null 
         value "myValue" (id=585) 
        [14] null 
        [15] null 
       threshold 12 
       values null 
     identity RemoteAssetIdentity  (id=594) 
     lockToken null 
     mimeType null 
     modificationDate 1307894400000 
     replace false 
     versionProperties null 
     xmp null 
    


    MXML file, could you totally use this file for your test and see what happens?

     

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" 
         height="100" implements="com.adobe.drive.customui.moduleinterface.ICustomCheckInUI" creationComplete="module1_creationCompleteHandler(event)">
     <mx:Script>
      <![CDATA[
       import com.adobe.drive.customui.moduleinterface.ICustomCheckInUI;
       
       import mx.events.FlexEvent;
       import mx.collections.ArrayCollection;
       
       private var _contextInfo:Object;
       
       public function setLocale(locale:String):void
       {
        return;
       }
       
       
       public function setContextInfo(info:Object):void
       {
        _contextInfo = info;    
       }   
       
       public function getWidth():int
       {
        return 400; 
       }
       
       
       public function getHeight():int
       {
        return 100;
       }
       
       
       public function getInteractionResults():Object
       {
        var returnValue:Array = new Array();
        
        var key:String = myKey;
        
        var value:String = myValue;
        
        returnValue[key] = value;
        
        return returnValue;
       }
       
       protected function module1_creationCompleteHandler(event:FlexEvent):void
       {
        if (_contextInfo == null)
         return;    
        
        if (_contextInfo.hasOwnProperty(defaultValue))
         this.TestPropertyValue.text =  _contextInfo[defaultValue];
        
        var items:ArrayCollection = new ArrayCollection();    
        
        items.addItem(value1);    
        items.addItem(value2);
        
        testCombo.dataProvider = items;
       }
      ]]>
     </mx:Script>  
     <mx:Canvas width="100%" height="100%" borderStyle="inset">
      <mx:Label id="TestPropertyName" x="32" y="37" text="TestProperty:" width="100"/>
      <mx:TextInput id="TestPropertyValue" x="195" y="35" width="164"/>
      <mx:ComboBox id="testCombo" x="32" y="64"></mx:ComboBox>
     </mx:Canvas>
     
       
    </mx:Module>
    
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2011 6:46 AM   in reply to JoeriADAM

    It's really strange, if you don't mind, can you share you whole Flex project with me? you can zip it and send it to gzheng@adobe.com, I will compare your project setting with mine and test it with BR5.5

     

    Thanks

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 28, 2011 9:41 PM   in reply to JoeriADAM

    Hi,

     

    Yes, there is an issue here in adding a new file using Bridge, the main reason is, it's hard to extract the server information at that time, we will find out how to correct it in the future releases, a bug will be logged.

     

    please recommend your users to copy the file into AD file system using Explorer/Finder first, the file status is new, then use Bridge to check-in it.

     

    Thanks for reporting it.

     

    Gang

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points