displayFieldFullMessage
displayFieldFullMessage
protected void displayFieldFullMessage()
This method belongs to the TextField class and shows a message of "full-field". Can we change the message to a custom Message.
It worked for me.
BasicEditField bef = new BasicEditField("Test","",5,BasicEditField.FOCUSABLE) { protected void displayFieldFullMessage() { Status.show("Yes..This is custom Message."); } };
Tags: BlackBerry Developers
Similar Questions
-
Slider custom text field (Cap) does not appear
All;
I created a custom text field based on the standard text field, changes work fine (really just a custom height and width and a border). The problem is the method of painting which seems to remove the cap of the field when it gets the focus. To be clear the carret never shown at all.
public class CustomText extends TextField //cutom text field width { //Custom Height and Width in Pixels final static int textwidth=125; final static int textheight=25; CustomText() { super(); // Call the default constructor //Border for text fields XYEdges padding = new XYEdges(5, 5, 5, 5); //space between box and border Border theborder = BorderFactory.createSimpleBorder(padding, Border.STYLE_SOLID); //Assign the border to the object this.setBorder(theborder); } public void onFocus( int direction ) { super.onFocus( direction ); //invoke parent procedure invalidate(); //mark for redraw } public void onUnfocus() { super.onUnfocus(); //invoke parent procedure invalidate(); //mark for redraw } //Override the layout with the custom Width and Height protected void layout(int width, int height) { super.layout(textwidth,textheight); setExtent(textwidth,textheight); } //Override the display message such that no message is displayed when the field is full protected void displayFieldFullMessage() { } //Override the default paint method to call the super class constructor and then assign the border protected void paint(Graphics graphics) { // int prevColor = graphics.getColor(); //Save Previous Color graphics.setBackgroundColor(Color.LIGHTGRAY); // Set to Gray graphics.clear(); // Clear for redraw super.paint(graphics); //Force Redraw of Object // graphics.setColor(prevColor); //restore for cursor paint } };
In the paint in the first and last method lines that are commented out were a soloution that I tried after reading on this subject. Something along the lines of the restoration of the default color, but unfortunately without success. Any ideas would be more useful
Thank you!
Quick thoughts:
(a) to remove the requirement to substitute paint by setting the background a Color.LIGHTGRAY using the base class
(b) you put on the field by using this:
Super.Layout (TextWidth, TextHeight);
If you then do the following:
setExtent (textwidth, textheight);
you are likely to confuse the field. If you still want to use the entire height and use the full width and then try to deal with it in the Style, that is, replace this:
Super(); Call the default constructor
with this
Super(TextField.USE_ALL_HEIGHT |) TextField.USE_ALL_WIDTH); Call the default constructor
(c) why you override onFocus and onUnfocus? I would like to delete these if you do not have anything specific to these methods.
Make these changes, and you'll have a more simple TextField. See if these changes will solve the problem of the caret too.
-
Hi, I want to show a custom instead of the message message "full field". I followed: solution .
I can view the message, but the State is not removing, after 2 seconds. What is the solution for this?
The substitution of displayFieldFullMessage() caused another problem as well.
On all devices, if the user copy & paste a new text, the message could not be deleted.
I have sloved the problem by creating another thread and invoking status.show as shown below:
protected void displayFieldFullMessage() { new Thread(){ public void run(){ UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { String message = FIELD_FULL_MSG; Status.show(message,1000); }}); } }.start();
This code solved my problem on all devices, including the storm.
-
Hi, there is a doubt concerning the scope change, I put the maximum, no characters to number 3, and when I hit more than 3 characters, dialog box is full poster field.
I want to remove it and should not enter more than 3 characters. How to achieve
Concerning
Rakesh Shankar.P
Yes it's possible:
BasicEditField bef = new BasicEditField("Test","",5,BasicEditField.FOCUSABLE) { protected void displayFieldFullMessage() { } };
-
I extend a bisiceditfield in the following way...
class MonthField extends BasicEditField{ MonthField(){ super(null,"JAN", 3,FILTER_DEFAULT); } public int getPreferredWidth() { return this.getFont().getAdvance("JAN"+" "); } protected void layout(int width, int height) { super.layout(getPreferredWidth(), height); } protected void displayFieldFullMessage(){ } }
This poster a basiceditfield with 3 characters... I want is whenever the focus moves to that individual characters field cannot be selected whole field should get the focus at the same time... .i then override the keyChar method and implement features to each button pressed... like for instance if 'J' is pressed Jan is displayed... like the blackberry date field...
I think I got it... .reffering this post...
http://supportforums.BlackBerry.com/T5/Java-development/focusable-RichTextField/m-p/256557
Maybe you are looking for
-
have not used the printer in years and just decided to ink online order. I ordered by ink for HP Photosmart C7180 error because they look exactly alike. They use the same ink? Here's what I ordered. Will this work for my c7100? ALSO, I want to use
-
Satellite A300 stops without reason
Hello Since the transition from win vista to win 7, my Toshiba Satellite A300 stops without reason.To install win 7 at Toshiba, I downloaded all the drivers for Win 7 and I installed.The bios has been changed. What should do?Thank you for your future
-
Problem enabling creation of the Hyper-V in Windows startup!
I use HP Pavilion Notebook 15-N-201TX, configuration are as follows:- 8.1 Windows Embedded industry Pro 64-bit RAM - 4 GB Intel Core i5-4200U CPU Mode of BIOS - UEFI, Version F.66 Whenever I have activate the Hyper-V technology and restart the comput
-
XP emulation under xp home professional
Just bought a refurbished computer that was supposed to have xp professional on it, but like xp home instead. I have a licensed software does not work on xp professional. I have to downgrade the operating system or is at - it a way to emulate xp fami
-
I have 4 computer I have linked to the WRT54G. 2 2 with network cables and wireless. One of these computers I use as a server and I would get the same IP address to the server all the time. As 192.168.1.150. Now it depends on when I turn on my comput