The following are two screen shots of Sapphire's
rendering of the "Outcome" property:
To a new user, it would appear that he/she has three
options for the Outcome field. I understand "None" option serves the purpose of
clearing user selection. But Sapphire already provides a way to do that. The red
"x" in front of None would turn into a "light bulb"(second image) if "Fixed
outcome" or "ToString()" is selected and it'd allow user to clear the
selection.
My proposal would be for Element property that has
"Required" annotation, we don't render "None", but rely on the "light bulb" to
clear user selection. When the selection hasn't been made or has been cleared,
turn the "light bulb" into red x for validation error.
Thanks,
Shenxue
The
“none” option serves the same purpose as being able to clear a text box for a
required value property. The end result may or may not be semantically valid
(controlled by @Required property), but the intermediary state could be valuable
to the user.
I
do not anticipate allowing individual control over this behavior. Either this
rendering is fine or we devise different means of achieving the same result
everywhere. If you (or anyone else for that matter) has ideas for a better
presentation, go ahead and open an enhancement request. Make sure that the
proposed presentation accounts for properties with/without @Required and
provides some means of clearing an element property even if it is required.
-
Konstantin
From:
sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On
Behalf Of Shenxue Zhou Sent: Monday, August 01, 2011 2:33
PM To: Sapphire project Subject: [sapphire-dev]
ElementProperty rendering
I have the following
element property:
@Type (
base = IMethodCallOutcome.class,
possible = {
IFixedOutcome.class,
IToStringOutcome.class
} ) @Label(
standard = "outcome" )
@XmlElementBinding (
path =
"outcome", mappings =
{
@XmlElementBinding.Mapping( element = "fixed-outcome", type =
IFixedOutcome.class
),
@XmlElementBinding.Mapping( element = "to-string", type = IToStringOutcome.class
) }
) @Required
ElementProperty PROP_OUTCOME = new ElementProperty( TYPE,
"Outcome" );
ModelElementHandle<IMethodCallOutcome>
getOutcome();
When this property is
rendered using Sapphire's "with" mechanism, the default style is to use radio
buttons. Besides the options for "fixed-outcome" and "to-string" types, Sapphire
UI also renders a "None" option. This is somewhat confusing to the users since
they might think "None" is a valid option for the outcome
property.
I wonder whether its
feasible to provide Sapphire users to not render the "None" option for
the element property?
|