BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-24-2009, 10: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, 11: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, 05: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, 08: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





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