1 Reply Latest reply on Dec 2, 2016 9:51 AM by laurentsd

    A problem about wizard

    dhbtemp Novice

        Hi,i had a new problem to solve.

        When i open a dialog with command WEB_PLATFORM.openModalDialog(),i noticed that a parameter named "ObjectId" was null,

        The whole workflow is in the beginning loading a page the "ObjectId" is normal and not null.and then i opena new wizard(a new dialog which has its own Function and logic,what's more,web-platform.js is needed to import in this new dialog) with command WEB_PLATFORM.openModalDialog(),the "ObjectId" became null.Also i checked the sample named chassisA in SDK,there was the same problem.

        This problem make me can't get the content when i click a new page after i open a dialog.For example,now i  add a new extension point in the host,in the extension point,i create a select tree to show the different content.When a open a new dialog(use WEB_PLATFORM.openModalDialog()) in one of  select tree menu and close it,i click the other choose in the select tree menu, the content i need to show is empty.

        The  problem shows in the following figures,i print the ObjectId in the console,you can find its differentce.

      nomal_view.PNG

                                                                 1.the normal view                            

      nomal_console_log.PNG

                                                              2. the objectId is not null

       

      open_modal_dialog_副本.png

                                                            3.open a new dialog in this page

      error_ObjectId_value.PNG

                                                          4.now the object is null

      error_view.PNG

                                                        5.close the dialog and click the other choose the error is occur

        if you have some good ideals about this problem or the resolvent,pls reply to me,thanks!

        • 1. Re: A problem about wizard
          laurentsd Master
          VMware Employees

          Can you check why you are passing a null objectId in your call to WEB_PLATFORM.openModalDialog(dialog_title, url, width, height, objectId)?

          Notice how it is done in samples/chassisA-html/src/main/webapp/resources/js/chassis-summary.js

           

          $(document).ready(function() {

            ...

             // Get current object when the document loads, then objectId is valid for the rest of this code

             var objectId = WEB_PLATFORM.getObjectId();

            ...


            // Navigate to another view using its extension id.

             $("#monitorLink").click(function() {

                WEB_PLATFORM.sendNavigationRequest("com.vmware.samples.chassisa.MonitorView1", objectId);   <===== known objectId

             });

           

           

          The following is not recommended for instance, because getting the objectId inside the click function is not guaranteed to work:

           

             $("#monitorLink").click(function() {

                 var objectId = WEB_PLATFORM.getObjectId();

                WEB_PLATFORM.sendNavigationRequest("com.vmware.samples.chassisa.MonitorView1", objectId);

             });