BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-24-2009, 09:41 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 9530
PIN: N/A
Carrier: Telus
Posts: 107
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Field Is Full and Save/Discard/Cancel

Please Login to Remove!

Hello Everyone

I am following 2 issues.

1. I have an EditField which allows only 7 digits. When all 7 digits are entered, it displays "Field is Full" message.

Is there any way to stop that message from poping up?

2. When ever I enter data in the field and press blackberry application menu and select close. It displays "Changes Made" popup with "Save/Discard/Cancel" buttons.

Is there any way to stop that message from poping up?

Thanks
Offline  
Old 03-24-2009, 10:00 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

1. don't limit the field to 7 digits

2. override onSave() in your screen class.
Offline  
Old 03-25-2009, 04:39 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2009
Model: 9000
PIN: N/A
Carrier: T-Mobile
Posts: 67
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

1. i can't see anything in the api that lets you capture the field full event to surpress the status popup. what you could do is override keyChar on your screen and track how many characters have been entered that way. something like this should work:

public boolean keyChar(char key, int status, int time) {
switch (key) {
case Characters.BACKSPACE:
return false;
case Characters.ESCAPE:
System.exit(0);
return true;
default:
if (getFieldWithFocus() == entryField) {
if (entryField.getTextLength() < 7) {
return false;
} else {
return true;
}
}else{
return false;
}
}
}

2.

protected boolean onSave() {
close();
return true;
}
Offline  
Old 03-25-2009, 07:38 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 9530
PIN: N/A
Carrier: Telus
Posts: 107
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the samle code hippocamp.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Hi-Q Pulse Width PWM DC Motor Speed Regulator Controller Switch 6V-90V 15A
$11.39
Hi-Q Pulse Width PWM DC Motor Speed Regulator Controller Switch 6V-90V 15A pictureHoneywell 932AA1Y-A6N Proximity Switch 9.6 - 30VDC 100mA USED
$29.99
Honeywell 932AA1Y-A6N Proximity Switch 9.6 - 30VDC 100mA  USED pictureWestinghouse OT2S1 Selector Switch
$33.77
Westinghouse OT2S1 Selector Switch pictureSCHNEIDER ELECTRIC SAFETY SWITCH 200AMP NONFUSIBLE HD 600V 3P NEMA12 HU364AWK
$3.99
SCHNEIDER ELECTRIC SAFETY SWITCH 200AMP NONFUSIBLE HD 600V 3P NEMA12 HU364AWK pictureTork TU40 Universal Electromechanical Time Switch With Indoor/outdoor Case
$40.0
Tork TU40 Universal Electromechanical Time Switch With Indoor/outdoor Case picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.