I am looking for clarification of best working practices regarding Server Connect Variables.
In this simple example I have about 12 Server Connect Components on the page, 7 of which have an Input Parameter/Variable "business_ID_var"
and there are 7 Modals, each has a different but similar role of updating or inserting an element of the business information.
Here is the variable...
<dmx-value id="business_ID_var" dmx-bind:value=""></dmx-value>
Here are the 7 Server Connect Components each with the same `dmx-param`...
<dmx-serverconnect id="people_q_detail" url="../dmxConnect/api/Admin-People/people_q_detail.php" dmx-param:people_id_getvar="people_ID_var.value" dmx-param:business_id_getvar="business_ID_var.value"></dmx-serverconnect>
<dmx-serverconnect id="business_address_sc" url="../dmxConnect/api/business_folder/business_address_actions.php" dmx-param:business_id_getvar="business_ID_var.value"></dmx-serverconnect>
<dmx-serverconnect id="business_details_sc" url="../dmxConnect/api/business_folder/business_details_actions.php" dmx-param:business_id_getvar="business_ID_var.value"></dmx-serverconnect>
<dmx-serverconnect id="business_people_sc" url="../dmxConnect/api/business_folder/business_people_actions.php" dmx-param:business_id_getvar="business_ID_var.value"></dmx-serverconnect>
<dmx-serverconnect id="business_comms_sc" url="../dmxConnect/api/business_folder/business_comms_actions.php" dmx-param:business_id_getvar="business_ID_var.value" dmx-param:var_comm_id="var_comm_id.value"></dmx-serverconnect>
<dmx-serverconnect id="business_principal_sc" url="../dmxConnect/api/business_folder/business_principal_actions.php" dmx-param:business_id_getvar="business_ID_var.value"></dmx-serverconnect>
<dmx-serverconnect id="sc_principals_reports_fees" url="../dmxConnect/api/business_folder/sa_principal_reports_fees.php" dmx-param:business_id_getvar="business_ID_var.value"></dmx-serverconnect>
I am finding that when I initiate one of the Modals using an <a>
tag like this
dmx-on:click="business_ID_var.setValue($value[0].business_id); mod_business_add_n_edit.show()"
that all of the Server Connect Components fire when only one is needed or associated to that Modal.
These Server Connect Components are used to populate the forms within the Modals. So one Server Connect Component required per Form per Modal.
In my head I am thinking that I should create a separate variable for each of the Server Connect Components like this
<dmx-value id="business_ID_var_people_detail" dmx-bind:value=""></dmx-value>
<dmx-value id="business_ID_var_address" dmx-bind:value=""></dmx-value>
<dmx-value id="business_ID_var_details" dmx-bind:value=""></dmx-value>
etc
Am I correct? Or should I be doing things in a different way?
Last updated: