4 Replies Latest reply on Oct 16, 2019 8:12 AM by Duncan Mills-Oracle

    How to create JET page through command prompt?

    3712157

      How to create JET page through command prompt?

        • 1. Re: How to create JET page through command prompt?
          Daniel Merchán

          Hi,

           

          You need to elaborate better the question.

           

          The default templates of Oracle JET are prepare for developing SPA (Single Page Applications) where you load Modules asynchronously and navigate bewteen them using the Routing concept.

           

          • Do you want to develop a Non SPA Application?
          • Are you referring on how to develop a new Module? Such as Dashboard, Incidents etc... of the templates provided?

           

          Kind regards.

          • 2. Re: How to create JET page through command prompt?
            3712157

            Hi Daniel,

             

            Thanks for your reply

            I need to create the custom page, like a dashboard, incidents page from command prompt.

             

            Please find attached image for reference.

            As of now we are creating Netbeans to create new page.

            • 3. Re: How to create JET page through command prompt?
              Daniel Merchán

              Hi,

               

              What you are creating are modules, not pages.

               

              As a summary of steps you need to create:

              • In src/js/viewModels create the ViewModel file of your new module -> For example employees.js (It is a regular JavaScript file, you can copy another module as an example and rename the function name)
              • in src/js/view create the View which will be related to the ViewModel you created before -> employees.html
              • In src/js/appController.js you need to update
                • self.router.configure to add the new Module as part of your Router configuration
                • In navData (assuming you started with a SPA template of Oracle JET) add the item of navigation using the same id as the registered in the router

               

              Note: Oracle JET is agnostic to the IDE, Netbeans or Visual Studio Code does not provide fully interaction with the Oracle JET Command Line Interface or quick menus to create things.
              For example, Visual Studio Code has a pluging which helps you with auto-complete functionality when using Oracle JET. I like VS over Netbeans for Oracle JET development, but I love Netbeans for J2EE / Jakarta EE (now depends where you are more comfortable).

               

              I strongly suggest to you that you complete the Oracle JET tutorials to understand the development of SPA Applications by using Oracle JET, it is crucial you understand the underlying concepts and basis: https://www.oracle.com/webfolder/technetwork/jet/globalExamples-Course.html

               

              Kind regards.

              • 4. Re: How to create JET page through command prompt?
                Duncan Mills-Oracle

                We don't have a ojet cli command to do that (add a module is the specific action in this case)  We have been considering if that is worth adding though.

                For now you will just have to duplicate up one of the existing modules (view html and viewModel js) and tweak the router config.