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

A50QS40-4 Ferraz Shawmun Semiconductor Fuse
$15.0
A50QS40-4 Ferraz Shawmun Semiconductor Fuse pictureFWA-1000A Bussmann Semiconductor Fuse
$40.0
FWA-1000A Bussmann Semiconductor Fuse pictureFerraz Shawmut Protistor Semiconductor Fuse #Q300739A 950V volt AC 2200A amp
$199.99
Ferraz Shawmut Protistor Semiconductor Fuse #Q300739A 950V volt AC 2200A amp pictureBUSSMANN 80LET USED SEMICONDUCTOR FUSE 240V 80A
$8.99
BUSSMANN 80LET USED SEMICONDUCTOR FUSE 240V 80A pictureHP Manual 4155A B & 4156A B PRECISION SEMICONDUCTOR PARAMETER ANALYZERS
$40.0
HP Manual 4155A B & 4156A B PRECISION SEMICONDUCTOR PARAMETER ANALYZERS picture






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