Sequence Shortcuts [message #821510] |
Thu, 15 March 2012 13:06 |
|
I'm currently migrating an old Scout 1 application written in SQL Windows to the new Eclipse Scout. In the old application, sequences boxes in search forms offered a shortcut: if you filled out the "from" part and hit TAB, the value would be copied to the "to" part, such that if you wanted to search for a particular value, all you had to do was type the value into the "from" part and hit RET.
This no longer works. If you would like to experiment with this little user interface tweak, try this AbstractSequenceShortcutBox instead of the standard AbstractSequenceBox.
package com.bsiag.pista.client.ui.searchforms;
import org.eclipse.scout.commons.exception.ProcessingException;
import org.eclipse.scout.rt.client.ui.form.fields.IValueField;
import org.eclipse.scout.rt.client.ui.form.fields.sequencebox.AbstractSequenceBox;
public class AbstractSequenceShortcutBox extends AbstractSequenceBox {
@Override
protected <T extends Comparable<T>> void execCheckFromTo(IValueField<T>[] valueFields, int changedIndex) throws ProcessingException {
super.execCheckFromTo(valueFields, changedIndex);
if (changedIndex == 0
&& valueFields.length > 1
&& valueFields[1].isEmpty()) {
valueFields[1].setValue(valueFields[0].getValue());
}
}
}
This hooks into the checkFromTo functionality of sequence boxes. If you didn't disable the from-to check, chances are that the datatypes of the two fields are compatible enough for this assignment to work.
[Updated on: Thu, 15 March 2012 13:08] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04022 seconds