DataGrid and Focus

Hi all,
I am facing problem while setting focus in a particular row
in Datagrid.
pls send me code if anybody has done it.
thanks

Here's a situation that may be useful:
Using:
IList(datagrid_id.dataProvider).addItem(newItem);
A new editable row is added to my datagrid. But it's at the
bottom of the list, where the scroll pointer won't be. How to make
the scroll point jump to the last item, and put the focus in one of
the column cells to be edited?
I'd like to do this to give the user a visual cue, "the list
just jumped to the last item - you now see a text edit cursor in
it, and the sunken box its flashing in is where what you type will
appear." :)
Darcy

Similar Messages

  • DataGrid and labelFunction

    Hi all!
    I have a DataGrid, and I have two columns where i want to manipulate the data shown. I tried using a labelfunction, but it turns out the labelfunction is called each time I focus out, and not only when the DataGrid is initialized.
    I've seen theres an initialize for DataGrid, but how can i use this to manipulate the data from my two columns?
    Sincerly

    How do you wrap an object?  It depends on how you are getting your data.  If
    you are using RemoteObject or can control the data type being sent over the
    wire, I would simply add a new getter to the data class.
    The most rudimentary way is something like this:  Say you had a ShoppingCart
    record:
    class ShoppingCartRecord
        public var catalogID:int;
    A wrapper class might look like:
    class DisplayableShoppingCartRecord
        public function DisplayableShoppingCartRecord(orig:ShoppingCartRecord)
            original = orig;
        public var original:ShippingCartRecord;
        public function get catalogID():int
            return original.catalogID;
        private var _displayName:String;
        public function get displayName():String
            if (!_displayName)
                _displayName = yourOldLabelFunction(orig);
            return _displayName;
    Then at some point, you loop through the original data set and instantiate
    the wrapped versions and pass that dataprovider to the datagrid.

  • DataGrid Column Focus Out Event

    I have an editable datagrid and I'm trying to accomplish the
    following:
    When a user edits a cell, then focuses out, a function is
    called that sends off a service with that value, along with the id
    value in that same item. I've tried using itemFocusOut, but I'm
    getting bizzare results---the function is executing multiple times.
    So i need the function to know what cell was focused out, and also
    all of the other information that accompanies that item.
    Thanks for any help.

    Here's what I ended up doing.
    Somewhere after Load, I added:
    PropertyDescriptor pd = DependencyPropertyDescriptor.FromProperty(DataGridColumn.ActualWidthProperty, typeof(DataGridColumn));
    foreach (DataGridColumn column in Columns) {
    //Add a listener for this column's width
    pd.AddValueChanged(column, new EventHandler(ColumnWidthPropertyChanged));
    Then the following 2 methods:
    private bool _columnWidthChanging;
    private void ColumnWidthPropertyChanged(object sender, EventArgs e)
    // listen for when the mouse is released
    _columnWidthChanging = true;
    if (sender != null)
    Mouse.AddPreviewMouseUpHandler(this, BaseDataGrid_MouseLeftButtonUp);
    void BaseDataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    if (_columnWidthChanging) {
    _columnWidthChanging = false;
    /// whatever you wanted to do here
    The ColumnWidthPropertyChanged fires constantly while the user drags the width around, so if you just listen to that, you'll be over-doing it.
    Adding the PreviewMouseUp handler let me only do my processing when the user is done changing the width.
    Hope this helps someone.
    Janene

  • How to delete a selected row from datagrid and how to create a datagrid popup

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when  i selected a partiuclar row from a datagrid and click delete button  means that record will delete from the datagrid and DTO from the cloud  tables also.
                Ques 2: when i save  the data grid values using save button means that data will store in  respective cloud DTO which is related to the datagrid,
                     My requirement is i am using a search button when i click the search  button it will show a datagrid that datagrid will contain the previous  datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen:           i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen:                search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • How to delete a Selected row from datagrid and how to create a datagrid popup with saved values

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
                Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
                    My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen: search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • How2 load xml into datagrid, and create realtime search of datagrid data

    I wanted to be able to load xml data into a datagrid and then create a searchbox that would search in real time (as person typed) from any part of the datagrid.  Does anyone know of any as2.0 component that can do that easily?  If not, i would like to try to tackle this the old fashioned and use this to teach myself as2.0 advanced coding.  can someone point to a step by step or explain how i might get this accomplished?  from loading the xml to putting the node info into the datagrid, to being able to search it in real time.  This is part of a project that i was given that has some serious consequences if i botch it.  Please help!  Thanks so much!

    import fl.controls.DataGrid;
    import fl.controls.ScrollPolicy;
    import fl.data.DataProvider;
    import flash.net.URLLoader;
    import flash.events.Event;
    var dp:DataProvider = new DataProvider();
    var dg:DataGrid = new DataGrid();
    dg.columns=["User","Xp","Rank"];
    addChild(dg);
    var urlloader:URLLoader = new URLLoader();
    urlloader.addEventListener(Event.COMPLETE,loadcompleteF);
    urlloader.load(new URLRequest("whatever.xml"));
    function loadcompleteF(e:Event):void {
        var xml:XML=XML(e.target.data);
        for (var i:int = 0; i < xml..Name.length(); i++) {
            dp.addItem({User:xml..Name[i].User.text(), Xp:xml..Name[i].Xp.text(), Rank:xml..Name[i].Rank.text()});
        dg.dataProvider=dp;

  • GridView vs DataGrid and gateway

    Used to use DataGrids and in a template field Hyperlink, the portal converts the link to a fully gatewayed link... GridView Hyperlinkfield does not get "gateway converted"? Thoughts? Guess I could use a TemplateField, but was hoping to use a more default solution.
    EDIT: it appears that a template column with a hyperlink in a GridView does not get "gateway converted" either, hmmmm. Back to tesing and tinkering
    EDIT: I am a moron....have to set the gateway prefix in teh Web Service.....jsut shoot me now! TGIF!
    Edited by: mbowles on Nov 7, 2008 7:56 AM
    Edited by: mbowles on Nov 7, 2008 8:00 AM

    Doh..built my web app in VS2008 w/o using the app accel / AquaLogicWCLoader. It started out as a LINQ o/r mapping experiment - but am trying to take a step further and get into the portal. I'll tweak the web app (referenes to idk and wcloader, web forms into partial classes inheriting from BEA.ALI.Web.UI.ALIPortletPage) and see if that fixes. I'll keep the group posted.
    Bah-zing! It worked. As usual, thanks again, Joel!
    Edited by: tjannotta on Feb 17, 2009 9:37 AM

  • [svn] 3079: Pop up and focus fixes.

    Revision: 3079
    Author: [email protected]
    Date: 2008-09-03 10:53:07 -0700 (Wed, 03 Sep 2008)
    Log Message:
    Pop up and focus fixes.
    QE: YES
    Doc:
    Checkintests: YES
    Reviewer: Alex
    Bugs: SDK-16669, SDK-15688
    mx/events/SWFBridgeEvent.as
    Add marshal() method. Update ASDoc.
    mx/managers/FocusManager.as
    Fix bug SDK-15688. Type coercion error fixed by moving to a common super class of IFocusManagerComponent and SWFLoader.
    mx/managers/PopUpManagerImpl.as
    Renaming.
    airframework/src/mx/managers/WindowedSystemManager.as
    mx/managers/SystemManager.as
    Fix problems introduced from API scrub and fix an old problem activating A.2.2.
    mx/managers/SystemManagerProxy.as
    Override addEventListener() and removeEventListener() to also add listeners on the proxied SystemManager. This
    allows the Proxy to get keyboard focus events that happen in the proxied SystemManager. Dispatch activate/deactivate messages to the sandbox root.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16669
    http://bugs.adobe.com/jira/browse/SDK-15688
    http://bugs.adobe.com/jira/browse/SDK-15688
    Modified Paths:
    flex/sdk/branches/3.0.x/frameworks/projects/airframework/src/mx/managers/WindowedSystemMa nager.as
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SWFBridgeEvent.as
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/FocusManager.as
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/SystemManager.as
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/SystemManagerProxy. as

    I would suggest not to use JWindow but JPopupMenu! In
    the JPopupMenu you can add any swing-components!
    You can show the Popup in focusGained (ok, that is
    not so user-friendly, in my opinion a shortcut would
    do better!).
    The Popup will hide automatically if you click with
    the mouse somewhere else or hit escape.Thank you for the reply.
    I'm still having problems. I'd prefer not to use a jpopupmenu, because I want to use that for something else. This was just going to be a simple list that would appear near the text field so user could have a list of options to choose from.
    Focus gained on the textfield brings up the list. Selecting something on the list clears it (hides). This idea works well on the mac. But on the pc the jwindow keeps hiding behind the main frame ?
    I have the following code
    The windows is created as follows
         listWindow = new JWindow(SwingUtilities.getWindowAncestor(this));
    listWindow.getContentPane().add(pane);
    listWindow.setVisible(false);
    pane contains the jlist of values
    Then the textfield is as follows
    textField.addFocusListener(new java.awt.event.FocusAdapter() {
    public void focusGained(java.awt.event.FocusEvent evt) {
    if (showListWindow) {
    if (!listWindow.isVisible()) {
    Point los = getLocationOnScreen();
    listWindow.setVisible(true);
    listWindow.setLocation(los.x +580, los.y +75);
    listWindow.pack();
    listWindow.toFront();
              textField().requestFocus();
    I use a boolean showListWindow to decide when to show. Because I noticed that displaying the jlist and requesting focus to the textfield caused the focusGain to fire again.
    Any ideas why the pc keeps the list hidden ? If I move the main frame I can see !

  • AWT and focusing on different windows

    Hey guys.
    I have a problem, I'm trying to set the focus a window but can't.
    I have two windows A and B.
    I also have a Events being picked up set on window A.
    So the set of events are detailed as follows.
    Window A display's and responds to events.
    When a particular event occurs it loads up a new window (WindowB) and focus is given to that window.Wasn't a problem until we realised that there was a delay between Window A being displayed and Window B being displayed, enough to cause a problem.
    So the code was changed like follows.
    WindowB.pack();
    WindowB.setVisible(true);
    WindowA.setVisible(false);When it was changed to the above, we lost the ability to pick up keyboard events, as WindowA was still the window with focus.
    I've had a look at the KeyboardFocusManager where it seems that focus can be change between components.
    However is also states for method setGlobalFocusWindow() that it can only be set if it is in the same context.
    Which it is not.
    Is it possible to set focus to the window before the window has been set visible? Is KeyboardManager the right class to look at?
    Sorry about the lack of code(It's spread in many directions and is sensitive)
    Thanks for any help in advance

    hello,
    the following link may help: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/FocusSpec.html
    wrappingduke

  • Web browser resets scroll position and focus when page load completes

    when a page is loading, the scroll position of the page reverts to the top-left and focus in a form element is lost whenever an element or the whole page finishes loading
    Post relates to: Pre p100eww (Sprint)

    Possibly related to the OP's question, I wish we could get the composition page to scroll when typing a reply here on the forum (while using my Pre plus).
    Quoting a reply fills half the text box, then once I reach the bottom of the box, I can't scroll any further downward to complete my reply...
    WyreNut
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • My iphone6 camera is rear , and focus dosnt work in it , although my front camera is working great

    My iphone6 camera is rear , and focus dosnt work in it , although my front camera is working great

    Hey there Aydarezania,
    It sounds like you are able to focus using the front camera, but the back one doesnt seem to. I would use these troubleshooting steps from the following article, named:
    Get help with the camera on your iPhone, iPad, or iPod touch
    Force the app to close, then open the Camera app again.
    Restart your device, then open the Camera app again.
    Your photos are blurred or out of focus
    If your photos are blurred, out of focus, or have dark spots, try these steps:
    Make sure that the camera lens is clean. If you need to clean the lens, use a microfiber cloth. If you see dirt or debris inside the lens, take your device to an Apple Retail Store or Authorized Service Provider for more help.
    Make sure that there’s nothing blocking the camera lens. If you’re using a case, try removing it.
    With iPhone 6 Plus, a metallic case or magnetic lens could interfere with optical image stabilization. If you have a metallic case or magnetic lens attachment, try taking a picture without it. Then compare the quality.
    Adjust the focus by tapping on the person or object in the preview screen. You’ll see the screen pulse or briefly go in and out of focus as the camera adjusts. In photo mode, try to stay steady when adjusting the focus. If you move too far in any direction, the camera will automatically refocus to the center. In video mode, you can adjust the focus before you begin recording.
    If the color seems too bright, or you see double-exposures of moving objects, make sure that HDR is set to Auto or Off. Tap HDR at the top of the screen to choose a different setting.
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • Synchronization between datagrid and chart Item

    Hi
    In my application, I have a datagrid and corresponding bar
    chart. there is a toggle button through which I can switch between
    chart and data grid.
    Now I want to synchronize both.
    for example If I select any 3 rows in data grid then it
    should selects 3 bars on the chart also.
    can any body help me in that?
    Thanks
    smonika15

    Hi,
    U need to have a combo box renderer something like:
    In the object that u are populating the data provider of the
    data grid, add 2 fields:
    listOfFields & selectedField.
    <mx:HBox horizontalScrollPolicy="off"
    verticalScrollPolicy="off"
    xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    public var itemSelected: Object;
    ]]>
    </mx:Script>
    <mx:ComboBox id="combo"
    dataProvider="{data.listOfFields}"
    selectedItem="{data.selectedField}"
    change="itemSelected=combo.selectedItem;"
    updateComplete="itemSelected=combo.selectedItem;">
    </mx:ComboBox>
    </mx:HBox>
    Now, loop through the list of objects that u get from
    back-end and keep setting the 2 new properties (listOfFields &
    selectedField). For setting the value of selectedField, u need to
    loop through listOfFields to match the fieldId.
    Hope that helps,
    Cheree

  • Problem while adding both Key And Focus Listeners to JTextField

    Hi!
    I have something peculiar while adding Key and Focus Listener to JTextField. Suppose i add just Key Listener then everything's fine and i could keep track of keys being pressed. But as soon as i add a Focus Listener to it with the code to select full text in focusGained() method, it starts reponding wrongly to arrow keys pressed and does not perform desired actions. For let arrow key it moves caret by one for the first time after that it does not resond to that unless caret is changed by using mouse. If right arrow key is pressed the it moves the caret to last position from wherever it is. For UP and DOWN it selects the full text(This should be done when it gets focus)
    public void focusGained(FocusEvent fe)
    setCaretPosition(0);
    moveCaretPosition(getDocument().getLength());
    Can someone help me out on this?
    thanks and regards,
    Amit.

    None of those things will cause your JFrame to resize itself. And this is probably a good thing, because your JFrame shouldn't change size once you have created it. Why not create your JPanel so that it has enough space for you to add the component later? Or why not just add the component to start with and then enable it or make it editable when you decide that's necessary?

  • Using same returned data to create datagrid and pie graph

    I am trying to find a good example or information on creating
    charts, initially pie graphs. I will be getting the data from a
    MySQL DB via a HTTPService call to a PHP script. I would like to
    use the same HTTPService call to make a datagrid and build a pie
    graph. My datagrid is working fine.
    All of the examples I have found show the app with an
    internal data source that's hard coded into an array (
    http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDo cs_Parts&file=00001234.html).
    I did search this forum, but it seems most people are just looking
    for dynamic pie graphs and there isn't enough in the entries for me
    to go off of.
    The data returned to the MXML app looks like this:
    <auditdata>
    <riskdata>
    <core>core number here</core>
    <subcore>subcore number here</subcore>
    <mdata>mdata here</mdata>
    <risk1>number here</risk1>
    <risk2>number here</risk2>
    <risk3>number here</risk3>
    </riskdata>
    <riskdata>
    <core>core number here</core>
    <subcore>subcore number here</subcore>
    <mdata>mdata here</mdata>
    <risk1>number here</risk1>
    <risk2>number here</risk2>
    <risk3>number here</risk3>
    </riskdata>
    </auditdata>
    When the data is returned, everything under <riskdata>
    is put into a datagrid. What I'm looking to do in the pie graph is
    this.
    Create a 2 different pie graphs for each riskdata (there will
    only be 2). The first pie graph will be of the three "risks" (where
    their total number equals 100% of the graph). The second pie graph
    would be "core - subcore" and risk1 (where the two values total
    equals 100%of the graph). I hope that makes sense.
    Any guidance would be truly appreciated.
    Thanks,
    Chris

    Does anyone have any ideas on this?
    Thanks,
    Chris

  • What's focus-angle and  focus-distance in CSS radial-gradients?

    Reading the reference ( http://docs.oracle.com/javafx/2.0/api/javafx/scene/doc-files/cssref.html#typepaint ) I found these two values you can set in a radial-gradient definition:
    radial-gradient([ *focus-angle* <angle>, ]? [ *focus-distance* <percentage>, ]? [ center <point>, ]? radius [ <length> | <percentage> ] [ [ repeat | reflect ], ]? <color-stop>[, <color-stop>]+)
    Could someone enlighten me what they mean? I wrote a little tool for visual definition of Gradients (http://88.198.17.44/blog/2012/04/13/it-works-fxexperience-tools-gradienteditor-plugin/) as an extension to FXExperience Tools, and I'd like to include it if it makes sense.
    Thanks
    Toni

    focus-angle and focus-distance are together used to determine the focal point of the radial pattern.
    See this image: http://www.webdesign.org/img_articles/6822/gradient.jpg

Maybe you are looking for

  • XSLT mapping to retrieve FileName from FILE SENDER adapter

    Hi I have an File Sender adapter scenario where I have switched on Adapter-specific message attributes (FileName). In my XSLT mapping program I need to RETRIEVE the filename and map it. Can anyone help please? Thx in advance

  • Hyperion 7.0 report web server crashing

    env: Windows 2000, Weblogic 7.0.2, Sql server. 06-04 00:45:22 ERROR MultiSegCubeView     JobId: 6306-04 00:45:22 ERROR MultiSegCubeView     ADM Exception occured: mou1wnhp07/Vrsn/Main/olauritsen/Error(1013013) Active Database Needed To Execute This C

  • Library Filter in LR5

    I am using the library filter in Lightroom 5. I have flagged some photos and want to use the filter to find these photos. The filter is including both the flags and the star rating. I only want to search the flags and don't know how to stop the filte

  • Report Designer: Text not able dispaly in the report

    Hi, Am using Report Designer with the variable 0FISPER,when user select the period like Period 12 2007 then in the Report it should Display as December 2007(as Header).I tried maintained Text to that variable and also maintained text in the SPRO for

  • Add Empty Row not working

    Hi, We have an "Add Empty Row" Button. When that is clicked a new row seems to be added but we cannot view it. It is visible when a seperate action is carried out. Like a checkbox being checked. It seems that there is no refresh after the row has bee