Date: Thu, 28 Mar 2024 17:03:32 +0200 (EET) Message-ID: <1025397639.1023.1711638212592@wiki.vertuna.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1022_1910709600.1711638212565" ------=_Part_1022_1910709600.1711638212565 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This is a quick demo on how you can reuse you ConfiForms configu= rations by creating user macros
Consider the following form, where the user can choose an option and if = an "other" option is selected then the text field is shown to capture the v= alue for the "other"
What we can do is to take out the 3 macros that define the fields and th= eir behaviour and create a user macro that can be reused whenever needed
We take out the storage format for these 3 macro and create a "cf-choice= s" macro like this
<= ;p> <ac:structured-macro ac:macro-id=3D"574fb50b-f05d-4fd6-bbaf-941028= cdd456" ac:name=3D"confiform-field-definition" ac:schema-version=3D"1"> <ac:parameter ac:name=3D"fieldName">choices</ac:parameter&= gt; <ac:parameter ac:name=3D"fieldLabel">Choices</ac:parameter= > <ac:parameter ac:name=3D"values">false[1=3Done|2=3Dtwo|3=3Dth= ree|4=3Dother|]</ac:parameter> <ac:parameter ac:name=3D"type">select</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id=3D"b355cde9-2e2c-4ffe-8c16-9d7a14= c05c0e" ac:name=3D"confiform-field-definition-rules" ac:schema-version=3D"1= "> <ac:parameter ac:name=3D"condition">!choices:4</ac:paramet= er> <ac:parameter ac:name=3D"fieldName">otherChoice</ac:parame= ter> <ac:parameter ac:name=3D"action">Hide field</ac:parameter&= gt; <ac:parameter ac:name=3D"actionFieldName">choices</ac:para= meter> <ac:parameter ac:name=3D"withReverseRule">true</ac:paramet= er> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id=3D"17ef6a3a-7550-402a-abb4-a6d814= 6ef8d3" ac:name=3D"confiform-field-definition" ac:schema-version=3D"1"> <ac:parameter ac:name=3D"fieldName">otherChoice</ac:parame= ter> <ac:parameter ac:name=3D"fieldLabel">What is you choice?</= ac:parameter> <ac:parameter ac:name=3D"type">text</ac:parameter> </ac:structured-macro> </p>
So, in the end the macro configuration for the user looks like this
<= /p>
See the online demo below