GWT: x.x, Edition, allow user enter the page number to display a specific page of an edition
- replace the page ID label with an editable text field
-
set field character length to 5 and don’t enforce value length(MD: setEnforceLength is not available in current SmartGWT library) - On escape event: abort and reset the field value
- On return event:
- check if page exists
- No: display an error messagev in status line
- after 5 tries, show the error message in a dialog box
- Yes: Go to the page
- No: display an error messagev in status line
- check if page exists
Test protocol
- open Graal edition
- type in the page number field “190b” and Enter
- the page 190b is displayed
- type “z190b”
- the page z190b (from the Z manuscript) is displayed
- type “999” (not existing page)
- error message is displayed, the wrong number is still displayed, the page displayed does not change
- re-type Enter four more times
- another error message is displayed, the page number is reset to the one of the page being displayed
- type another wrong page number “xxx”
- error message is displayed
- type Escape
- the page number is reset to current
note: see http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/form/fields/TextItem.html setEnforceLength(boolean enforceLength) setLength(Integer length)
(from redmine: issue id 627, created on 2014/02/19 by Alexey Lavrentev)