On TextField
Hi all, I have a stupid problem with a TextField.
the idea is simple, the user write something in the object Textfield press on enter and display a popup with text.
When I override the keyChar method, I can not write in the TextField.
Can someone help me?
This is my code:
Text of TextField = new TextField("","test",45,0) {}
{} public boolean keyChar (key char, int status, int time)
System.out.println ("KeyChar:" + key);
If (key == Characters.ENTER) {}
System.out.println ("heard enter");
......
}
Returns false;
}
text.setEditable (true);
PD: Sorry for my English.
Try to re - delegate the event key like this:
return super.keyChar (key, status, time)
Instead of:
Returns false;
Tags: BlackBerry Developers
Similar Questions
-
Numbers in the textfield using the Boolean and structure of the case?
Hello!
I am very new to these forums and LabVIEW in general. I am currently trying to implement a calculator-ish, but without the operations (+ - * /).
I have 10 Boolean buttons named 0-9, and with them I want to basically write a sequence of numbers in a textfield. I managed to solve the problem using a structure of the event, but now I would get the same result using a case instead of this structure. The problem is that I can't identify which button was pressed, so I can't make the program go to the proper case (0 to 9). Is there a simple solution to what you guys could help me with? Perhaps a property node that is generic for each button? I do not know
in any case, I enclose you a simplified version of what I am seeking to achieve, withouh code I do not know how to write of course.
Thanks for your help in advance!
/ Sebastian
Here's a way to do it: combine Boolean values in a table, which become an 8-bit number and which thread to a structure to deal with a Boolean radix
-
Application closes when you write in the TextField
Hello
I was announced an update of my application on the site of the seller with the help of Air 3.5 and I return this error report:
"BlackBerry Z10, Q10 of BlackBerry and BlackBerry Z30 when I fill the empty text box, the application closes by itself."
The textfield in question is a standard than as3 Textfield value ENTRY. I can't reproduce the problem in the simulator of 10.2 and I don't have a real device. Is this a known issue?
-
Waterfalls in the TextArea or TextField bug
TextArea or TextField has slot as onTextChanged (QString string). If I put a symbol '. 'or', ' before the text in the input field, then when this slot will trigger, the text parameter will be empty string. I think it's a bug. Version of the sdk is 10.2. Have someone has experienced this problem and how can I solve this problem?
Welcome on the support forums.
You can file bugs in jira:
https://www.BlackBerry.com/JIRA/secure/dashboard.jspa -
Always visible hint of TextField
Hello together,
I'm trying to get an entry as in the blackberry calendar application when adding an appointment. The indication "subject" is displayed on first use and after comments is displayed at the top:
Initial state:
After the entry
How can I achieve this? I'm a little stucco here.
Thanks for help you .
Sven
Given that hintText works oddly, it is a prototype of bad
Label { id: myTextHint visible: myText.text.length > 0 bottomMargin: 0 translationX: ui.du(2) textStyle.color: Color.create("#999999") } TextField { id: myText hintText: "Subject" backgroundVisible: false onTextChanging: { myTextHint.visible = text.length > 0 myTextHint.text = hintText } bottomMargin: 0 topMargin: 0 } Container { preferredHeight: 1 horizontalAlignment: HorizontalAlignment.Fill background: Color.LightGray }
-
username (textfield) must not be empty
Hi all...
Can someone tell me how to print an error message (qml or c ++) when a user leaves a field blank IE user name or password.
pls help me I've tried so many things, but not successful...
check for textfield.text.length
a joint systemdialog to view the message (qml). to use which adds "import bb.system 1.0" to the qml file. -
TextField: begin the text to lowercase
Is it possible to configure a TextField element to begin with a lowercase character without changing its inputMode?
Well, I found this:
TextField {}
Input.Flags: TextFieldFlags.AutoCapitalizationOff
}
-
How to increase the size of the font of the TextField?
Hi everyone, one question seems stupid, but I found no solution. I have a TextField and I want to increase the size of its police, but I can't. Looks like it has a maximum default font size, I can not change, the largest size of it seems to be 15pt, but I want to double this size. I have recently become familiar with developing applications on the BB, I think some of them the real problem is stupid, please help me, thank you very much.
TextField {}
ID: tx
clearButtonVisible: false
Input.Flags: TextInputFlag.VirtualKeyboardOff
text: "ddddd".
inputMode: TextFieldInputMode.Text
preferredWidth: ui.du (60.1)
preferredHeight: ui.du (60.1)
textStyle.fontSize: FontSize.PointValue
textStyle.fontSizeValue: 40.1
{textFit}
maxFontSizeValue: 100
}
}
There is a very ugly way using scaleX and scaleY
-
How Textfield text on another page qml property access
Hello
I started 10 BB development recently and need help. I searched this forum but could not find some information exactly related to my problem (unlike only), or I missed something from basically. My main.qml, I want to access the text property of the textfield of the InputControl.qml to be used as a parameter in my SQLQuery (attached object). I tried to use the fieldname method alias property, but it does not work. I can't feature outside. Here is my code:
hand. QML
import bb.cascades 1.4 import bb.cascades.datamanager 1.2 import bb.system 1.0 import bb.data 1.0 Page { id: root titleBar: UIControls { } //! [0] content: Container { leftPadding: ui.du(2) rightPadding: ui.du(2) topPadding: ui.du(2) bottomPadding: ui.du(2) InputControl { } // The ListView that's used to display the artist data //! [1] ListView { id: myListView //property variant dq: defaultDataQuery // Associate the list view with the data model that's defined in the // attachedObjects list layout: StackListLayout { headerMode: ListHeaderMode.Sticky } layoutProperties: StackLayoutProperties { spaceQuota: 1.0 } horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill listItemComponents: [ ListItemComponent { type: "item" Container { Label { text: ListItemData.Japanisch layoutProperties: StackLayoutProperties { } topMargin: 5.0 textStyle { base: SystemDefaults.TextStyles.TitleText fontWeight: FontWeight.Bold color: Color.create("#7a184a") } } Label { text: ListItemData.Lesung textFit.maxFontSizeValue: 9.0 textStyle { base: SystemDefaults.TextStyles.TitleText fontWeight: FontWeight.Normal color: Color.create("#ff1818e9") } } Label { text: ListItemData.Deutsch textStyle { base: SystemDefaults.TextStyles.TitleText fontWeight: FontWeight.Normal } multiline: true textFit.maxFontSizeValue: 8.0 } Divider {} }// Container } // Use a standard list item to display the data in the model ] } // end of ListView }//![1] attachedObjects: [ //! [2] // One of the default provided DataModel's GroupDataModel { id: dataModel grouping: ItemGrouping.None }, DataSource { id: dataSource // Load the data from an SQL database, based on a specific query source: "WadokuJT.db" //query: "select Japanisch, Deutsch, Lesung from WadokuJT where Deutsch like '%Wasser%'" query: "select Japanisch, Deutsch, Lesung from WadokuJT where Deutsch like '%" + stext + "%'"; onDataLoaded: { // After the data is loaded, insert it into the data model dataModel.insertList(data); } type: DataSourceType.Sql } // end of DataSource ]//! [2] actions: [ //! [8] ActionItem { title: qsTr("Search") imageSource: "asset:///images/ic_search.png" ActionBar.placement: ActionBarPlacement.Signature onTriggered: { myListView.dataModel = null dataSource.load() //myListView.dq = defaultDataQuery myListView.dataModel = dataModel } }, ActionItem { title: qsTr("Settings") imageSource: "asset:///images/ic_settings.png" onTriggered: { } }, ActionItem { title: qsTr("Help") imageSource: "asset:///images/ic_help.png" onTriggered: { } } ]//![8] } // end of Page
And here is my InputControl.qml
import bb.cascades 1.4 Container { property alias stext: txtSearchText.text Label { id: lblSearchText text: "Searchtext\r\n" } TextField { id: txtSearchText layoutProperties: FlowListLayoutProperties { } hintText: "Enter Searchtext" } }
Any help is greatly appreciated. Thank you.
Give InputControl an id (in main.qml), for example someId.
Access the variable an alias like someId.stext
-
problems with application to a textfield focus
It comes to the page, what am I doing wrong?
import bb.cascades 1.0
{Page}
ID: addPage
appScene variant property: Application.scene
Signal custom to notify that this page should be closed
signal is)
title bar: title {} bar
Title: qsTr ("Add Location") + Retranslate.onLocaleOrLanguageChanged
dismissAction: {ActionItem}
Title: "Cancel".
onTriggered: {}
The custom here signal to indicate that this page should be closed
The signal would be treated by the page that invoked it
addPage.done ();
}
}
}
{Of container
background: Color.Transparent
TextField {}
ID: cityfield
hintText: qsTr ("enter city or Postal Code") + Retranslate.onLocaleOrLanguageChanged
inputMode: TextFieldInputMode.Text
input.submitKey: SubmitKey.Search}
}
onAppSceneChanged: {}
This triggers the update if the stage of the application is set to
This Page QML.
cityfield.requestFocus ();
}
}Do you want the text field to get the focus (and pull up the virtual keyboard on Z-devices) as soon as the page is loaded?
Try to create a property on the qml page:
property bool showVKB: false
And add this method in your qml:
onShowVKBChanged: { if (showVKB) { // This focus request shows the VKB if the Page is created via a ComponentDefinition (see main.qml) tfWord.requestFocus(); } }
And then, in your qml page that drives this page, set the showVKB property:
navigationPane.push(page); page.showVKB = true;
-
How can I set the textfield object to control all text entries in the field are UPPERCASE? Thank you!
TextField {}
ID: plutextfield
text: 'TEST '.
textStyle.fontWeight: FontWeight.Normal
textStyle.fontSizeValue: 12.0
textStyle.lineHeight: 2
textStyle {}
Base: SystemDefaults.TextStyles.BodyText
textAlign: TextAlign.Right
}
}TextField {}
onTextChanging: text = text.toUpperCase)
} -
How know or identify a centered TextField?
I can't know the property targeted for the TextField or TextArea can then, what can you help me
To determine if the control focuses:
http://developer.BlackBerry.com/Cascades/reference/bb__cascades__control.html#property-focused
To request the update:
http://developer.BlackBerry.com/Cascades/reference/bb__cascades__control.html#function-requestFocus
-
Hello
Can someone tell me what I'm doing wrong here? I want text large enough to read, but it's true lower case. I'm just playing make a primitive text editor and I started with the code in the page Web Adobe FileReference.
package { import flash.display.*; import flash.events.Event; import flash.events.MouseEvent; import flash.net.FileReference; import flash.net.URLRequest; import flash.net.FileFilter; import flash.text.*; import flash.text.TextFormat; import flash.text.TextFormatAlign; [SWF(height="600", width="1024", frameRate="30", backgroundColor="#ffffff")] public class EditFile extends Sprite { private var MyTextField:TextField = new TextField(); private var MyButtonField:TextField = new TextField(); private var MyFile:FileReference = new FileReference(); private var C_format:TextFormat = new TextFormat(); public function EditFile() { C_format.bold = true; C_format.size = 40; MyTextField.border = true; MyTextField.width = 700; MyTextField.height = 450; MyTextField.setTextFormat(C_format); MyTextField.multiline = true; MyTextField.type = TextFieldType.INPUT; MyButtonField.background = true; MyButtonField.backgroundColor = 0x339933; MyButtonField.x = 850; MyButtonField.y = 120; MyButtonField.height = 30; MyButtonField.text = "Click here to save"; addChild(MyTextField); addChild(MyButtonField); MyButtonField.addEventListener(MouseEvent.CLICK, clickhandler); stage.nativeWindow.visible = true; } private function clickhandler(e:MouseEvent): void { MyFile.save(MyTextField.text); } } }
Another thing cute is my cursor keys work (sort of) in the TextField, even if it does not exist on the keyboard of the pop-up window (maybe it should be?). The mouse can select text, but not to change the insertion point as the cursor keys can.
Thank you
Harry
Hey harry,.
change this line:
MyTextField.setTextFormat(C_format);
This line:
MyTextField.defaultTextFormat = C_format;
that should do the trick even if I can't use my keyboard on my laptop for some reason any... works only if I type with the integrated keyboard.
Edit: I forgot to put the explanation hah... defaultTextFormat property applies the format of text of w/e tell you him AGAIN all text entered in the field. the setTextFormat method applied the text of w/e format that say you the CURRENT text in the field.
-
TextField, submitted using c ++ does not
Hi all
I am trying to connect to the TextInputProperties::submitted(bb::cascades::AbstractTextControl*) signal, but in fact it does not. This is my code:
TextField *inputField = uiPage->findChild
("damageInput"); QObject::connect(inputField->input(), SIGNAL(submitted(bb::cascades::AbstractTextControl*)), this, SLOT(onSubmitted(bb::cascades::AbstractTextControl*))); inputField->input()->setKeyLayout(KeyLayout::Number); I see no error on the console. In any case my events onSubmitted method is never called, even if it is declared as a crack:
public slots: void addClicked(); void subtractClicked(); void onDialogFinished(bb::system::SystemUiResult::Type ); void onSubmit(bb::cascades::AbstractTextControl *);
I did something wrong?
The only mistake I found on the log of the device is that:
Dec 09 11:10:54.807 com.example.MagicManager.testDev_agicManageref1201b1.237248764... 0 csuifw_error ERROR ClientObject::removeAttributeListener() 15555 - recorded none of these headphones attribute on object
But I don't know if it is related to my problem. Any idea?
In theory, it is not strictly necessary,
I tried to add the name with the same result.
In any case, I found the problem, whas my fault.
in fact in the connection, I stated as a crack the onSubmitted method events:
QObject::connect(inputField->input(), SIGNAL(submitted(bb::cascades::AbstractTextControl*)), this, SLOT(onSubmitted(bb::cascades::AbstractTextControl*)));
But the crack in the class's onSubmit:
void onSubmit(bb::cascades::AbstractTextControl *submitter);
Then, to fix this problem, solved the problem. Unfortunately this kind of errors is not recognized by the compiler.
-
Detection of ENTRY in a TextField?
Is there a way to detect if the user has pressed ENTER within a TextField? I would like to have a TextField when the user is done by breaking hits the value is automatically processed by my application.
Look at the "input" and http://developer.blackberry.com/cascades/reference/bb__cascades__textinputproperties.html property
-
I wore an android application for bb 10 app, here I am facing problems.
1 key board is not coming by clicking textfield on Simulator, it will show on real device2. I want to show 6 pictures long in size on a page to display scrolling but memory is out of range
Hello
No. 1: If you started the Q10 Simulator, it is expected for the real device has a physical keyboard. The Simulator startup, select the Z10 and test again to get the virtual keyboard.
2: this question would better fit for a new topic. In any case, a strategy would be to cut the long cards for the smaller pieces and loading them dynamically, effectively keep in mind a few.
Maybe you are looking for
-
ProBook 440 G1 continually lose Qualcomm Atheros WLAN connection
Hello world I just bought the HP ProBook 440 G1 free BACK. I have intalled Windows Pro 8.1 and installed divers downloaded directly from the center of Support of HP in this link. For the wireless drivers, I realized that the I have the QCA9565 of Qua
-
Encoder FPGA Crio SSI Protocol
Hello everyone Everyone works with encoder SSI and Crio FPGA Protocol? I wrote a simple program that try to apply this Protocol on Crio FPGA, but I get the chaotic data. I use a TTL-rs422 converter to transform (422) signal at the TTL for Internet si
-
HP Media Center m1050e PC - unable to connect to the internet after upgrade from XP to Windows 7
My desktop PC with Windows 7 will not connect internet after the transition from XP to Windows 7 Home Premium. This necessary upgrade actually recording files and a new install of Windows 7. When getting help from support of the router to load a ne
-
Having problems to open an excel file to add information to it.
The computer says read-only, so I went and downloaded a path of microsoft office free for 60 days for 60 days and it wont open it says that I am not allowed. I can open the excel file, but I can't enter all the information. I don't know what to do. I
-
ASUS N56v not install internet Explorer
Hello I have the laptop above and receive internet explore 11 cannot install happen on updates. I tried to download it manaully and it installs but update always comes to the top. Any ideas? John.