Maintenance
Upgrading to V8
V8 Pre-upgrade Check Script
8 min
activate web forms are composed with a series of web controls all previous activate web controls were based on asp net webforms technology and have been completely rewritten in net core this technology rendered standard html + javascript to web browser and then posts back an html form to the server which then emulates events and binds the data into the job that is kept in session memory on the server the new controls render an xml document and a set of bindings to the client where the activate react client displays these controls for the user the controls update the data model and the client which is then submitted to a web service server events are not supported in this environment while every effort has been used to try and maintain compatibility this is sometimes not possible especially with a complete change of underlying architecture the following outlines the process for converting the forms deprecated controls the following controls are no longer supported true 330,331left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type \<selectmultipleprovisioningobjects id="selectmultipleprovisioningobjects1" activatebind="users" label="users"> \<controls> \<selectuser id="selectuser1" activatebind="" /> \</controls> \</selectmultipleprovisioningobjects> \<selectuser id="selectuser1" activatebind="users/user" multiple="1" /> \<customvalidator id="customvalidator1" /> public void form submit(object sender, eventargs a) { innovation activate web controls customvalidator val = (innovation activate web controls customvalidator)getcontrol("customvalidator1"); if(error) val errormessage = "please select at least one user to request information from " } v8 version public void form submit(activatehttprequest request) { if(error) { request page setpageerror( "please select at least one user to request information from "); } } \<activatewebgrid id="serv1" datasourceid="toptasks" height="300px" selecttype="none" title="top requests"> \</activatedatasource> \<activatedatasource id="toptasks" type="currenttoptasks" maxrows="10"> \<fileupload id="fileup" label="file to import" maxinputs="1" isrequired="true" activatebind=" fileup/item "> fileupload server events the previous asp net web form event handlers are no longer supported these event handlers were designed to make it easy for users coming from a desktop background to move to the web however, more modern techniques are now available these events are now handled during the form submit event the following is a form from v7 that has a click event that sends an email the highlighted sections are the event handlers that need to be changed \<?xml version="1 0" encoding="utf 16"?> \<webform> \<panel width="100%" form load="form load" form submit="form submit"> \<controls> \<ribbonpanel> \<controls> \<ribbongroup text="email"> \<controls> \<ribbonbutton link="/" click="onsend" text="send" imageurl="mail"> \</ribbonbutton> \</controls> \</ribbongroup> \</controls> \</ribbonpanel> \<break id="break1" /> \<textbox id="txtemail" label="email address" width="800px" text="=/user/emailaddress" /> \<textbox id="txtsubject" label="subject" width="800px" text="=eval(=//job, \"\")" /> \<htmleditor id="txtbody" label="message" width="800px" html="=eval(=//job, \"\")" /> \</controls> \</panel> \<serverscript> \<text>\<!\[cdata\[using system; using system web ui; using innovation activate; using innovation activate utilities; using innovation activate web; using innovation activate forms xaml; using innovation activate web controls; class script webformscript { public void form load(object sender, eventargs e) { } public void form submit(object sender, eventargs a) { } public void onsend(object sender, menulinkclienteventargs a) { textbox txtemail = (textbox)getcontrol("txtemail"); textbox txtsubject= (textbox)getcontrol("txtsubject"); htmleditor txtbody = (htmleditor)getcontrol("txtbody"); mailutilities sendemail(txtemail text, txtsubject text, txtbody html); webutils gotoreturnpage(); } } ]]>\</text> \</serverscript> \</webform> the new version based on v8 \<?xml version="1 0" encoding="utf 16"?> \<webform> \<panel width="100%" form load="form load" form submit="form submit"> \<ribbonpanel> \<ribbongroup text="email"> \<ribbonbutton id="btnsend" text="send" imageurl="mail"> \</ribbonbutton> \</ribbongroup> \</ribbonpanel> \<break id="break1" /> \<textbox id="txtemail" label="email address" width="800px" text="=/user/emailaddress" activatebind="email/emailaddress" /> \<textbox id="txtsubject" label="subject" width="800px" text="=eval(=//job, \"\")" activatebind="email/subject" /> \<htmleditor id="txtbody" label="message" width="800px" html="=eval(=//job, \"\")" activatebind="email/body" /> \</panel> \<serverscript> \<text>\<!\[cdata\[using system; using innovation activate; using innovation activate utilities; using innovation activate web; using innovation activate forms xaml; using activate web controls; using innovation activate web controls; class script webformscript { public void form load(object sender, eventargs e) { } public void form submit(activatehttprequest request) { if (request iseventsource("btnsend")) { string email = job arguments getstring("email/emailaddress"); string subject = job arguments getstring("email/subject"); string body = job arguments getstring("email/body"); mailutilities sendemail(email,subject, body); page returntopreviouspage("email sent"); } } } ]]>\</text> \</serverscript> \</webform> explanation ribbonbutton removed click="" handler this property could be left but would not do anything added an 'id' this id is used to identify what button was clicked on the server form submit now returns a value this value tells the system what the result of the action is for example, valid return results could be set a page error and return return page defaultaction(); return page nextpage(); can have an activatehttprequest object as a parameter the activatehttprequest object allows access to information about the request the previous form submit arguments are still valid and will still work the request object can be obtained from page request form submit(object sender, eventargs a) { page request } control bindings the 'controls' are no longer available during a form submit instead, all values must be bound into the job the script can then read these values from the job the form submit could update the job with information and then regenerate the form by returning page defaultaction();