Hi DAW
I am moving a Web Application from 19.1 to 24.0 and I am running into a problem with the security layer. As per the sample example below. I have a button that's only available on mobile. So by default it's not rendered and has a responsive rule to render it on a mobile sized screen.
However when the button is rendered and I click the button I get the following error..
D:\Apps\DataFlex 24.0 Examples\WebOrder\Programs\WebApp.exe
Server Action Security Check Error Executing this web method 'ONCLICK' is not allowed by the target object 'oMobile_Button'.
DataFlex Error#: 4430 in line: 17309.
GET_HANDLEACTION (5779) - oMobile_Button (1976) - at address 17309
MSG_CALL_ACTION (5679) - oWebApp (22) - at address 21077
MSG_PROCESSREQUEST (5665) - oWebApp (22) - at address 16528
MSG_ONHTTPPOST (5631) - oWebServiceDispatcher (45) - at address 28635
MSG_ONHTTPREQUEST (5448) - oWebServiceDispatcher (45) - at address 15983
MSG_HANDLEHTTPREQUEST (5411) - oWebServiceDispatcher (45) - at address 16021
MSG_ONHTTPREQUEST (5448) - oVDFInetSession (24) - at address 14837
MSG_STARTWEBAPP (5655) - oWebApp (22) - at address 16380
[start] - at address 56970
When I check if it's rendered (using a WebGet), which the second button does, it's always false.
Code:
Use cWebView.pkg
Use cWebPanel.pkg
Use cWebForm.pkg
Object oSecuritytest is a cWebView
Set piWidth to 700
Set psCaption To "Security Test"
Set piColumnCount To 4
WebSetResponsive piColumnCount rmMobile To 2
Object oMobile_Button is a cWebButton
Set psCaption To "Mobile Button"
Set pbRender To False
WebSetResponsive pbRender rmMobile To True
Procedure OnClick
Send ShowInfoBox "Mobile Clicked"
End_Procedure
End_Object
Object oState_Button is a cWebButton
Set psCaption To "Render States"
Procedure OnClick
Boolean bRendered
WebGet pbRender Of oMobile_Button To bRendered
Send ShowInfoBox (SFormat("Rendered: %1", bRendered))
End_Procedure
End_Object
End_Object