Just an update on this issue. I implemented the above using royale 0.9.8.

I decided to try the same thing on royale 0.9.7. It is still working
however I can see a log message that is not available when running on 0.9.8

Here it is

*warning: no describeType entry for 'lovBO' on non-dynamic type
'LovController'*

What is the meaning of this warning ?  From the log below it is clear the
setter injection failed. Hence the reason the dropdown is not being
populated.


Language.as:254 InjectProcessor set up [Inject(
source="logInController.logInParams", bind="true" )] on Bean{ source:
[object Object], name: null }

*Language.as:254 warning: no describeType entry for 'lovBO' on non-dynamic
type 'LovController'InjectProcessor.as:385 Uncaught Error: Unexpected
result*
    at org.apache.royale.crux.processors.InjectProcessor.addPropertyBinding
(InjectProcessor.as:385)
    at org.apache.royale.crux.processors.InjectProcessor.setUpMetadataTag
(InjectProcessor.as:139)
    at
org.apache.royale.crux.processors.InjectProcessor.org.apache.royale.crux.processors.BaseMetadataProcessor.setUpMetadataTags
(BaseMetadataProcessor.as:81)
    at org.apache.royale.crux.BeanFactory.setUpBean (BeanFactory.as:378)
    at Function.org.apache.royale.crux.CruxManager.setUpView
(CruxManager.as:106)
    at Function.org.apache.royale.crux.CruxManager.setUp (CruxManager.as:88)
    at org.apache.royale.crux.BeanFactory.setUpEventHandler
(BeanFactory.as:517)
    at FrontEnd.org.apache.royale.events.EventDispatcher.fireListeners
(EventDispatcher.as:139)
    at Function.goog.events.EventTarget.dispatchEventInternal_
(eventtarget.js:372)
    at
org.apache.royale.crux.beads.JSStageEvents.org_apache_royale_crux_beads_JSStageEvents_mutationDetected
(JSStageEvents.as:209)


I have attached the complete log to this mail

On Sat, Sep 18, 2021 at 7:44 PM Roman Isitua <[email protected]> wrote:

> Thanks for helping out.
>
> I forgot to attach the GenericLOV source code.
>
> Find attached to this email.
>
>
> On Sat, Sep 18, 2021 at 6:48 PM Maria Jose Esteve <[email protected]>
> wrote:
>
>> Hi Roman,
>>
>> I saw your previous code and now I will see this one you attach. I will
>> try to help you BUT I don't know if I will be able to because although I
>> use Crux and amf my implementation is different from yours and I don't
>> control all the concepts (my original project was set up by a Royale expert
>> company).
>>
>>
>>
>> I'll let you know if I get something.
>>
>> Hiedra.
>>
>>
>>
>> *De:* Roman Isitua <[email protected]>
>> *Enviado el:* sábado, 18 de septiembre de 2021 18:37
>> *Para:* [email protected]
>> *Asunto:* crux not injecting model in view
>>
>>
>>
>> I intend to populate a jewel drop down with data from the server. I have
>> configured the controller and service in the Beans.xml file.
>>
>> From the logs injection happens.
>>
>>
>>
>> However, I have observed that the model is not injected into the view.
>>
>>
>>
>> Any ideas ?
>>
>>
>>
>> My code is implemented as follows
>>
>>
>>
>> LovBO
>>
>>
>>
>>  public class LovBO
>>
>>    {
>>
>>
>>
>>       /**
>>
>>
>>          * The [Dispatcher] metadata tag instructs Crux to inject an event 
>> dispatcher.
>>
>>
>>          * Event's dispatched via this dispatcher can trigger event 
>> mediators.
>>
>>          */
>>
>>         [Dispatcher]
>>
>>         public var dispatcher : IEventDispatcher;
>>
>>
>>
>>       [Inject( "lovService" )]
>>
>>       public var lovService:RemoteObject;
>>
>>
>>
>>       [Inject]
>>
>>       public var serviceHelper:ServiceHelper;
>>
>>
>>
>>        [Bindable]
>>
>>       public var _lovs:Array;
>>
>>
>>
>>        [Bindable]
>>
>>       public var _lovs2:ArrayList;
>>
>>
>>
>> LovController
>>
>>
>>
>>  public class LovController
>>
>>    {
>>
>>          [Inject]
>>
>>          public var lovBO:LovBO;
>>
>>
>>
>>        //  [Bindable]
>>
>>          public var genericLovs:ArrayList;
>>
>>
>>
>>        public function LovController()
>>
>>        {
>>
>>            trace('  -- LovController -- ');
>>
>>        }
>>
>>
>>
>>        /**
>>
>>
>>          * [PostConstruct] methods are invoked after all dependencies are 
>> injected.
>>
>>
>>          * In this example, we set up a default user after the bean is 
>> created.
>>
>>          */
>>
>>         [PostConstruct]
>>
>>         public function fetchLovs() : void
>>
>>         {
>>
>>
>>
>>             trace(' -- [PostConstruct] fetch lovs country prefix  -- ');
>>
>>
>>
>>             //genericLovs = lovBO.lov2;
>>
>>
>>
>>             lovBO.lov2;
>>
>>         }
>>
>>
>>
>> Beans.xml
>>
>>   <services:LovBO id="lovBO"/>
>>
>>          <controllers:LovController id="lovController"/>
>>
>>
>>
>>
>>
>> The application.mxml
>>
>>
>>
>>
>>
>>
>>
>> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
>>
>>             xmlns:js="library://ns.apache.org/royale/basic"
>>
>>             xmlns:j="library://ns.apache.org/royale/jewel"
>>
>>             xmlns:crux="library://ns.apache.org/royale/crux"
>>
>>             xmlns:config="com.spacio.fm.client2.config.*"
>>
>>             xmlns:views="com.spacio.fm.client2.views.*"
>>
>>             initialize="setUp;initApp(event);">
>>
>>
>>
>>     <!-- <fx:Style source="../../main/resources/default.css"/> -->
>>
>>        <fx:Script>
>>
>>              <![CDATA[
>>
>>
>>
>>                    public function setUp():void
>>
>>                   {
>>
>>                              tracer('application setUp stub');
>>
>>                   }
>>
>>
>>
>>                        private function initApp(event:Event): void
>>
>>                        {
>>
>>                            trace("  -- initApp -- ");
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>                            trace(" -- end of init app -- ");
>>
>>                        }
>>
>>
>>
>>               ]]>
>>
>>       </fx:Script>
>>
>>
>>
>>     <j:valuesImpl>
>>
>>         <js:SimpleCSSValuesImpl />
>>
>>     </j:valuesImpl>
>>
>>
>>
>>
>>
>>
>>
>> <j:beads>
>>
>>         <crux:JSStageEvents packageExclusionFilter="_default_"/>
>>
>>         <crux:Crux>
>>
>>             <crux:beanProviders>
>>
>>                 <config:Beans/>
>>
>>             </crux:beanProviders>
>>
>>             <crux:config>
>>
>>                 <crux:CruxConfig
>>
>>                     eventPackages="com.spacio.fm.client2.events.*"
>>
>>                     viewPackages="com.spacio.fm.client2.views.*"
>>
>>                     />
>>
>>             </crux:config>
>>
>>         </crux:Crux>
>>
>>          <js:ClassAliasBead />
>>
>>     </j:beads>
>>
>>
>>
>>     <j:initialView>
>>
>>         <views:MainView width="100%" height="100%"/>
>>
>>     </j:initialView>
>>
>>
>>
>> </j:Application>
>>
>>
>>
>> MainView.mxml ( I have attached the complete source for the MainView.xml.
>> and the other classes)
>>
>>
>>
>>
>>
>> <j:View xmlns:fx="http://ns.adobe.com/mxml/2009";
>>
>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>
>>     xmlns:js="library://ns.apache.org/royale/basic"
>>
>>     xmlns:html="library://ns.apache.org/royale/html"
>>
>>     initComplete="initCompleteHandler(event)"
>>
>>     xmlns:views="com.spacio.fm.client2.views.*"
>>
>>     >
>>
>>
>>
>>     <j:beads>
>>
>>         <js:SimpleStatesImpl/>
>>
>>         <js:ViewDataBinding/>
>>
>>      <!-- <js:ContainerDataBinding/> -->
>>
>>     </j:beads>
>>
>>
>>
>>        <j:states>
>>
>>               <js:State name="joinus" />
>>
>>               <js:State name="registerFM" />
>>
>>               <js:State name="loggedIn" />
>>
>>        </j:states>
>>
>>
>>
>>
>> <!-- xmlns:binding="org.apache.royale.binding.*"  
>> xmlns:models="com.spacio.fm.client2.model.*"  
>> xmlns:models="com.spacio.fm.client2.service.*"
>>
>>
>>
>>        <fx:Script source="MainBean.as">
>>
>>        </fx:Script> -->
>>
>>         <fx:Script>
>>
>>              <![CDATA[
>>
>>                       import org.apache.royale.jewel.PopUp;
>>
>>                        import org.apache.royale.events.CloseEvent;
>>
>>                      import org.apache.royale.jewel.Button;
>>
>>                      import org.apache.royale.events.MouseEvent
>> ;
>>
>>                      import org.apache.royale.collections.ArrayList;
>>
>>
>>
>> [Bindable]
>>
>>       public var genericLovs:ArrayList;
>>
>>
>>
>>  //example of setter style binding Injection
>>
>>         [Inject( source = "lovController.lovBO._lovs2", bind = "true"
>>  )]
>>
>>         public function setGenericLovs(val:ArrayList):void
>>
>>         {
>>
>>              trace("injected lov array list. hurray !! ");
>>
>>
>>
>>             this.genericLovs = val;
>>
>>
>>
>>             trace(" generic lov has been set ! ");
>>
>>         }
>>
>>
>>
>> // the dropdown defined as follows
>>
>>
>>
>>
>>
>>
>>
>>  <j:DropDownList id="phoneCountryPrefix" width="30%" labelField=
>> "description" dataProvider="{genericLovs}">
>>
>>  </j:DropDownList>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
Language.as:254  -- LovBO() -- 
Language.as:254   -- LovController -- 
Language.as:254  -- LogInService() -- 
Language.as:254  -- LogInController() -- 
Language.as:254 Activating JSStageEvents
getStaticConstantsByConvention.js:52 [WARNING] getStaticConstantsByConvention 
:: the reflection target mx.rpc.remoting.mxml.RemoteObject was not Compiled 
with default initializers enabled
org.apache.royale.reflection.utils.getStaticConstantsByConvention @ 
getStaticConstantsByConvention.js:52
Language.as:254 InjectProcessor set up [Inject( "lovService" )] on Bean{ 
source: [object Object], name: lovBO }
Language.as:254 InjectProcessor set up [Inject] on Bean{ source: [object 
Object], name: lovBO }
Language.as:254 InjectProcessor set up [Inject] on Bean{ source: [object 
Object], name: lovController }
Language.as:254  -- [PostConstruct] fetch lovs country prefix  -- 
Language.as:254  -- lov2() -- 
Language.as:254  fetch lovs 
Language.as:254 InjectProcessor set up [Inject] on Bean{ source: [object 
Object], name: logInController }
Language.as:254  -- [PostConstruct] executing initLogInParams in 
LogInController  -- 
Language.as:254  -- initialise LoginDTO -- 
Language.as:254   -- initApp -- 
tracer.js:22 [JS] application setUp stub
Language.as:254  -- end of init app -- 
Language.as:254 Main ResponsiveView is ready !!! 
Language.as:254  set initial current state to log in ..
Language.as:254   currentState: login
Language.as:254  -- set instantiated login params -- 
Language.as:254 InjectProcessor set up [Inject( 
source="logInController.logInParams", bind="true" )] on Bean{ source: [object 
Object], name: null }
Language.as:254 warning: no describeType entry for 'lovBO' on non-dynamic type 
'LovController'
InjectProcessor.as:385 Uncaught Error: Unexpected result
    at org.apache.royale.crux.processors.InjectProcessor.addPropertyBinding 
(InjectProcessor.as:385)
    at org.apache.royale.crux.processors.InjectProcessor.setUpMetadataTag 
(InjectProcessor.as:139)
    at 
org.apache.royale.crux.processors.InjectProcessor.org.apache.royale.crux.processors.BaseMetadataProcessor.setUpMetadataTags
 (BaseMetadataProcessor.as:81)
    at org.apache.royale.crux.BeanFactory.setUpBean (BeanFactory.as:378)
    at Function.org.apache.royale.crux.CruxManager.setUpView 
(CruxManager.as:106)
    at Function.org.apache.royale.crux.CruxManager.setUp (CruxManager.as:88)
    at org.apache.royale.crux.BeanFactory.setUpEventHandler (BeanFactory.as:517)
    at FrontEnd.org.apache.royale.events.EventDispatcher.fireListeners 
(EventDispatcher.as:139)
    at Function.goog.events.EventTarget.dispatchEventInternal_ 
(eventtarget.js:372)
    at 
org.apache.royale.crux.beads.JSStageEvents.org_apache_royale_crux_beads_JSStageEvents_mutationDetected
 (JSStageEvents.as:209)
252Language.as:254  --- init GenericLOV() --- 
Language.as:254  -- handleLovFetchResult -- 
Language.as:254  lovs returned: 252
Language.as:254  lov fetched !
S6uyw4BMUTPHjx4wXg.woff2:1 Failed to load resource: 
net::ERR_CONNECTION_TIMED_OUT
S6u9w4BMUTPHh6UVSwiPGQ.woff2:1 Failed to load resource: 
net::ERR_CONNECTION_TIMED_OUT

Reply via email to