Skip to Main Content

Application Development Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OJET Corouter - How to manually resolve one specific module

Thomas Mathew-OracleJul 16 2025 — edited Jul 18 2025

OJET v18, MVMM architecture with Typescript

I am using the generated navbar template project and extending it.

So in the appController.ts I have

const routes = [
      { path: "", redirect: "sites" },
      { path: "sites", detail: { label: "Sites", iconClass: "oj-ux-ico-sites" } },
      { path: "statistics", detail: { label: "Statistics", iconClass: "oj-ux-ico-dimensional-bar-graph" } },
      { path: "administration", detail: { label: "Administration", iconClass: "oj-ux-ico-administration" } },
      { path: "sites/{siteName}", detail: { label: "Administration", iconClass: "oj-ux-ico-administration" },  module: "sitedetails"},
    ];

    const navData = [
      { path: "sites", detail: { label: "Sites", iconClass: "oj-ux-ico-sites" } },
      { path: "statistics", detail: { label: "Statistics", iconClass: "oj-ux-ico-dimensional-bar-graph" } },
      { path: "administration", detail: { label: "Administration", value: "sitedetails", iconClass: "oj-ux-ico-administration" } },
    ];


// router setup
    const router = new CoreRouter(routes, {
      urlAdapter: new UrlPathParamAdapter("/")
    });

    router.sync();

    this.moduleAdapter = new ModuleRouterAdapter(router);
    this.selection = new KnockoutRouterAdapter(router);

this.navDataProvider = new ArrayDataProvider(navData, {keyAttributes: "path"});

And in the index.html

<other-general-html>
<navbar>
<oj-module role="main" class="oj-web-applayout-max-width oj-web-applayout-content" config="[[moduleAdapter.koObservableConfig]]">
        </oj-module>

My requirement is that, the path - "sites/{siteName}" - should load a siteDetails module (siteDetails.html and siteDetails.ts) with siteName as argument

I don't want to use child routers because I want the siteDetails to be loaded in the same module as I want to keep the navbar and other things as the same. Is there a way to manually resolve all individual paths or to resolve this particular path and the other path resolution being the same ?

localhost:8000/sites - loads sites module localhost:8000/sites/my_site - Should load sitedetails module with this argument

Thanks in advance

Comments
Post Details
Added on Jul 16 2025
0 comments
47 views