I am having trouble getting the collecting trip attachment button to appear on the collecting trip form in Specify7. I’ve put this in the view def on a new line but it doesn’t seem to work.
Any suggestions?
I am having trouble getting the collecting trip attachment button to appear on the collecting trip form in Specify7. I’ve put this in the view def on a new line but it doesn’t seem to work.
Any suggestions?
Hi @Plarson,
I have this button appearing properly using the following components in my form definition:
Views:
First, you must have an accompanying <view>
for each <viewdef>
<view name="CollectingTripForm"
class="edu.ku.brc.specify.datamodel.CollectingTrip"
busrules="edu.ku.brc.specify.datamodel.busrules.CollectingTripBusRules"
isinternal="false"
resourelabels="false">
<desc><![CDATA[CollectingTrip Form]]></desc>
<altviews>
<altview name="CollectingTripForm View" viewdef="CollectingTripForm" mode="view" default="true"/>
<altview name="CollectingTripForm Edit" viewdef="CollectingTripForm" mode="edit"/>
</altviews>
</view>
<view name="CollectingTrip"
class="edu.ku.brc.specify.datamodel.CollectingTrip"
busrules="edu.ku.brc.specify.datamodel.busrules.CollectingTripBusRules"
resourelabels="false">
<desc><![CDATA[CollectingTrip Form]]></desc>
<altviews>
<altview name="CollectingTrip View" viewdef="CollectingTrip" mode="view" default="true"/>
<altview name="CollectingTrip Edit" viewdef="CollectingTrip" mode="edit"/>
</altviews>
</view>
View definition:
<viewdef
type="form"
name="CollectingTripForm"
class="edu.ku.brc.specify.datamodel.CollectingTrip"
gettable="edu.ku.brc.af.ui.forms.DataGetterForObj"
settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
<desc><![CDATA[CollectingTrip Form]]></desc>
<columnDef>100px,2px,211px,5px,120px,2px,130px,5px,120px,2px,130px,0px,15px,p:g</columnDef>
<columnDef os="lnx">115px,2px,276px,5px,145px,2px,110px,5px,145px,2px,110px,0px,15px,p:g</columnDef>
<columnDef os="mac">130px,2px,296px,5px,165px,2px,130px,5px,165px,2px,130px,0px,15px,p:g</columnDef>
<columnDef os="exp">p,2px,p:g(2),5px:g,p,2px,p:g(2),5px:g,p,2px,p:g(2),0px,15px,p:g</columnDef>
<rowDef auto="true" cell="p" sep="2px"/>
<rows>
<row>
<cell type="label" labelfor="1"/>
<cell type="field" id="1" name="text1" uitype="text"/>
<cell type="label" labelfor="7"/>
<cell type="field" id="7" name="text2" uitype="text"/>
<cell type="label" labelfor="2"/>
<cell type="field" id="2" name="number1" uitype="text"/>
</row>
<row>
<cell type="label" labelfor="5"/>
<cell type="field" id="5" name="remarks" uitype="textareabrief" colspan="10"/>
</row>
<row>
<cell type="subview" id="attachments" viewname="ObjectAttachment" name="collectingTripAttachments" colspan="3" initialize="btn=true;icon=CollectingTripAttachment"/>
</row>
<row>
<cell type="subview" id="3" name="collectingEvents" viewname="CollectingEventSub" colspan="13"/>
</row>
</rows>
</viewdef>
If you are having any trouble after seeing this example, please share your view definition with us so that I can take a closer look!
Thank you!
Grant
Got it, thanks! The problem was that I only had one of the views.