1. I
like to add a validation to the ElementProperty. The closest one I found was
ModelPropertyValidation, but obviously that's for a model property.
[kosta] I think you
mean ModelPropertyValidationService. That applies to all types of properties.
Attach it to a property using @Service annotation.
Thanks, but the error marker did
not appear even though I returned an error status. I will open a bug.
2. My
list of options range from 2 to 11. How to specify "prefer.combo"
hint.
[kosta] If you use
the sdef editor, it will help you write the hints.
Didn't find any hint in the
sdef editor for <with> construct. I see that SapphireWithDirective.java
always creates radio buttons.
3. In
the IStudentOccupation model, let say I added a Grade ElementProperty. I would
like that ElementProperty to be shown when the user selects "student". How can I
achieve that in the definition file? I was able to add a condition to show only
when "student" was selected. But in order to get to the Grade ElementProperty, I
had to add the following, is there a way to hide the radio button
group?
<with>
<path>PrimaryOccupation</path>
<panel>
<key>IStudentOccupation</key>
<content>
<with>
<path>Grade</path>
[kosta] Perhaps you
need ImpliedElementProperty instead of ElementProperty (explicit kind)? The
difference between the two is that for implied element property, the child
element always exists (it doesn’t need to be created and cannot be deleted). If
you <use> with construct on an implied element property, you will not see
any extra controls to control child element creation and existence. If it is an
explicit element property, then you will see either a checkbox or radio buttons
group.
As a workaround I will duplicate
the IStudentOccupation as an ImpliedElementProperty. I will give that a try.
Thanks!
From:
sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On
Behalf Of Ling Hao
Sent: Friday, April 22, 2011 3:58
PM
To: Sapphire project
Subject: [sapphire-dev] Sapphire
questions
My model
is very similar to IContact's PrimaryOccupation element property in the
sample.
1. I
like to add a validation to the ElementProperty. The closest one I found was
ModelPropertyValidation, but obviously that's for a model property.
2. My
list of options range from 2 to 11. How to specify "prefer.combo"
hint.
3. In
the IStudentOccupation model, let say I added a Grade ElementProperty. I would
like that ElementProperty to be shown when the user selects "student". How can I
achieve that in the definition file? I was able to add a condition to show only
when "student" was selected. But in order to get to the Grade ElementProperty, I
had to add the following, is there a way to hide the radio button
group?
<with>
<path>PrimaryOccupation</path>
<panel>
<key>IStudentOccupation</key>
<content>
<with>
<path>Grade</path>
Thanks!