You Are Here:

Community: Wiki

This page was last modified on 12 June 2009, at 09:07.

KIJ001374 - TextBox.setMaxSize(int) for Pop-Up TextBox not working correctly in S60 5th Edition

From Forum Nokia Wiki



ID KIJ001374 Creation date June 12, 2009
Platform S60 5th Edition Devices Nokia 5800 XpressMusic
Category Java ME Subcategory UI


Keywords (APIs, classes, methods, functions): TextBox.setMaxSize(int)

Description

Starting from S60 3rd Edition, Feature Pack 2, it is possible to set TextBox to appear as a Pop-Up component in certain devices. This is done by using the JAR attribute and value Nokia-UI-Enhancement: PopUpTextBox.

TextBox.setMaxSize(int) can be used to set the maximum number of characters that the component can contain. If this limitation is set for a TextBox that contains an amount of characters that exceeds the maximum, the content of the TextBox will be truncated.

However, in S60 5th Edition, setMaxSize(int) for a Pop-Up TextBox does not have the desired effect.


How to reproduce

1. Implement a test MIDlet with a Pop-Up TextBox. You can use, for example, the following source code:

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
 
public class SetMaxSizeTest extends MIDlet implements CommandListener{
 
TextBox t;
Display d;
Command cmd;
 
public SetMaxSizeTest(){
 
t=new TextBox("Type here", "", 100, 2); // TextBox
cmd = new Command("SetMaxSize to 2", Command.SCREEN, 0);
t.addCommand(cmd);
t.setCommandListener(this);
d=Display.getDisplay(this);
}
 
public void startApp() {
 
d.setCurrent(t);
}
 
public void pauseApp() {
}
 
public void destroyApp(boolean unconditional) {
}
 
 
public void commandAction(Command command, Displayable displayable)
{
if(command == cmd)
try
{
t.setMaxSize(2); // maximum number of characters set to 2
}
catch(IllegalArgumentException iae)
{
Display.getDisplay(this).setCurrent(new Alert("Exception thrown", iae.getMessage(), null, AlertType.INFO));
}}}

In addition to the code, include the following JAD attribute and its value in the JAD file:

Nokia-UI-Enhancement: PopUpTextBox

2. Launch the application and type text that exceeds the setMaxSize(int) limit (here: 2) into the TextBox.

3. Select the SetMaxSize to 2 command. On the affected devices, the text that exceeds the set maximum is not truncated.

Solution

This issue is expected to be fixed in future S60 5th Edition devices.

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fKIJ001203E5fE2dE5fNewE5flineE5fcannotE5fbeE5finsertedE5fwithE5fE2527E255CnE2527E5fcharE5finE5fAlertE5fusingE5fJavaE5fME45E5finE5fS60X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZKnowledgeBaseContentQ qdcZtypeQUqfntypeZKnownIssueQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZKnowledgeBaseContentQ qfnZtypeQUqfntypeZKnownIssueQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZKnowledgeBaseContentQ qrdfZtypeQUqfntypeZKnownIssueQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ