Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » ValueField, NumberField, DecimalField(Can they be used?)
ValueField, NumberField, DecimalField [message #1003560] Mon, 21 January 2013 14:16 Go to next message
Urs Beeli is currently offline Urs Beeli
Messages: 335
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Am I right in assuming that ValueField, NumberField, DecimalField are abstract fields that implement functionality common to several other fields extending them and are not intended to be used on forms, even though that can be chosen in the SDK?

NumberField and DecimalField seem to (more or less) correctly display data associated with them, but validation does not work and only returns "Not implemented" as error message. ValueField doesn't even seem to be implemented on the UI, there is only a placeholder shown.
Re: ValueField, NumberField, DecimalField [message #1003861 is a reply to message #1003560] Tue, 22 January 2013 06:33 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 771
Registered: October 2011
Senior Member
I think you have identified a very interesting fact.

From a Java point of view there is no difference between in the class declaration of a:

* StringField:
public abstract class AbstractStringField extends AbstractValueField<String> implements IStringField {
}


* ValueField:
public abstract class AbstractValueField<T> extends AbstractFormField implements IValueField<T> {
}


* AbstractDoubleField
public abstract class AbstractDoubleField extends AbstractDecimalField<Double> implements IDoubleField {
}


* AbstractDecimalField
public abstract class AbstractDecimalField<T extends Number> extends AbstractValueField<T> implements IDecimalField<T> {
}


But some of this class have a renderer in the UI and some have not.

All this classes are abstract, but as you have figured out some of them only mutualize code for the children class (AbstractValueField or AbstractDecimalField).

On the other side, DateTimeField is just a convenience class for DateField (see this topic): Both can be instantiated.



I think that in 99% of the cases, AbstractValueField or AbstractDecimalField classes should not be included directly in a form. This is not a good practice.

Feel free to provide inputs for improvements (SDK, Check-style...). It is very interesting to get this kind of feed-back.
Re: ValueField, NumberField, DecimalField [message #1003898 is a reply to message #1003861] Tue, 22 January 2013 07:51 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 335
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Thanks for confirming about the mutualisation classes.

I understand that all abstract classes are offered in the SDK when adding a new form field. I think for a user who has worked a little with Scout, having some classes being shown that do not have an UI renderer is not a problem, though it might be a little confusing for a beginner who is experimenting and "trying out" each field that is being offered to see what it does.

I cannot judge how much effort it would take to filter out classes without UI renderers to not be shown, but doubt that it will be worth it. A brief mention explaining the above on http://wiki.eclipse.org/Scout/Concepts/Field would be a good idea, though. As theses classes were not listed on the concept page, I wasn't sure if it was because the page was incomplete or because the classes were not to be used. A short sentence telling readers about these mutualisation classes and not using them in forms should be enough, I think.
Re: ValueField, NumberField, DecimalField [message #1003910 is a reply to message #1003898] Tue, 22 January 2013 08:09 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 771
Registered: October 2011
Senior Member
I have added a important box in the description:
http://wiki.eclipse.org/Scout/Concepts/ValueField

Feel free to improve it...

Re: ValueField, NumberField, DecimalField [message #1003960 is a reply to message #1003910] Tue, 22 January 2013 10:26 Go to previous message
Urs Beeli is currently offline Urs Beeli
Messages: 335
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Thanks, I've added the two other such fields in your note.
Previous Topic:Embedding an existing form in another form
Next Topic:custom table
Goto Forum:
  


Current Time: Fri Oct 31 06:35:43 GMT 2014

Powered by FUDForum. Page generated in 0.02436 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software