Property group adding with blank values
PostPosted:Tue Oct 21, 2014 9:54 am
by mohasinmujawar56
When we are adding property group and if we left all fields blank then also it the property group is getting added for that particular file or folder. I can show an error if the fields are empty but I am not able to prevent the property group from getting added. Can you please tell me what code to add and in which file it is to be added?
Re: Property group adding with blank values
PostPosted:Wed Oct 22, 2014 9:27 am
by jllort
Setting property groups goes with two steps. First add groups ( which adds all fields with blank value ) and second setting properties ( what also could be set blank ).
Take a look at the end of this wiki section about force setting properties,
http://wiki.openkm.com/index.php/Form_E ... escription
In you case I suggest think do some report to looking for empty fields ( add group and not set property group case ). Normally this is the right way to solve your problem.
Re: Property group adding with blank values
PostPosted:Thu Nov 13, 2014 2:18 pm
by yoan.penchev
You have to go to Administration > Metadata > Edit property group. For exaple you could use this code that works for me:
Code: Select all<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.0//EN"
"http://www.openkm.com/dtd/property-groups-2.0.dtd">
<property-groups>
<property-group label="Consulting" name="okg:consulting">
<input label="Name" type="text" name="okp:consulting.name"/>
<input label="Info" type="text" name="okp:consulting.info"/>
<input label="Date" type="date" name="okp:consulting.date" />
<checkbox label="Important" name="okp:consulting.important"/>
<textarea label="Comment" name="okp:consulting.comment"/>
</property-group>
<property-group label="Technology" name="okg:technology">
<select label="Type" name="okp:technology.type" type="multiple">
<option label="Alfa" value="t1"/>
<option label="Beta" value="t2" />
<option label="Omega" value="t3" />
</select>
<select label="Language" name="okp:technology.language" type="simple">
<option label="Java" value="java"/>
<option label="Python" value="python"/>
<option label="PHP" value="php" />
</select>
<input label="Comment" name="okp:technology.comment"/>
<textarea label="Description" name="okp:technology.description"/>
<input label="link" type="link" name="okp:technology.link"/>
</property-group>
</property-groups>