ClassCastException on TextField

Hello world!

I have a problem with a class of mine who is from TextField. When I open the context Menu on MyTextField, you see the default options. If I choose "Display symbols", my program shows an error that says "ClassCastException. I thought that maybe I had done something wrong with my class, but then there has tried the same thing with a regular TextField and had the same problem. Anyone know how I can get this option to work?

TextField is the base for BasicEditField and RichTextField class and cannot be instantiated directly.  How do you add the textfield on your screen?  Can you provide a code snippet that reproduces the exception?

The version you gave is for the Simulation of BlackBerry tool itself.  What is the version of the software of BlackBerry device running in the tool?  You can see by going to Options (wrench), in the BlackBerry Simulator.

Tags: BlackBerry Developers

Similar Questions

  • ClassCastException in MenuItem

    IM saving a MenuItem in an attribute of an object.

    When later I call the run method, I get a ClassCastException.

    Any solution?

    Thank you.

    Its a TextField$ TogglingMenuItem.

    Its very strange, but I was doing controller.getSureType () .run ();<-- this="">

    But if I do suretype MenuItem = controller.getSureType (); SureType.Run)<-- this="">

    Weird, no?

    Thank you!

  • 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?

    Duplicate: http://supportforums.blackberry.com/t5/Adobe-AIR-Development/Flash-apps-crashing-in-10-2-when-input-...

  • 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;
    
  • TextField uppercase in QML

    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

  • Tests of TextField

    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.

Maybe you are looking for

  • Can I use the pencil to apple in the pages application?

    If so, how?

  • Do not display on the indicator of the value of void / vi

    Right now I have a situation, where I use a subvi and try to connect an indicator to the block via the main program of VI. Somehow it is connected, but on the main VI main VI is not updated with the changes. It updates in the Sub - VI. Data, I just o

  • Omni 1333w 120 starts &amp; beeps

    Hello When I plug the AC adapter / CC of the omni starts 5 beeps, then put paused and then again with the beeps. Power button blinking orange. Can someone help me? Thank you!

  • 9981 touchscreen P Smartphones blackBerry is no longer

    I am facing a problem with my new touchscreen Blackberry Porsche Design does not, and after a reboot it will work well for one or 2 days and then stop responding again. I have tried the software reloading, flashing, etc. but the case still propblem o

  • How to display a graph

    I'm doing a comparison of NEO4J graph RDF Oracle.  NEO4J has an interface that displays a graph that you run a query (dance balls).  I guess that there is a way to do the same in Oracle as well.  However, I did not understand that.  Please tell me th