Hello,
where can I find the XML code to add different Prepation form in each COT?
Thank you!
Anna
Hello,
where can I find the XML code to add different Prepation form in each COT?
Thank you!
Anna
Hi @Anna,
Thank you for your question!
If you’d like the Preparation form to change based which Collection Object Type (COT) is selected on the Collection Object (CO) form, you’ll need to create a conditional form.
The first step is to create the different preparation subview definitions for each COT. You can base your customized subviews off the existing definition in your database. I advise naming these with their associated COT after, e.g. “Preparation_Minerals”. This will help later on when adding the subviews to the conditions on the CO form.
Please let us know if you’d like help creating the custom subview definitions!
Once you have each preparation subview defined, you will create the conditional panel in your CO form definition. Add the panel just above your Preparations subview. Each condition should be based on the collectionObjectType field value, e.g., condition=collectionObjectType=Minerals.
Here is an example of the panel definition with conditional rendering based on the custom subviews shown above:
<row>
<cell type="panel" id="preparations" colspan="14">
<rows>
<!-- This view definition will be displayed in Specify 6, or if all other conditions don't match -->
<row>
<cell type="subview" viewname="Preparation" id="8" name="preparations" defaulttype="table" colspan="14" rows="3"/>
</row>
</rows>
<!-- This definition will only be displayed if COT is Geology-->
<rows condition="collectionObjectType=Geology">
<row>
<cell type="subview" viewname="preparations_Geology" name="preparations" colspan="14" rows="3"/>
</row>
</rows>
<!-- This definition will only be displayed if COT is Geology-->
<rows>
condition=collectionObjectType="Minerals"
<row>
<cell type="subview" name="preparations" viewname="preparations_Minerals" colspan="14" rows="3"/>
</row>
</rows>
</cell>
</row>
<row>