Personal tools

Log in

Changes

From All n One's bxp software Wixi

Jump to: navigation, search

AJAX - Start Here

322 bytes removed, 08:15, 31 August 2016
→‎Functions Available (Reference Information)
== Overview ==
== How it works =Functions Available (Reference Information) =
As part of the functionality there are a number of predefined functions. These are set in aryAjax_Settings[[File:AJAXoperation001.png]16]
# When you log into bxp and start a form, the page will draw based on the Form (Web Page is built on Form 1).# As part of the code of the page you can include AJAX functionality into the formfunctions are detailed, done through the Advanced Settings > JavaScript onLoad. (AJAX is drawn into the page.)# When the page is executed in the clients browser, the AJAX can be activated and it works through please use the BEAPI to access data in any number of formslinks where available for further details.
== Array of Parameters Listing (Displays) ==
A full listing is available here [[AJAX_-_Full_Array_of_Paramters]]
{| class="wikitable"|-! style= Functions Available "width:20%" | Function! style="width:40%" | Link! style="width:40%" | Description|-| Table || [[AJAX_-_Function_-_Table]] || Draws a listing of records from another form facilitating passed parameters. e.g. List contacts in a table in company form.|-| LiveSearch || [[AJAX_-_Function_-_LiveSearch]] || The ability to put a single row of data with the ability to put a custom function on the button.|-| LiveSearchTable || [[AJAX_-_Function_-_Live_Search_Table]] || An extension of the LiveSearch function but displays the data in a table format, rather than one string.|-| LiveSearchKeyStatData || [[AJAX_-_Function_-_LiveSearchKeyStatData]] || Return of data in a delimited string suitable for use in the KeyStats module. |}
As part of the functionality there are a number of predefined functions. These are set in aryAjax_Settings[16]
As the == Lookup functions are detailed, please use the links where available for further details.==
{| class="wikitable"
|-
! style="width:20%" | Function! style="width:40%" | Link! style="width:40%" | Description
|-
| Append || [[AJAX_-_Function_-_Append]] || Lookup data from a form and append it to data in a field in the current form
|-
| dbDeleteRecord Insert || [[AJAX_-_Function_-_Insert]] || Lookup data from a form and insert it into a field in the current form
|-
| dbInsertRecord InsertCount || [[AJAX_-_Function_-_InsertCount]] || Lookup a summative count of records from a form and insert the counted amount into a field in the current form
|-
| dbUpdateRecord Populate || [[AJAX_-_Function_-_Populate]] || Wipes a drop down list then populates the contents of the drop down list with values from another form. Text and value of the drop down list will be the same.
|-
| Insert Populate_AltList || [[AJAX_-_Function_-_Populate_AltList]] || Wipes a drop down list then populates the contents of the drop down list with values from another form. Text and value of the drop down list can be populated with different values.
|-
| InsertCount PopulateNoClear || [[JavaScript_AJAX_FunctionsAJAX_-_Function_-_PopulateNoClear]] || Adds to the contents of a drop down list with values from another form. Text and value of the drop down list will be the same.
|-
| LiveSearch PopulateNoClear_AltList || [[JavaScript_LiveSearchAJAX_-_Function_-_PopulateNoClear_AltList]] || Adds to the contents of a drop down list with values from another form. Text and value of the drop down list can be populated with different values.|-}  == Record Management ==  {| LiveSearchTable || [[Java_Script_Live_Search_Table]]class="wikitable"
|-
! style="width:20%" | LiveSearchKeyStatData Function! style="width:40%" |Link! style="width:40%" | Returns the LiveSearch data as KeyStat formatted dataDescription
|-
| Populate dbDeleteRecord || [[JavaScript_Populate_Drop_Down_List_from_another_CampaignAJAX_-_Function_-_dbDeleteRecord]] || To allow the deletion of a CDA record from another form.|- | dbInsertRecord || [[AJAX_-_Function_-_dbInsertRecord]] || To allow the insertion of a CDA record into another form.
|-
| Populate_AltList dbUpdateRecord || [[JavaScript_AJAX_FunctionsAJAX_-_Function_-_dbUpdateRecord]] || To allow the update of a CDA record in another form.
|-
| PopulateNoClear ||
|-
| PopulateNoClear_AltList ||
|-
| Table ||
|}
== Solutions =How it works =
It is possible to build entire solutions using AJAX[[File:AJAXoperation001.png]]
* [[JavaScript_Self-Referencing_Campaigns]]
* [[JavaScript_-_Interactive_Record_Locking]]# When you log into bxp and start a form, the page will draw based on the Form (Web Page is built on Form 1).# As part of the code of the page you can include AJAX functionality into the form, done through the Advanced Settings > JavaScript onLoad. (AJAX is drawn into the page.)* [[Java_Script_Hospital_Red_Green]]# When the page is executed in the clients browser, the AJAX can be activated and it works through the BEAPI to access data in any number of forms.
One useful concept that AJAX can facilitate is Centralised Listing [[Centralised_Listing]]
= Array of Parameters =
== Security ==A full listing is available here [[AJAX_-_Full_Array_of_Paramters]]
Security is very important to bxp and BEAPI calls should be no less secure. For this reason there are a number of security concepts to be considered.
== Solutions ==
The AJAX makes calls to the BEAPI, hereto referred to as "The Call". When the Call is made, it requires a username and password. That user must have access to the form. In using the AJAX there are two possible options.
# Use a set username and password# Use a dynamic username and passwordIt is possible to build entire solutions using AJAX
* [[JavaScript_Self-Referencing_Campaigns]]
The set username and password is more secure but must have specified white listed IP addresses it can be used from. The user must be granted access to the form containing the data. This also allows this user to have all functional access removed but still allow content access. This is the more secure preferred option.* [[JavaScript_-_Interactive_Record_Locking]]
* aryAjax_Settings[0] = "client_demo"; * aryAjax_Settings[1Java_Script_Hospital_Red_Green] = "demo"; * aryAjax_Settings[2] = "password";
Set user location One useful concept that AJAX can be difficult to manage if users move location often or there facilitate is no static IP address available. There is a dynamic security setting, which requires the current user to have access to the form, but the engine uses the current users login, to access the form.Centralised Listing [[Centralised_Listing]]
* aryAjax_Settings[22] = document.getElementById('intSystemGenerated_CompanyId').value;
* aryAjax_Settings[23] = document.getElementById('intSystemGenerated_UserId').value;
* aryAjax_Settings[24] = document.getElementById('intSystemGenerated_LoginKey').value;
The Call is made using a secure HTTP Post using form variables and not querystring parameters. This provides maximum security for the data being sent.  The error code will return 0 for success and the following codes for errors.== Security ==
* -1 = No settings initialised. Please set the settings on your page.* -2 = Settings not initialised. Please set the settings on your page.* -3 = Settings cannot be blank. Please check the settings on your page.* -4 = Server response not formatted correctly. <br />Please refresh the page and try again. <br />Error Code This is further detailed here [ " + aryAjax_Settings[3] + " AJAX_- " + aryAjax_Settings[5_Security_engine] + " ]* -5 = No data fields specified. Please set the settings on your page.* -6 = No display fields specified. Please set the settings on your page.* -7 = AJAX transport failure. Please refresh the page and try again.* -8 = AJAX initialisation failure. Please refresh the page and try again.
There is often error messages to display when using the engine for a variety of reasons including: incorrect username, password, IP address restricted, etc.  For this reason, it is possible to write back to screen the error messages into a user specified div. You create the div more indepth discussion on your form where you like it and put id="" in it.this area [[AJAX_-_Error_messages_and_troubleshooting]]
If you set aryAjax_Settings[15] = 'divYourName'; then the error messages will write to the innerHTML of the div.
[[Category:Topic:JavaScript]]
[[Category:Topic:Start Here]]
7,528
edits