Servoy 8.2 RC1 : can't show form because it is not allowed

Forum to discuss the new web client version of Servoy.

Servoy 8.2 RC1 : can't show form because it is not allowed

Postby robrecht » Thu Aug 10, 2017 11:28 am

Hi,

After running our code in Servoy 8.2 RC1 this error comes
We were told our custom components might be broken due to update angular files; has this error something to do with that?
The notification "...because it is not allowed in the client..." is new to me

Thanks

2017-08-10 11:22:42,744 ERROR [Executor,uuid:6f5280b2-889b-403b-b3b1-0d10930594ab] org.sablo.websocket.WebsocketEndpoint - Error: Can't show form ng$demo_dashboard for component + <data-globtecdevexcomponents-Bread-Crumb-Main name="breadcrumb_main" svy-model="model.breadcrumb_main" svy-api="api.breadcrumb_main" svy-handlers="handlers.breadcrumb_main" svy-servoyApi="handlers.breadcrumb_main.svy_servoyApi"></data-globtecdevexcomponents-Bread-Crumb-Main> [ ]

> java.lang.IllegalAccessException: Can't show form ng$demo_dashboard for component + <data-globtecdevexcomponents-Bread-Crumb-Main name="breadcrumb_main" svy-model="model.breadcrumb_main" svy-api="api.breadcrumb_main" svy-handlers="handlers.breadcrumb_main" svy-servoyApi="handlers.breadcrumb_main.svy_servoyApi"></data-globtecdevexcomponents-Bread-Crumb-Main>
at com.servoy.j2db.server.ngclient.NGClientWindow.isVisibleAllowed(NGClientWindow.java:217)
at com.servoy.j2db.server.ngclient.NGFormServiceHandler.executeMethod(NGFormServiceHandler.java:214)
at org.sablo.websocket.WebsocketEndpoint$5.run(WebsocketEndpoint.java:333)
at org.sablo.eventthread.Event$1.run(Event.java:100)
at org.sablo.websocket.CurrentWindow.runForWindow(CurrentWindow.java:77)
at org.sablo.eventthread.Event.execute(Event.java:90)
at org.sablo.eventthread.EventDispatcher.dispatch(EventDispatcher.java:125)
at org.sablo.eventthread.EventDispatcher.run(EventDispatcher.java:89)
at com.servoy.j2db.server.ngclient.eventthread.NGEventDispatcher.run(NGEventDispatcher.java:55)
at java.lang.Thread.run(Thread.java:745)

2017-08-10 11:22:42,746 ERROR [Executor,uuid:6f5280b2-889b-403b-b3b1-0d10930594ab] org.sablo.websocket.WebsocketEndpoint - Error: Can't show form: ng$demo_dashboard because it is not allowed in the client [ ]
robrecht
 
Posts: 99
Joined: Wed Aug 01, 2012 4:30 pm

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby jcompagner » Thu Aug 10, 2017 11:43 am

don't think it is that
You have your own components?
Are those component showing forms itself?

How are those exactly configured? Do you have an example?

Because this is hitting a security feature that a component can't just show any form it wants, that must be configured correctly on the server (like a form property that has that form assigned)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby robrecht » Thu Aug 10, 2017 12:18 pm

We have own components indeed and the "bread-crumb-main" is showing some forms.
This ng$demo_dashboard is being shown by the breadcrumb component, with a function :

Code: Select all
function setRealContainedForm(formname, relationname) {
               if (formWillShowCalled != formname && formname) {
                  formWillShowCalled = formname;
                  if ($scope.model.waitForData) {
                     $q.when($scope.svyServoyapi.formWillShow(formname, relationname)).then(function() {
                        realContainedForm = formname;
                     });
                  } else {
                     $scope.svyServoyapi.formWillShow(formname, relationname);
                     realContainedForm = formname;
                  }
               }
            }


We show different kinds of forms but have not specified any permissions or restrictions. Where on server do you mean we should configure this ?
robrecht
 
Posts: 99
Joined: Wed Aug 01, 2012 4:30 pm

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby jcompagner » Thu Aug 10, 2017 1:52 pm

can you show me the spec file of that component?

i guess the parameter "formname" is of property "form" ?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby robrecht » Thu Aug 10, 2017 1:59 pm

it is called form here in the spec file

Code: Select all
"model":
   {
         "tabs":  {"type":"tab[]", "pushToServer": "allow","droppable":true},
         "styleClass" : { "type" :"styleclass"},
         "height" : {"type":"int", "default":"500"},
         "tabSeq" : {"type" :"tabseq", "tags": { "scope" :"design" }},
         "isLoaded":{"type":"boolean","default":true},
          "visible" : "visible",
          "tabtype" : {"type":"string", "default":"normal"}
   },"handlers":
   {

   },
   "api":
   {
      "addTab": {
         "parameters": [
            { "name": "form", "type": "form" },
            { "name": "nameArg", "type": "string"},
            { "name": "tabText", "type": "string"},
            { "name": "tooltip", "type": "string"},
            { "name": "iconURL", "type": "string"},
            { "name": "fg", "type": "string"},
            { "name": "bg", "type": "string"},
            { "name": "relation", "type": "relation"},
            { "name": "index", "type": "int"}
            
         ]
      },
      "removeTabAt":{
         "parameters": [
            { "name": "index", "type": "integer" }
         ]
      },
      "removeAllTabs":{},
      "getMaxTabIndex":{"returns":"integer"},
      "getTabFormNameAt":{
         "returns":"form",
         "parameters": [
            { "name": "index", "type": "integer" }
         ]
      },
      "getTabNameAt":{
         "returns":"form",
         "parameters": [
            { "name": "index", "type": "integer" }
         ]
      },
      "getTabRelationNameAt":{
         "returns":"relation",
         "parameters": [
            { "name": "index", "type": "integer" }
         ]
      },
      "getTabTextAt":{
         "returns":"string",
         "parameters": [
            { "name": "index", "type": "integer" }
         ]
      },
      "isTabEnabledAt":{
         "returns":"boolean",
         "parameters": [
            { "name": "index", "type": "integer" }
         ]
      },
      "setTabEnabledAt":{
         "parameters": [
            { "name": "index", "type": "integer" },
            { "name": "enabled", "type": "boolean" }
         ]
      },
      "setTabTextAt":{
         "parameters": [
            { "name": "index", "type": "integer" },
            { "name": "text", "type": "tagstring" }
         ]
      },
      "setTabType":{
         "parameters": [
            { "name": "tabtype", "type": "string" }
            
         ]
      },
      "setTab":{
         "parameters": [
            { "name": "index", "type": "integer" }
         ]
      },
      "getSelectedIndex":{
         "returns":"integer"
      }
   },
   "types": {
      "tab": {
         "active": {"type":"boolean","default": false,"tags": { "scope" :"private" }},
         "name": {"type":"string"},
         "containedForm": "form",
        "text": {"type":"tagstring","default":"tab"},
        "relationName": "relation",
           "enabled":
      {
         "type": "enabled",
         "default": true
         
      }
        
        }
   }
robrecht
 
Posts: 99
Joined: Wed Aug 01, 2012 4:30 pm

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby jcompagner » Thu Aug 10, 2017 2:16 pm

and i guess addTab api calls the above function.

In servoy itself those are all server side scripting calls that just adjust the model
But i guess it doesn't really register correctly the relation and form name if they are direct parameters of an api call that is really getting to that on the client

Can you make a case for this
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby robrecht » Wed Aug 16, 2017 2:48 pm

Hi Johan,

Is it ok to just refer to this topic in the case ?
I don't know how to build a demo solution without giving our components in them, and maybe servoy developers now enough with your explanation?

Robrecht
robrecht
 
Posts: 99
Joined: Wed Aug 01, 2012 4:30 pm

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby jcompagner » Wed Aug 16, 2017 8:25 pm

Yes that is ok. I hope we can reproduce it then
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby jcompagner » Thu Aug 17, 2017 12:13 pm

just tried to reproduce it and i couldn't
it is working fine for me so you have to give us an example what is going wrong

i made an example:

Code: Select all
"api":
   {
        "addTab": {
               "returns": "boolean",
            "parameters":[
                        {                                                                 
                        "name":"form/formname",
                        "type":"form"
                            },
                            {                                                                 
                        "name":"relatedfoundset/relationname",
                        "type":"relation",
                           "optional":true
                           }             
                      ]
               }
     }


with that as an api

then

Code: Select all
$scope.api.addTab = function(form,relation) {
            $scope.svyServoyapi.formWillShow(form, relation);
            $scope.svyServoyapi.getFormUrl(form);
            console.log(form + " :: " + relation)
           formName = form;
           $scope.model.yourName = form + " :: " + relation;
         }


showing that and calling onshow and getFormUrl didn't result in an exceptions
and i could also show the form just fine

Code: Select all
<div ng-include="getForm()"/>

$scope.getForm = function() {
            return $scope.svyServoyapi.getFormUrl(formName);
         }
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby robrecht » Thu Aug 17, 2017 3:01 pm

Ok thanks for your effort
We will build a sample solution and make a case with it.
robrecht
 
Posts: 99
Joined: Wed Aug 01, 2012 4:30 pm

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby jasantana » Tue May 22, 2018 11:05 am

Morning.

Any news on this issue. We are facing the same here.

Cheers
Best regards,
Juan Antonio Santana Medina
jasantana@nephos-solutions.co.uk
Servoy MVP 2015
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 555
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: Servoy 8.2 RC1 : can't show form because it is not allow

Postby jcompagner » Tue May 22, 2018 12:17 pm

what exact thing?

do you have your own components? (that are showing forms?)

what do you exactly get when you do what?

This is already pretty old post
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 5 guests

cron