Error in custom component due to server-side.js

Forum to discuss the new web client version of Servoy.

Error in custom component due to server-side.js

Postby jay.rao » Tue Jan 09, 2018 10:38 am

Hello, we have an api (getSelectedIndex) for our custom panel component which is used in our framework at some point. Now the issue is this is called at few places when we try to open the form but as the form is not visible is throws the error stating '<tabs> is not visible' .We know its because we have written the code in panel.js and not panel-server-side.js but if you see we have some strong to not to move this code in to server-side.js. Is there any possible way where let's say I can broadcast an event from server-side.js and listen at panel.js so that i can execute this code. Because we are sure we cannot move this code to server-side as rootScope and few of the things won't work in server-side.js

Code: Select all
$scope.api.getSelectedIndex = function() {
               if ($rootScope.isMinicrumbChange) {
                  for (var i = 0; i < $rootScope.currentTab.length; i++) {
                     if ($rootScope.currentTab[i].active == true) {
                        return i + 1;
                     }
                  }                  
               } else {
                  for (var i = 0; i < $scope.model.tabs.length; i++) {
                     if ($scope.model.tabs[i].active == true) {

                        return i + 1;
                     }
                  }
               }

            }

And due to this issue the form turns empty without any fields, if we simply write $scope.api.getSelectedIndex in the server-side and return 1 it works fine .
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 3 guests