3.3 - Client-side Interactions
Overview:
When developing apps in the low code environment, you can separate your interactions into two main types - client side, and server side.
Where possible, your interactions should be client side, and only use server side for processing code that needs to be server side (such as database access, or secure API integration).
Client side interactions are what your users will be interacting with within your app, such as home screens, menus, jobs lists, etc, and these should be built in HTML, and controlled via external Javascript code.
Creating a Client Side Interaction:
To create a client side interaction, in the Interaction Manager, go to the “Manage” menu, and select “Interactions”.
This will list all of the interactions in your answerSpace.
To create a new one, select “Add”.
Name your interaction - keep in mind this is the name in the URL bar, so stick to standard alpha-numeric characters, and don’t use spaces.
For “Type”, select “Message”. A message interaction is a client side interaction.
Editing Your Interaction:
Once you’ve created an interaction, you will be viewing the Interaction page. Scroll down to the “Interaction Behavior” section. This is where where your code goes.
Click on the “Edit” button in the “Message” box. This will open a code editor where you can write your HTML or Javascript code.
jQuery is automatically available to you in both BIC2 and BIC3, and jQueryMobile events are also available to you in BIC3.
Note: While Javascript can be added to Message interactions, it is best practice to keep Javascript and HTML code separate. Ideally a Message interaction should contain HTML code only, and your Javascript should be included as an External Javascript File (as described in the previous topic, “Configuring answerSpaces”).
Save and View:
To Save your interaction, click the “Save” button. You can now view your changes as a web app.
To view your answerSpace, go to:
https://blinkm.co/myAnswerSpaceName
...where myAnswerSpaceName is the name of your answerSpace. If you haven’t yet set a Home interaction, then you should see a list of all of your new interactions, including the one you just created. Click on it to view the page.
Use the browser console to help debug any Javascript errors you may have.