The HTML help is created from the Word document by exporting it to HTML from Microsoft Word:
WEB-INF/resources/apps/exist/ibd/standard-rfp/bookmarks.doc
. This file is not used by the application but stored in that directory for convenience. Update the file as needed. word.doc
. If you change the name of a Word field, also change in word-fields.xml
(always in the same directory) the name
attribute for that field. help.html
in the same directory. <object
classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object> and remove it. This is to prevent a warning on IE.
The help for some fields sometimes need too point to a different bookmark depending on some condition. For instance, there is a field that corresponds to the country of which laws have jurisdiction over the contract. The help for this field differs depending on the type of contract.
In the UI (XForms), we want to have just one field (i.e. one XForms control). The XForms control is mapped to a field name in the Word document through word-fields.xml
. If there are multiple fields with the same name in the Word document, they will be all replaced by the value entered in the XForms control.
The help for this field, depending on the currently selected type of contract, needs to:
help-xy.html
. Let's first see how to do point number 1. For most controls, the help bookmark name is the same as the field name. But it can be different. Here is an example of the markup that you can have in word-fields.xml
:
<mergefield name="Contract_Signature_Day" xref="Contract/Signature/Day"> <help if="ContractType = '1'" bookmark="Contract_Signature_Day_1"/> <help if="ContractType = '2'" bookmark="Contract_Signature_Day_2"/> </mergefield>
If those help
elements are present, when users click on the help icon each one of the if
expression will be evaluated, and the bookmark
for the first one that succeeds will be used.
In the resource files (form-resources-en.xml
and form-resources-es.xml
) instead of having just one <help>
, you create a second one and add an attribute on the <help>
elements to differentiate them. In the example that follows, the attribute contract-type
has been added.
<estimate-foreign-currency> <label>Consultant's remuneration ceiling in foreign currency</label> <hint>Insert amount and currency [Example: one hundred thousand pacific dollars (100.000)]</hint> <help contract-type="1">See paragraph 6.1 (b)</help> <help contract-type="2">See paragraph 6.2</help> </estimate-foreign-currency>
Then edit the corresponding XForms control. In that control, the help would normally read:
<xforms:help ref="$form-resources/estimate-foreign-currency/help"/>
Since there are now multiple <help>
, you need to indicate which one to choose. To select the one that has an attribute contract-type
equal to the currently selected contract, write (if you wish, you can put the two lines that follow on just one line):
<xforms:help ref="$form-resources/estimate-foreign-currency/help [@contract-type = instance('fr-form-instance')/ContractType]"/>