|
|
Re: SmartField autoselection if only one choice is available [message #1084984 is a reply to message #1084966] |
Mon, 12 August 2013 09:37 |
Jeremie Bresson Messages: 1252 Registered: October 2011 |
Senior Member |
|
|
daniele fochetti wrote on Fri, 09 August 2013 15:49In my application the lookup data for the same smartfield might contain one to multiple entries.
In the current application version I allways have to select the desired value from the dropdown list, no matter if there is only one entry or many.
In case of only one entry, I want the value beeing selected/shown automatically when I enter the empty smartfield.
Is there a way to implement such a behavior by using standard scout functionality?
Thanks for your interest in Scout.
I am afraid there is no standard functionality that is doing exactly what you describe out of the box. I hope we can manage to find something you can work with.
daniele fochetti wrote on Mon, 12 August 2013 11:14Found so far AbstractSmartField.setUniquelyDefinedValue(boolean background) which seems to suit my needs.
Nice catch, I was'nt aware of this method.
ISmartField.setUniquelyDefinedValue(boolean) is in the model, you can call it from your form, when the value of another field changes.
daniele fochetti wrote on Mon, 12 August 2013 11:14
Still the question is, how can this method be invoked while entering the SmartField. Do I have to write my own 'extended' SwtScoutSmartField to override 'handleSwtFocusGained()'?
I think that the biggest problem is that the model doesn't know when the user enters a field.
SwtScoutSmartField is the rendering code that renders the model (SmartField class extending ISmartField). I do not know patterns where we call model methods from the UI rendering code.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07028 seconds