Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 07 05:18
    FrankHossfeld commented #200
  • Jun 07 05:18
    FrankHossfeld commented #200
  • Jun 05 19:56
    masterdany88 edited #200
  • Jun 05 19:54
    masterdany88 opened #200
  • Jun 04 13:48
    FrankHossfeld closed #199
  • Jun 04 13:48
    FrankHossfeld commented #199
  • Jun 04 13:48

    FrankHossfeld on gwt-2.8.2

    #199 - Update GSON version to l… (compare)

  • Jun 04 13:45

    FrankHossfeld on gwt-2.8.2

    set version to HEAD-SNAPSHOT (compare)

  • Jun 04 07:09

    FrankHossfeld on main

    #199 - Update GSON version to l… (compare)

  • Jun 04 07:03

    FrankHossfeld on main

    set version to HEAD-SNAPSHOT (compare)

  • Jun 03 07:46
    FrankHossfeld labeled #199
  • Jun 03 07:46
    FrankHossfeld milestoned #199
  • Jun 03 07:46
    FrankHossfeld assigned #199
  • Jun 03 07:46
    FrankHossfeld opened #199
  • May 18 16:26

    FrankHossfeld on v2.4.2

    (compare)

  • May 18 16:23

    FrankHossfeld on main

    set versionb to 2.4.2 (compare)

  • May 18 16:09

    FrankHossfeld on v2.4.2-gwt-2.8.2

    (compare)

  • May 18 16:04

    FrankHossfeld on gwt-2.8.2

    set versionb to 2.4.2-gwt-2.8.2 (compare)

  • May 18 15:59

    FrankHossfeld on gwt-2.8.2

    Fixed JavaDoc (compare)

  • May 18 15:50
    FrankHossfeld closed #198
Tim Marshall
@timmarsha11
I can get the modular applications to work if the initial startRoute is in the main application module. Subsequently the filter works and routes to the login page. Also the initial 'loggedIn' parameter needs to be set to false (i did it in the NaluLoginApplicationContextLoginModule constructor) - otherwise there is a null pointer error thrown.
Frank Hossfeld
@FrankHossfeld
I can get the modular applications to work if the initial startRoute is in the main application module.
Does the processor generates an error?
Also the initial 'loggedIn' parameter needs to be set to false (i did it in the NaluLoginApplicationContextLoginModule constructor) - otherwise there is a null pointer error thrown.
correcrt. that sounds like a bug inside the example
Tim Marshall
@timmarsha11

Does the processor generates an error?

None that I can see (I'm using v2.2.0). All working as I would expect. I just used the existing '/applicationShell/person/search' route

Frank Hossfeld
@FrankHossfeld
ok … but I think you are right, the start route needs to be defined inside the main module. I should update the docs.
Tim Marshall
@timmarsha11
its because the call to this.loadDefaultRoutes(); is before this.onFinishLoading() which in turn calls this.loadModules();. Not sure if loadDefaultRoutes() could be deferred or if that will break something else.
Frank Hossfeld
@FrankHossfeld
Might be worth to take a look ….
can you open an issue?
Tim Marshall
@timmarsha11
OK
Frank Hossfeld
@FrankHossfeld
Thanks!
Tim Marshall
@timmarsha11

Hi, can you confirm my understanding of the module context behaviour.

I have two parameters initialised in MainContext, one in context and one in applicationContext. Similarly in ModuleContext I have two parameters, one in context and one in applicationContext.

From the Main Application (via MainContext):
-MainContext context: set
-MainContext applicationContext: set
-ModuleContext context: undefined
-ModuleContext applicationContext: undefined

From the Module (via ModuleContext):
-MainContext context: undefined
-MainContext applicationContext: set
-ModuleContext context: set
-ModuleContext applicationContext: undefined

So:
-If a parameter is set in context, then it is only visible within the module it is defined in.
-If a parameter is set in applicationContext in the main application, then it is available in the modules
-If a parameter is set in applicationContext in the module, then it is not available anywhere

The last one does not seem correct. Is this by design, i.e. a module cannot define an application wide context parameter?

So for instance an ‘isLoggedIn’ parameter cannot be defined by the login module for access by other modules?? In this case, would the correct usage to be to fire an ‘UpdateContextEvent’ containing the parameter key and value, and then let the main application handle adding it to the applicationContext?

Frank Hossfeld
@FrankHossfeld
HI, I expect that also a module can set application wide properties in a context. Do you have a small example thst you can share to show the problem?
Tim Marshall
@timmarsha11
I do based on the module login example - how do I get it to you?
Frank Hossfeld
@FrankHossfeld
create a public GIT repo at GitHub and push it there. Think this is the best wy to do it.
Tim Marshall
@timmarsha11
you can see the card on the login form which loads data from the ModuleContext and then the card on the search from that used the data from the MainContext
Frank Hossfeld
@FrankHossfeld
Thanks
Frank Hossfeld
@FrankHossfeld
ok, got your problem.
Let me try to explain it.
Nalu uses two HashMaps as context. One for values that should be visible in all modules and one where the values aere only visible inside the module.
f. e.:
  private final static String USER_ID              = "USER_ID";


  public String getUserId() {
    return (String) super.getApplicationContext()
                         .get(IolaniContext.USER_ID);

  }

  public void setUserId(String userId) {
    super.getApplicationContext()
         .put(IolaniContext.USER_ID,
              userId);
  }
this will make the value of userId visible in all modules.
 private final static String USER_ID              = "USER_ID";


  public String getUserId() {
    return (String) super.getContext()
                         .get(IolaniContext.USER_ID);

  }

  public void setUserId(String userId) {
    super.getContext()
         .put(IolaniContext.USER_ID,
              userId);
  }
in this case, it will only be visible inside the module.
Frank Hossfeld
@FrankHossfeld
Depending on what you want, you need to use getApplicationContext() if the value should be visible in all modules or use getContext()in case the value should only be visible inside the module.
And always use the same key to access … ;-)
hope that helps
Please, try thsi in your SearchController:
            "'loggedIn' from context: "+ this.context.getContext().get("loggedIn") +"; \n" +
            "'loggedIn' from applicationContext: "+ this.context.getApplicationContext().get("loggedIn") +"; \n" +
This should show the difference
The first one will give ‚undefined‘, the second one ‚true'
Tim Marshall
@timmarsha11
OK - I think I understand where the 'bug' is. If the parameter is set in the Context constructor then it is not set. I can set it from the Module Loader or Controller using the method above. Not sure this is as expected. Just means context initial parameters have to be set outside the context.
Frank Hossfeld
@FrankHossfeld
what do you mena with: 'context initial parameters'
Tim Marshall
@timmarsha11
e.g. For the loggedIn parameter to work it needs to be initialised first, or it throws a null pointer. I was doing this in the constructor and it was coming back undefined. When I initialise it in the Loader it comes back false
Frank Hossfeld
@FrankHossfeld
Have you tried to call super() before initialse it inside the constructor??
Tim Marshall
@timmarsha11

Yep. In my module context constructor:
super.getApplicationContext().put("setInModuleContextContructor", "returns undefined");

In my module loader:
this.context.getApplicationContext().put("setInModuleLoader", "returns valid parameter");

In my controllers (login and search):
String contexts =
"loggedIn: "+this.context.getApplicationContext().get("loggedIn")+"; "+ "'setInModuleContextContructor' from context: "+ this.context.getApplicationContext().get("setInModuleContextContructor") +"; \n" +
"'setInModuleLoader' from context: "+ this.context.getApplicationContext().get("setInModuleLoader") ;

Both output:
loggedIn: false; 'setInModuleContextContructor' from context: undefined; 'setInModuleLoader' from context: returns valid parameter

Setting in the Module Context Constructor is not working

Frank Hossfeld
@FrankHossfeld
Yes, correct, the applicationContext is injected into the module context after the module context is created. you can not set a value in the applicaitonContext inside the constructor. If you want to set values in case the module is started, use a module loader. If you want to set something in all modules, use the post loader.
Frank Hossfeld
@FrankHossfeld
@/all Starting with version 2.2.1 Nalu will provide a version for GWT 2.8.2 and another one for GWT 2.9.0. If you want to use the version for GWT 2.8.2, you need to add the String: -gwt-2.8.2to the version. Version should land in Maven Central in a few hours ...
Tino Desjardins
@TDesjardins
Perfect :thumbsup:
Frank Hossfeld
@FrankHossfeld
@/all I am happy to annouce a new Nalu release: https://github.com/NaluKit/nalu/releases/tag/v2.3.0
Frank Hossfeld
@FrankHossfeld
@/all Yesterday I release a patch release for 2.4.0, which removes the Js.debugger() statement.https://github.com/NaluKit/nalu/releases/tag/v2.4.1
maven Central is already up-to-date.
Frank Hossfeld
@FrankHossfeld
@/all Version 2.4.2 is released: https://github.com/NaluKit/nalu/releases/tag/v2.4.2
maven central is already up-to-date.
Daniel Korbel
@masterdany88
Hi. Is nalu support nested composite components?
I am trying to make it work, but I am getting strange error
Frank Hossfeld
@FrankHossfeld
Hi, Nalu does not support nested composite. (composite inside a composite). A normal controller/component can have several composites.
Daniel Korbel
@masterdany88
Oh. Thats bad :-( I have very complicated view. Currently Nested composites generate html dom placeholders but not inject views content. It seems I could do this manually. I will check how it works right now. Maybe there will be not much work in annotations processor to do.