>
> > WOW! Multi-module in Tapestry with Live Class Reloading is fantastic!
> > Thanks for pointing me in the right direction Thiago!
>
> Yay! Virtual high-five! :D Tapestry is awesome, isn't it? ;)
>
Oh yea! T5.4 is a success!
> specify @SubModule(HappyModule.class) (or @ImportModule in T5.4) in your
Tanks Kalle! A good replacement for <manifestEntries><Tapestry-Module-Classes>
I am moving a lot of code to my common module. I think the biggest challenge is
how to access assets from JavaScript.
I moved the box_1.png, box_2.png, ... images to my common modules
META-INF.assets.jacillacore.img.destinationStatus
public static void
contributeComponentClassResolver(Configuration<LibraryMapping> configuration) {
configuration.add(new LibraryMapping("jacillacore",
"com.jacilla.core"));
}
My original code:
var iconUrl = "/img/destinationStatus/box_" + prepStatus + ".png";
Tried:
var iconUrl = "${asset:jacillacore/img/destinationStatus/box_" + prepStatus +
".png}";
and:
var iconUrl = "/jacillacore/assets/jacillacore/img/destinationStatus/box_" +
prepStatus + ".png";
It did not work! Is it possible to access then directly for javascript?
To make it work I had to send the asset url's to the javascript module:
final JSONObject statusImages = new JSONObject();
for (int i = 1; i <= maxStatus; i++) {
final String format =
String.format("/META-INF/assets/jacillacore/img/destinationStatus/box_%d.png",
i);
Asset asset = assetSource.getExpandedAsset(format);
statusImages.put(String.valueOf(i), asset.toClientURL());
}
return new JSONObject(
"statusImages", statusImages,
"symbols", symbols);
Is this the correct way of doing this in T5.4, or could it be simpler?