LeftIcon TextInput event trapping

Did somebody completely executed the left icon in TextInput control?  I am able to define a raw icon and a UIComponent and control adjusts to it for the most part (which seems to be a problem when the left icon is defined and if you set invites).  However, when I add an addEventListener (MouseEvent.CLICK, MyCallback) for the addition of DisplayObject, the event does not fire when the item is selected.

A QNX button worked fine.  Seems a bit small to put a finger on it.  She gets automatically resized by the controlgetLeftIconRect.  This should be able to be defined by the developer.  They leave a good 10px on top and bottom that would make it easier to touch with a finger.

Tags: BlackBerry Developers

Similar Questions

  • How to detect the resize for TextInput event?

    I have a grid, a textInput field, sometimes the text field is too long, I need to truncate. The size of the textinput could be modified by the action of the user column size. I would like to call function truncate happens when resizing. I tried adding "resize = myfunction (event)" in the textinput defintion, but seems that the function is not called.

    Any suggestion /.

    Thanks in advance

    When TextInput comes in memory 1st time then resize function is called as well later change in the size of it. TextInput is getting resized or not. Is that your function is like this?

    public void resizeTextInput(event:_ResizeEvent):void

    {

    ///

    }

  • Drag and drop data from the DataGrid to textInput with flex.

    Hello

    Cay please help me on this problem...

    I have a datagid with certain values... I have a textInput on the user interface...

    There is a button '+' on the user interface... when I click on this button, it will add an additional TextInput box UI under the first TextInput... Like thiseverytime when you click on the button '+' it will add a TextInput more UI just below the other...

    Now, I want to drag the values in datagrid to Textinput boxes... User can move two or more raising each textInput on his requirement...

    How do I drag... could help me please out on the question of thi...


    I am not able to drag the TextInputs values:

    Here is my code: could someone please help me...

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"width ="100% "height ="100% "creationComplete =" init () "> "


    < mx:Script >
    <! [CDATA]
    Import mx.containers.HBox;
    Import mx.controls.Alert;
    Import mx.managers.PopUpManager;
    Import Components.testPopUpWindow;
    Import mx.core.UIComponent;
    Import mx.containers.TitleWindow;
    Import mx.core.DragSource;
    Import mx.core.IUIComponent;
    Import mx.managers.DragManager;
    Import mx.events.DragEvent;
    Import mx.controls.Alert;
    Import mx.controls.Text;
    to import flash.geom.Point;

    Import mx.collections.ArrayCollection;
    [Bindable]
    private var dpFlat:ArrayCollection = new ArrayCollection([)
    {JobName: 'A'},
    {JobName: 'B'},
    {JobName: 'C'},
    {JobName: "D"},
    {JobName: 'E'},
    {JobName: 'F'},
    ([{JobName: 'G'}]) ;

    private function box_addChild (): void
    {

    box: HBox var = new HBox();
    Box.Width = 716;
    var descriptionTextInput:TextInput = new TextInput();
    var strButton:Button = new Button();
    strButton.label = "Submit";
    descriptionTextInput.width = 174;
    descriptionTextInput.height = 58;
    box.addChild (descriptionTextInput);
    / * box.addChild (strButton); */
    strButton.addEventListener (MouseEvent.CLICK, submitButtonClicked);
    interactiveQuestionsVBoxID.addChild (box);

    }

    public void init (): void
    {

    this.addEventListener (DragEvent.DRAG_ENTER, acceptDrop);
    this.addEventListener (DragEvent.DRAG_DROP, handleDrop);

    }

    public void acceptDrop (dragEvent:DragEvent): void
    {
    If (dragEvent.dragSource.hasFormat ("items"))
    {
    DragManager.showFeedback (DragManager.COPY);
    DragManager.acceptDragDrop (TextInput (dragEvent.currentTarget));
    }
    }

    var pt:Point;
    public void handleDrop (dragEvent:DragEvent): void
    {
    var dragInitiator:UIComponent = dragEvent.dragInitiator;
    var dropTarget:UIComponent = dragEvent.currentTarget as UIComponent;
    var table: items = dragEvent.dragSource.dataForFormat("items") in the table;
    / * pt = new Point (dragEvent.localX, dragEvent.localY);
    PT = dragEvent.target.localToContent (pt);
    var img:TextInput = new TextInput();
    IMG.x = dragEvent.localX;   IMG.y = dragEvent.localY;
    IMG.x = PT.x - Number (dragEvent.dragSource.dataForFormat ("mouseX"));
    IMG.y = PT.y - Number (dragEvent.dragSource.dataForFormat ("mouseY"));
    IMG. Width = 50;
    IMG. Height = 50;
    img.setStyle("fontSize",20);     IMG.source = "' Assets / ' + user.user points [0] +".png";"
    IMG. Text = Items [0]. JobName.toString ();

    img.buttonMode = true;
    img.mouseChildren = false;

    TextInput (event.currentTarget) .text = Arrayitems .label [0];

    var itemsArray:Array = event.dragSource.dataForFormat ("items") in the table; */
    TextInput (dragEvent.currentTarget) .text = points [0] .label;
    }

    public void beginDrag (mouseEvent:MouseEvent): void
    {

    var dragInitiator:TextInput = mouseEvent.currentTarget as TextInput;
    var dragSource:DragSource = new DragSource();
    dsource.addData (this, ' node');
    dragSource.addData (this.mouseX, 'mouseX');
    dragSource.addData (this.mouseY, 'mouseY');
    parent.addChild (dragImg);
    dragSource.addData (mouseEvent.currentTarget.text, "txt");
    try {}
    var dragProxy:TextInput = new TextInput();
    dragProxy.text = mouseEvent.currentTarget.text;
    Alert.Show ("text isss" + dragProxy.text);
    dragProxy.setActualSize (mouseEvent.currentTarget.width, mouseEvent.currentTarget .height)

    ask the DragManger to start drag
    DragManager.doDrag (dragInitiator, dragSource, mouseEvent, dragProxy);
    }
    {catch (e)}

    }

    []] >
    < / mx:Script >

    < mx:Canvas id = "c1" width = "100%" height = "100%" y = "10" x = "10" >

    < mx:DataGrid id = dataProvider "d1" = "{dpFlat}" x = "10" y = "119" dragEnabled = "true" dragMoveEnabled = "true" height = "229" width = "176" / >

    <!-< mx:Label id = "lbl" text = "Task name" width = "195" height = "28" x = "0" y = "0" fontWeight = "bold" / >-->
    < mx:Box id = "questionLabelMode" direction = "horizontal" width = '270.5' height = '24' y = "76" x = "211" >

    < name mx:Label = "Response" width = "173" text = "Answer" fontWeight = "bold" / >
    < mx:Button label = '+' width = click = "box_addChild ()"70";" "fontWeight ="normal"/ >
    <!-< mx:Button label = ""» width width = "71" fontWeight = "bold" click ="box_deleteChild (); "/ >-->
    < / mx:Box >

    < mx:VBox id = "interactiveQuestionsVBoxID" y = "119" height = "100%" width = "270.5" horizontalScrollPolicy = "off" x = "211" >
    <! - < mx:Box id = 'boxID' direction = "horizontal" width = "268" height = "58" > - >
    < mx:TextInput id = "t1" width = '174' dragDrop = "handleDrop (event)" height = "58" / > "
    <!-< mx:Button label = "Submit" id = "b1" / >-->

    <!-< / mx:Box >->
    < / mx:VBox >

    < / mx:Canvas >
    < / mx:Application >

    Hi Satya,

    I did it for you... Please copy the sub set of the code and try to run the application. You can see the application works for you.

    You have made two mistakes - you added event on this object listeners... but it refers to the current object (i.e.; your main application file but not TextInput).

    You so need addEventListeners to your textinput "t1" but not this...

    If you add listeners on it then in the functions of your 'acceptDrop' and 'handleDrop' you get 'dragEvent.currentTarget' as your main application but not TextInput (given that you added listeners to "this"). If you addListeners on t1 then its okay.

    Also, you need to add the eventListeners for the newly added text boxes like I did based on 'box_addChild' to the code below.

    Also in the handleDrop function the line of code where you set the text is bad... .it takes the code below...

    TextInput (dragEvent.currentTarget) .text = stock [0]. JobName;


    http://www.Adobe.com/2006/mxml"layout ="absolute"width ="100% "height ="100% "creationComplete =" init () ">"
     
      Import mx.containers.HBox;
    Import mx.controls.Alert;
    Import mx.managers.PopUpManager;
    Import Components.testPopUpWindow;
    Import mx.core.UIComponent;
    Import mx.containers.TitleWindow;
    Import mx.core.DragSource;
    Import mx.core.IUIComponent;
    Import mx.managers.DragManager;
    Import mx.events.DragEvent;
    Import mx.controls.Alert;
    Import mx.controls.Text;
    to import flash.geom.Point;
               
                   
       
               
    Import mx.collections.ArrayCollection;
    [Bindable]
    private var dpFlat:ArrayCollection = new ArrayCollection([)
    {JobName: 'A'},
    {JobName: 'B'},
    {JobName: 'C'},
    {JobName: "D"},
    {JobName: 'E'},

    {JobName: 'F'},
    ([{JobName: 'G'}]) ;
                 
    private function box_addChild (): void
    {
    box: HBox var = new HBox();
    Box.Width = 716;
    var descriptionTextInput:TextInput = new TextInput();
    var strButton:Button = new Button();
    strButton.label = "Submit";
    descriptionTextInput.width = 174;
    descriptionTextInput.height = 58;
    descriptionTextInput.addEventListener (DragEvent.DRAG_ENTER, acceptDrop);
    descriptionTextInput.addEventListener (DragEvent.DRAG_DROP, handleDrop);
       
    box.addChild (descriptionTextInput);
    / * box.addChild (strButton); */
    strButton.addEventListener (MouseEvent.CLICK, submitButtonClicked);
    interactiveQuestionsVBoxID.addChild (box);
    }
               
    public void init (): void
    {
                  
    T1.addEventListener (DragEvent.DRAG_ENTER, acceptDrop);
    T1.addEventListener (DragEvent.DRAG_DROP, handleDrop);
           
    }
       
    public void acceptDrop (dragEvent:DragEvent): void
    {
    If (dragEvent.dragSource.hasFormat ("items"))
    {
    DragManager.showFeedback (DragManager.COPY);
    DragManager.acceptDragDrop (TextInput (dragEvent.currentTarget));
    }
    }
       
    private var pt:Point;
    public void handleDrop (dragEvent:DragEvent): void
    {
    var dragInitiator:UIComponent = dragEvent.dragInitiator;
    var dropTarget:UIComponent = dragEvent.currentTarget as UIComponent;
    var table: items = dragEvent.dragSource.dataForFormat("items") in the table;
    / * pt = new Point (dragEvent.localX, dragEvent.localY);
    PT = dragEvent.target.localToContent (pt);
    var img:TextInput = new TextInput();
    IMG.x = dragEvent.localX;   IMG.y = dragEvent.localY;
    IMG.x = PT.x - Number (dragEvent.dragSource.dataForFormat ("mouseX"));
    IMG.y = PT.y - Number (dragEvent.dragSource.dataForFormat ("mouseY"));
    IMG. Width = 50;
    IMG. Height = 50;
    img.setStyle("fontSize",20);     IMG.source = "' Assets / ' + user.user points [0] +".png";"
    IMG. Text = Items [0]. JobName.toString ();
          
    img.buttonMode = true;
    img.mouseChildren = false;
            
    TextInput (event.currentTarget) .text = Arrayitems .label [0];
            
    var itemsArray:Array = event.dragSource.dataForFormat ("items") in the table; */
    var currTarget: * = dragEvent.currentTarget;
    interactiveQuestionsVBoxID = currTarget.getChildByName ("interactiveQuestionsVBoxID");
    TextInput (dragEvent.currentTarget) .text = stock [0]. JobName;
    }
           
           
    public void beginDrag (mouseEvent:MouseEvent): void
    {
             
    var dragInitiator:TextInput = mouseEvent.currentTarget as TextInput;
    var dragSource:DragSource = new DragSource();
    dsource.addData (this, ' node');
    dragSource.addData (this.mouseX, 'mouseX');
    dragSource.addData (this.mouseY, 'mouseY');
    parent.addChild (dragImg);
    dragSource.addData (mouseEvent.currentTarget.text, "txt");
    try {}
    var dragProxy:TextInput = new TextInput();
    dragProxy.text = mouseEvent.currentTarget.text;
    Alert.Show ("text isss" + dragProxy.text);
    dragProxy.setActualSize (mouseEvent.currentTarget.width, mouseEvent.currentTarget .height)
           
    ask the DragManger to start drag
    DragManager.doDrag (dragInitiator, dragSource, mouseEvent, dragProxy);
    }
    {} catch (error)
       
    }
         
    ]]>

       
     

     
         
         
     

     
                            
     


    If this post answers your question or assistance, please mark it as such.

    Thank you

    Jean Claude Chari

  • Need help, a finishing program

    Hey,.

    I need somehelp in ActionScript 3. So I am a beginner looking for help. I start to make a program that converts the traditional hour standard time. Already have my variables, I don't know how to finish the program. So basically if the user is prompted to enter a time like "14:22:10"the lblOutput.text should display '14:22 '. " I will include the code below. Thanks in advance. I've included where code needs to be written, I don't know how to convert.

    This line makes the button, wait for a mouse click btnConvert
    When the button is clicked, the function convertTime is called
    btnConvert.addEventListener (MouseEvent.CLICK, convertTime);

    This line makes the textinput wait for a mouse click
    When this feature is enabled, the clearLabels function is called
    txtinStandard.addEventListener (MouseEvent.CLICK, clearLabels);

    Declare Global Variables
    var traditionalTime:String;    traditional time

    This is the function convertTime
    e:MouseEvent is the experienced by the button click event
    void indicates that the function does not return a value
    function convertTime(e:MouseEvent):void
    {
    Declare variables
    var standardTime:String;    standard time is entered by the user

    standardTime = txtinStandard.text;     get the user's normal time
    convertToTraditional (standardTime);    call the convertToTraditional function

    generate a message in the label
    lblOutput.text = standardTime "is equivalent to" + traditionalTime;
    }

    It's convertToTraditional function
    s is the standard time
    It determines the traditional duration based on the value of s
    function convertToTraditional(s:String)
    {
    type the code here

    {
    It's the clearLabels function
    e:MouseEvent is the click experienced by the textInput event
    void indicates that the function does not return a value
    function clearLabels(e:MouseEvent):void
    {
    lblOutput.text = "";
    txtinStandard.text = "";
    }

    What you need to do is to divide the string value and evaluate the part of it that determines whether it is AM or PM.

    Focus on the use of the String.Split method to have the chain broken at the colon (:)).

    Which will produce a table accordingly and you want to watch the element of index 0 of this table to determine whether it is AM or PM value.  So you want to convert to a value< 13="" if="" it="" is="" a="" pm="">

  • Update datagrid after text user input?

    Hi guys

    I have a datagrid editable.

    When you enter text in there, I noticed that the dataprovider only is not updated until after having clicked on the line twice.

    for example

    Type "what's new" in the "Whoopa" column, press return (or click on another line), then, in function cell_edit_Ended(event:DataGridEvent)...

    var _newText = .text TextInput (event.currentTarget.itemEditorInstance);

    trace (_newText;) tracks "what's new".

    trace ("file:" + data_grid.dataProvider.getItemAt (_row) ["Artist"]); traces of nothing

    Click on another line and trace ("file:" + data_grid.dataProvider.getItemAt (_row) ["Artist"]); tracks "what's new".

    How to update?  It is originally goofy errors with deletion of the duplicate function, with that I followed.

    Cheers for your help.

    Just open a new AS3 doc (FP11 +) and make a string with the data that your JSON.stringify (done) and test a JSON.parse (top) directly in a table:

    var str:String = ' [{'Delete': 'X', 'Gender': 'None', 'Duo' ': ' '}]';

    var obj:Array = JSON.parse (str);

    trace (obj);

    You get the error:

    Scene 1, Layer 'layer 1', frame 1, line 2. 1118: constraint implied value of static type Object to a type perhaps unrelated table.

    Because JSON.parse () returns an "object" and you are assigning it to a "table".

    Even if you typed _myData tabular form and your JSON is technically a JSON array notation, the JSON.parse () function supports not return them in table form, therefore the above error.

    Fortunately the JSON.parse () returns the object in notation, you can use it as a table. Consider the modified here source:

    var str:String = ' [{'Delete': 'X', 'Gender': 'None', 'Duo' ': ' '}]';

    var obj:Object = JSON.parse (str);

    trace (obj[0]. Delete + ', ' + obj[0]. Kind + ', ' + obj[0]. Duo);

    Track:

    X, no,.

    Bottom line, no need to make the table (he is not still valid), just assign the dataProvider at the same time you analyze.

    data_grid. DataProvider = new DataProvider (JSON.parse (event.target.data));

  • ToolTip positioning

    Hello

    I try to display a ToolTip customized when you use the reversal of a Textinput event, so I have this code:

    private var tltMensaje:ToolTip;

    protected function txt_Password_rollOverHandler(event:MouseEvent):void
    {
    var pt:Point = new Point)
    event.currentTarget.x,
    event.currentTarget.y);

    PT = event.currentTarget.contentToGlobal (pt);

    tltMensaje = ToolTipManager.createToolTip ("MyMessage",
    PT.x + event.currentTarget.width,
    PT.y, 'errorTipRight') as ToolTip;
    }

    The Textinput is inside a Panel and the toottip does not appear next to the Textinput

    Img1.png

    I want to know is if there is a way to display the ToolTip beside the Textinput like this

    Img2.png

    Thank you

    Alberto

    Hello

    I had a problem like this. I used:

    PT = event.currentTarget.parent.contentToGlobal (pt);

    All the best

  • DataGrid and nested properties

    As far as I know, DataGrid does not support changing a property if the property is a nested property. In other words, if the DataGrid is bound to a collection of OrderItems ArrayCollection and an OrderItem has a property called product and the product has a property named description, you cannot change the description property of the data grid. I say you can, hoping that someone will prove me wrong.

    I know that the orderitem property. Product.Description can be displayed OK using a LabelFunction, but when you change this property, after the loss of the focus a DataGridEvent is distributed which is managed by itemEditorItemEditEndHandler in DataGrid.as. This method is always looking for the name of property update by getting the property dataField of the column. If you set the dataField property as 'product.description' method will throw an exception, because it uses this syntax to attempt to define the new value for... Data property [property] = newData; So no matter what you set the dataField property, once you finish editing the value, the itemEditorItemEditEndHandler will try to update the property and throw an exception.

    I hope that someone on the team from Adobe who is familiar with the DataGrid control can solve this problem and say categorically 'you cannot change properties nested' or provide some examples of how it could be done.

    The alternative (which I really want to avoid) would be to create mock objects populated will all values in the OrderItems and bind the DataGrid control to that. Then, of course, xfer return values to the OrderItems original after the user session is ended. Any suggestion would be appreciated and followed.

    Thanks for your suggestions. Yes, this seems to work well. For anyone interested, here is a sample of the handler for the itemEditEnd event. I happen to have only one column being changed. If you had more, then he need additional logic to determine which column has changed.

    private void endEdit(event:DataGridEvent):void {}
    Event.preventDefault (); prevent the default handler of kicks in
    var int index = SelectedIndex of the DataGrid (event.currentTarget); get the index of the row being edited
    the 3 next lines are very specific to the application, I'm working on that
    var oi:OrderItem = OrderItem (orderDetails.getItemAt (index)); get the data related to the line object
    Note the update is a nested property
    Oi. TextInput (event.currentTarget.itemEditorInstance) .text = Product.Description; update the value of w/new value
    orderDetails.setItemAt (oi, index); put the changed object online
    DataGrid (event.currentTarget) .destroyItemEditor (); remove the custom editor
    }

  • Change the color of an individual cell after editing in a datagrid control

    Hi all, I have tried with the custom converter but its either change the entire grid or the entire column. Is it possible to solve this problem by applying the element converter to a particular area? Help needed please...


    Thanks in advance

    I did a bit of work on this and discovered some things that make it a little hard.

    Let's start with the application and the DataGrid control. You will need to know whether or not the currently edited cell value has changed. To do this, I created a variable called oldValue. I then added two event handlers for the DataGrid control:

    itemEditBeginning = "rememberValue (event)" "
    itemEditEnd = "markCell (event)" "

    In the rememberValue function, I copied the value in the cell for the oldValue:

    private function rememberValue (event: DataGridEvent): void
    {
    oldValue = dp [event.rowIndex] [event.dataField];
    }

    In markCell, I have determined if the value has changed. If so, I placed his index of row/column on a list or I removed it from the list:

    private function markCell (event: DataGridEvent): void
    {
    If (event.reason == DataGridEventReason.CANCELLED) {}
    return;
    }

    var newValue:String =
    TextInput (event.currentTarget.itemEditorInstance) .text;

    If (oldValue! = Number (newValue)) {}
    HilightEditedCellRenderer.addCell (event.rowIndex, event.columnIndex);
    } else {}
    HilightEditedCellRenderer.removeCell (event.rowIndex, event.columnIndex);
    }
    }

    HilightEditedCellRenderer is the itemRenderer to my cells. AddCell and removeCell functions are static members of the cell.

    In the HilightEditedCellRenderer, I created an ArrayCollection collection to contain the list of cells and the following functions:

    public static var editedCells:ArrayCollection = new ArrayCollection();

    isEditedCell determines if the row/column is in the collection editedCells.

    public static void isEditedCell (rowIndex:Number, columnIndex:Number): int
    {
    for (var j: int = 0; j< editedcells.length;="">
    {
    If (rowIndex == editedCells [j] .rowIndex & columnIndex == .columnIndex editedCells [j])
    {
    return j;
    }
    }

    Returns - 1;
    }

    removeCell deletes the row/column index within the collection of editedCells pair
    public static void removeCell (rowIndex:Number, columnIndex:Number): void
    {
    determine whether the cell is already on the list and if so, remove it
    var int index = isEditedCell (rowIndex, columnIndex);
    If (index > = 0) {}
    editedCells.removeItemAt (index);
    }
    }

    Add cell place the row/column pair in the Collection if they are not already:
    public static void addCell (rowIndex:Number, columnIndex:Number): void
    {
    Make sure that the cell does not exist yet - don't want to add twice
    If (isEditedCell (rowIndex, columnIndex)< 0="" )="">
    editedCells.addItem ({rowIndex:rowIndex, columnIndex:columnIndex});})
    }
    }
    Finally, I replace the data set function to change the color:

    override public function set data(value:Object):void
    {
    Super.Data = value;

    If (listData)
    {
    Determine the first visible line and a visible column

    var firstRow:Number = .verticalScrollPosition (listData.owner as DataGrid);
    var firstCol:Number = .horizontalScrollPosition (listData.owner as DataGrid);

    the listData.rowIndex is 1-based (not zero) and is based on the visible line. So, if
    the first visible row is 12 and the second row on the screen has changed, then
    listData.rowIndex will be 2. To fix this, is subtracted 1 and firstRow is added.
    A similar thing is done for the columnIndex (what is zero-based).

    var int index = isEditedCell (listData.rowIndex - 1, listData.columnIndex + firstRow and firstCol);

    Determine the color of the cell

    If (index > = 0)
    {
    setStyle ("color", 0xff0000);
    }
    else {}
    setStyle ("color", 0x000000);
    }
    }
    }

    I hope this helps.

  • [help] Problem with datagrid and DB

    Hello

    I have a problem with my flex2 app.
    EDIT: happens in all not only in firefox browser

    I use one
    < mx:HTTPService id = "userRequest4" url = "DB.php" useProxy = "false" method = "POST" > "
    < mx:request xmlns = "" >
    < / mx:request >
    < / mx:HTTPService >

    to send a request to a php script what data back to the database, and these data are load in a datagrid in this form:

    < mx:DataGrid id = "dg" width = "100%" height = "100%" dataProvider = "{userRequest4.lastResult.pathis.Product}" editable = "true" itemEditEnd = "getCellInfo (event); ">
    < mx:columns >
    < mx:DataGridColumn dataField = "ID" headerText = "ID" editable = "false" / >
    < mx:DataGridColumn dataField = "number" headerText = "Name" / >
    < mx:DataGridColumn dataField = "price" headerText = "Price" / >
    < mx:DataGridColumn dataField = "S" headerText = "S" / >
    < mx:DataGridColumn dataField = "M" headerText = "M" / >
    < mx:DataGridColumn dataField = "L" headerText = "L" / >
    < mx:DataGridColumn dataField = "XL" headerText = "XL" / >
    < mx:DataGridColumn dataField = "XXL" headerText = "XXL" / >
    < mx:DataGridColumn dataField = "other" headerText = "Other" / >
    < / mx:columns >
    < / mx:DataGrid >

    EDH, I call the php script, when someone clik in the menu option:
    private void menuHandler(event:MenuEvent):void {}
    if(Event.Item.@label=='Manage Product') {}
    Add_Products.visible = false;
    Add_Products.width = 0;
    Add_Products.height = 0;
    Add_design. Visible = false
    Manage_Products.width = 500;
    Manage_Products.height = 500;
    Manage_Products.Visible = true;
    Add_design. Width = 0;
    Add_design. Height = 0;
    userRequest4.url = "MP.php";
    userRequest4.send ();

    }
    }

    and this function updates the DB when the cell is changed:

    private void getCellInfo(event:DataGridEvent):void {}
    var myEditor:TextInput =
    TextInput (event.currentTarget.itemEditorInstance);
    Get the new value of the Publisher.
    var newVal:String = myEditor.text;
    var objN = new Object();
    objN.ids = dg.selectedItem.ids;
    objN.dato = newVal;
    objN.fields = event.dataField;
    userRequest2.url = "UP.php";
    userRequest2.send (objN);
    }

    and have the property to change the cell, and when that happens to update the database, it worked perfectly, no problems, but when to charge datagrid (I send the request to the DB.php) show this value have cells before that have edited :/
    you know a way to fix it?
    If someone knows please help me, I have urgent need of this :D

    Kind regards
    Shadow.

    try to add dummy prameter to your url in the httpservice which will force the browser not to cache xml

    for exempla, you can add '? blabla = "+ {new Date () .milliseconds}"

  • Regular Expression Validator problem

    Hello
    I have a text box that I want to use a regular expression validator to check that one or more 9 char alphanumeric serial numbers have been entered.
    < mx:RegExpValidator
    source = "{entryField}.
    property = "text".
    Flags = "IM".
    expression="{/[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9] ({|, | \\n|\\r|\\t)/} ')
    valid = "handleResult (Event)" "
    Invalid = "handleResult (Event)" "
    trigger = "{entryField}.
    triggerEvent = "textInput".
    / >

    for the test
    private void handleResult(eventObj:ValidationResultEvent):void {}
    If (eventObj.type is ValidationResultEvent.VALID)
    {
    entryField.setStyle ("borderColor", "green");
    entryField.setStyle ("largeurBordure", "2");
    }
    on the other
    {
    entryField.setStyle ("borderColor", "red");
    entryField.setStyle ("largeurBordure", "2");
    }
    }

    The problem is the handler function always comes back valid, even when it must be valid, as: 123456789 a12345678 lk231jkop

    Can anyone tell where I go wrong? Thank you!

    I finally got it works like this:
    triggerEvent = "keyUp".
    expression = "^ ([A-Za-z0-9] {9} \ (|, |))" \n|\r)*)+$ »

    The big takeaway from this is that the textInput event does NOT work as advertised. Specifically, it does not occur during a deletion. In addition, it forces me to add a space at the end of a serial number using the above expression so that the validation is successful. Fortunately, 'keyUp' works very well :-)

  • Air transport: TitleWindow title bar with Drag

    Hello

    I made a special class that extends a TitleWindow in an Air project.
    When I do a MouseDown on the tileBar, I drag the TitleWindow (stage.window.startMove (;))

    But my problem is that in my tileBar I put a textInput, and when I want to select the text of my TextInput it drags the window...

    How can I solve this problem?

    Thank you!

    Happy Flex developing every1 ;-)

    There are a few solutions that I can think of on the top of my head for this.

    1. instead of listening for the mouse down on the title bar, listen to mouseMove and within the listener, start dragging only if the mouse button is pressed. It is not infallible, but works very well.

    2. (and better than 1) add a mouseDown for the TextInput event listener in your title bar and it contains, simply call event.stopPropogation () (you can do this by adding this line within MXML: mouseDown = "event.stopPropagation ()"). This will prevent the event currently being processed by the listeners of nodes after the current node in the case of flows (including the title bar).

  • T괥 DataGrid rendering problems

    I am creating an its DataGrid with a TextInput to filter the column grid. The custom converter has simply a label (with the label column heading), then a text input, and it's all AS, implementation of IFactory, etc.. It is rendered very well.

    The problem is with the filtering - at first, I tried to just add the area of text, but as soon as I typed anything in it, the filtering logic (which must call dataProvider.refresh () to refresh the dataGrid control) caused the header be re-instantiated, thereby disabling the filter text input field. Later, I worked around this by implementing caching TextInput objects elsewhere and have the header just addChild on them.

    However, the question is still in the way. The ses is reinstantiates twice by call to refresh(), leading them to blink, and if the user types too fast, he throws a RTE because components have not been instantiated yet.

    Is there a way to stop this incessant re-initialization of the its? It does not seem necessary or effective. If anyone knows or wants to help I would be very grateful. Thank you!

    This may be caused by the TextInput event that you use to call the filtering method. Are you call your method of filtering of the change of the TextInput event, perhaps? If so, each typed character will call the filter method. Call your method of filtering the valueCommit event and see if that helps.

    Put a break on the first line of your filter method, debug the application, start typing in the TextInput and watch what happens. If the filter method is called several times, this could be the problem.

    Make sure that you do not call the method of filter until typing is done.

  • Can someone tell me which makes snmp service send a trap event. I mean, snmp does not monitor anything. To send a trap, a person or an application request SNMP to do. Which?

    I was doing some research on SNMP and MIBs.Hit a roadblock when this question came to my mind. Windows stores all MIBs under

    %SystemRoot%\System32

    I know that these MIBs are used to send traps. I just want to know the throughput, or how it's done. Who reads all this information and provides it to the snmp service to send a trap event? If I need to send traps that are defined in some other MIBs, how can I do it?

    Any help will be appreciated. :)

    Hello

    The question you posted would be better in the Technet forum. Check out the link and ask the question.

    http://social.technet.Microsoft.com/forums/en-us/winserver8gen/threads

  • Events with label, TextInput, and list

    Hello

    I'm with yet another problem.

    So, I have a list on a page with a bunch of items in there.

    On the same page is a TextInput which takes something from the user.

    According what is selected in the list, this entry (in the TextInput) is changed on label and displayed on the screen.

    I did a job, but it doesn't seem to work, the code I use is below.

    In addition, if you look at the code, I use my table as:

    var fromArray:Array = new Array({label: 'Thing1'},
                    {label: 'Thing2'});
    

    And I always use the index number in the eventListener. This seems a bit heavy. Is any way for him to seek the 'label' name... i. e Thing1 and Thing2 rather than the index = 0 and index = 1.

    Here's the rest of my code:

    package
    {   
    
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import flash.filesystem.File;
        import flash.net.SharedObject;
        import flash.text.TextField;
        import flash.text.TextFieldType;
    
        import qnx.ui.data.*;
        import qnx.ui.display.Image;
        import qnx.ui.events.ListEvent;
        import qnx.ui.listClasses.*;
        import qnx.ui.skins.picker.*;
        import qnx.ui.text.*;
    
        public class DistanceWindow extends Sprite
        {
            private var textInput:TextInput;
            private var inputNumber:int = new int();
    
            private var outMeterLabel:Label;
            private var outMeterNumber:int = new int();
    
            public function DistanceWindow()
            {
                drawDistanceWindow();
            }
    
            public function drawDistanceWindow():void {         
    
                var fromArray:Array = new Array({label: 'Thing1'},
                    {label: 'Thing2'});
    
                var fromList:List = new List();
                fromList.setSkin(ListCellRenderer);
                fromList.width = 250;
                fromList.height = 400;
                fromList.alpha = 1.0;
                fromList.x = 100;
                fromList.y = 100;
                fromList.rowHeight = 25;
                fromList.dataProvider = new DataProvider(fromArray);
                fromList.selectionMode = ListSelectionMode.SINGLE;
                fromList.allowDeselect = false;
                fromList.selectedIndex = 0;
                fromList.addEventListener(ListEvent.ITEM_CLICKED, listItemClicked);
                addChild(fromList);
    
                textInput = new TextInput();
                textInput.setSize(250,40);
                textInput.prompt = "Input";
                textInput.setPosition(387,150);
                textInput.textField.restrict = "0-9 \.";        // Restrict to only numbers from 0 to 9 AND the period (decimal) i.e. hex 2E
                textInput.addEventListener(Event.CHANGE, inputNumberEntered);
                addChild(textInput);
    
                outMeterLabel = new Label();
                outMeterLabel.text = "outMeterLabel";
                addChild(outMeterLabel);
            }   
    
            private function inputNumberEntered(e:Event): void {
                inputNumber = e.target.toString();
    
            }
    
            private function listItemClicked(e:ListEvent): void {
                var indexClicked:int = new int()
                indexClicked = e.index;
    
                if(indexClicked == 0) {
                    outMeterNumber = inputNumber*0.01;
                    outMeterLabel.text = outMeterNumber.toString();
                }
            }
    
        }
    }
    

    Any help would be great!

    Thank you!

    G

    Hey gpatton,

    I went through the code and made a few Chang to get what I think you want. first thing I did was subject to available fromList to all functions within this application by moving outside the constructor. second thing, it is that I converted your ourmeternumber a number instead of an Int object so that we can see decimal and not only the portion of the whole number of the result. last thing that I did, assuming you want to see a change, whenever a user changes the value of the input text entry was to take the function listItemClicked function and place it in the inputNumberEntered function. so now, the entry is changed each time so the value of the label. the changes I made are in bold. Note also I removed the "new int()" portions of your code. they are not required. This also applies to digital objects and string.

    DistanceWindow.as:

    package{ 
    
      import flash.display.Sprite;  import flash.events.Event;    import flash.events.MouseEvent;   import flash.filesystem.File; import flash.net.SharedObject;    import flash.text.TextField;  import flash.text.TextFieldType;
    
      import qnx.ui.data.*; import qnx.ui.display.Image;  import qnx.ui.events.ListEvent;   import qnx.ui.listClasses.*;  import qnx.ui.skins.picker.*; import qnx.ui.text.*;
    
      public class DistanceWindow extends Sprite    {     private var textInput:TextInput;      private var inputNumber:Number;
    
          private var outMeterLabel:Label;      private var outMeterNumber:Number;
    
          private var fromList:List;       
    
          public function DistanceWindow()      {         drawDistanceWindow();                 }
    
          public function drawDistanceWindow():void {         
    
              var fromArray:Array = new Array({label: 'Thing1'},                {label: 'Thing2'});
    
              fromList = new List();            fromList.width = 250;         fromList.height = 400;            fromList.alpha = 1.0;         fromList.x = 100;         fromList.y = 100;         fromList.rowHeight = 25;          fromList.dataProvider = new DataProvider(fromArray);          fromList.selectionMode = ListSelectionMode.SINGLE;            fromList.allowDeselect = false;           fromList.selectedIndex = 0;           fromList.addEventListener(ListEvent.ITEM_CLICKED, listItemClicked);           addChild(fromList);
    
              textInput = new TextInput();          textInput.setSize(250,40);            textInput.prompt = "Input";           textInput.setPosition(387,150);           textInput.textField.restrict = "0-9 \.";        // Restrict to only numbers from 0 to 9 AND the period (decimal) i.e. hex 2E          textInput.addEventListener(Event.CHANGE, inputNumberEntered);         addChild(textInput);
    
              outMeterLabel = new Label();          outMeterLabel.text = "outMeterLabel";         addChild(outMeterLabel);              }   
    
          private function inputNumberEntered(e:Event): void {          inputNumber = e.target.text.toString();
    
              if (fromList.selectedIndex > -1)           {             if (fromList.selectedIndex == 0)              {                 outMeterNumber = inputNumber*0.01;                    outMeterLabel.text = outMeterNumber.toString();               }         }
    
          }
    
          private function listItemClicked(e:ListEvent): void {         var indexClicked:int;            indexClicked = e.index;
    
              if(indexClicked == 0) {               outMeterNumber = inputNumber*0.01;                outMeterLabel.text = outMeterNumber.toString();           }     }
    
      }}
    

    Oh yah also in the inputNumberEntered function, I've changed the first line to:

    inputNumber = e.target.text.toString();
    

    You had right idea just forgot to go a step deeper and get the text property of the TextInput.

    also its worth noting that I've seen a weird phenomenon when the TextInput value is really high. the reported numbers of return are not accurate at all. Try to go... 1.12.123 1234... and so on until what u hit 123456789. It will begin to do some weird stuff after u pass this point. Assuming that your numbers will get very high that it may not be a problem.

    hope that helps. Good luck!

  • Error e/s file not trapped by the event listener

    Does not appear that the file IO error is trapped by the IOErrorEvent.IO_ERROR event

    as described in the documentation and the examples I looked at.

    My test code is listed below - if there is no such thing as drive P generates a file IO error (#2038)

    which it should - but it doesn't. "t get trapped in the event file.

    Here's the code for simple test attached to a button

    public function btnSubmitSafetySheet_clickHandler(event:MouseEvent):void
        var pdfFilter:FileFilter = new FileFilter("PDF Files", "*.pdf");                

     

        var tmpPDF:File = File.documentsDirectory.resolvePath("rpt_RegionalManagers.pdf");

        var copyToMissingFolder:File = new File();

     

        copyToMissingFolder.nativePath = ("P:/safety/Initials-DDMMYYYY-SafetySheet.PDF");  

        trace(copyToMissingFolder.nativePath);

        if (copyToMissingFolder.exists) {

            trace('MissingFolder exists');

        }

        else {

            trace('MissingFolder DOES NOT exist');

        }

     

        tmpPDF.addEventListener(IOErrorEvent.IO_ERROR, pdfCopyError)

        tmpPDF.copyTo(copyToMissingFolder, true);                       // Should Generate I/O Error if P: not available                                      

        trace('copied to missing docs folder');

     

    }

     

    private function pdfCopyError(evt:IOErrorEvent):void {

        trace('PDF Copy From Network Error');

        trace('Error Message: ' + evt.text);

        removeFileListeners();

    }

     

    None of the trace messages of the IOErrorevent - just debugging and error function:

    P:\safety\Initials-DDMMYYYY-SafetySheet.PDF

    MissingFolder DO NOT exist

    Error: Error #2038: file IO error.

    to flash.filesystem::File/copyTo()

    Hello

    There are two different things-

    1 IOError

    2 IOErrorEvent

    Errors (including IOError) is thrown synchronously and must be captured using the try/catch statements. Infact, the copyTo method documentation indicates clearly that he thorows IOError, so you should use it inside try / catch statement to intercept him.

    Events (including IOErrorEvent) are raised asynchronously, for operations that are performed asynchronously. For example copyToAsync method, such as documented, can cause ioError events and generation of complete. Where as copyTo method does not all events (once already documented).

Maybe you are looking for

  • Search App Store not available?

    Everything seems to work in the App Store, except the search option.  When I try to look for an app, I get the "App Store not available" message.  It happens on my iPhone and iPad.  Any suggestions on how to fix the error?  I tried the option hard/so

  • HP Pavilion p6-2494ea: Ram guide

    I was wondering if this Ram work with my computer, the computer may have up to 16 GB of ddr3 (1333 or 1600) ram and I was wondering if I can add an another 8 GB on it. Is this RAM I'm looking at the work alongside the Ram that came with the computer

  • How to write a unique number in a single Excel cell

    I'm using Labview 2013 SP1 with the Microsoft Report Builder and I can't understand how to write a number of DP to a specific cell in an Excel spreadsheet. I have no problem writing tables of numbers to specific cell ranges, formatting of cells, the

  • Error in C:\Windows\system32\nvsvc.dll __Missing entry: nvsvcStart

    Starting Windows, the error message above is displayed. I tried the update of Windows and the DVD player, but the disc will not play DVD etc. Anyone know how I can fix this please?

  • BlackBerry App Timeplay - blackberry Z10

    When I go to timeplay in the worlds of blackberry it says "not available on this device", and I have a blackberry Z10 :'(