Table des matières

SPECIFIC DATA

Goal

Each center needs to handle specific data concerning its activity.

Model

Specific data is saved in database, in the field named 'specifData', in json format

Example of a 'specifData' field content

  {
    "myField1": "value1", "myField2": "value2"
  }

View

QAP10 allows to personalize forms using an include mechanism of a sub file : a main page (directory [HOME_QAP10]/WebContent/appli/view/[group]/display) calls a sub page presents in [HOME_QAP10]/WebContent/local/view/[group]/display . For example for the equipment, QAP10 includes in the form page [HOME_QAP10]/WebContent/appli/Equipment/display/Equipment.jsp the sub file [HOME_QAP10]/WebContent/local/Equipment/display/Equipment.jsp

Syntax

In a sub file, add html code to personalize your page. If you need an input control, start its name with method specifData.get(), specifData.getBoolean(), specifData.getInteger()

  <!-- field 'toto' -->
  <tr>
    <td>my field 'toto'</td>
    <td><input type="text" name="qap10Specif_toto" value="%{specifData.get('toto')}"></td>
  </tr> 
  <!-- fields with struts tag -->
  <%@ taglib prefix="s" uri="/struts-tags"%>

  <!-- htmlt <select> -->
  <s:select
    name="qap10Specif_tata"
    value="%{specifData.get('tata')}"
    list="#{'':'?', 'bonjour':'bonjour', 'ciao':'ciao', 'hello':'hello'}"
  />
  
  <!--  example of a selection with values from the qap10's dictionary named for example **DICO_TEST** -->
  <s:select
    name="qap10Specif_titi"
    value="%{%{specifData.get('titi')}"
    list="%{mapBuilder.getMapDictionary('DICO_TEST')}" 
  />

for this last example, the saved value is the dictionary's raw value. Beware if you change this value in the dictionary, you will need to update the database manually

Notes