ComboBox in a table in a dialog box

I have a dialog box that contains a table. Some of the columns of the table are drop-down list boxes.

Some event of the dialog box appears with a number of rows (items) in the table. The drop-down list box contains all possible selections of the cell, which are objects of a class. The getValueAt() of my table model (extension of AbstractTableModel) method returns an object that exists in the combo box, so this object toString() representation is what is displayed normally. I can select the cell, get the drop-down list and make your choice and all is well. Or, if I click in another cell in the table, the combo is closed and the selection is displayed normally. There are buttons in the dialog box accept or cancel the values presented in the table.

The problem I have is that if I select the cell, and the menu drop-down is displayed, but instead to make a selection, click on the Cancel button. What causes all elements in the array to be destroyed (without saving changes), and the dialog box rendered invisible. Then, when another event occurs and the same dialog made visible with new elements (lines), the previously selected cell is shown with the dark and down a drop-down list box border, but not the drop-down list. The cell displays the first item in the combo box, not the one that would have been returned by the method getValueAt() of the model. The selection of the element is not so indicated.

I expect that when the dialog box is reshown and the rows of the table are rebuilt the remains of the drop-down list box would be gone. In other words, when the content of the table is destroyed and the dialog box is closed, I would expect for a cell to be arrested and not to forget the next time that the table is filled and shown editing.

How can I make sure this happens?

Thank you
Wayne

You must manually cancel editing of the cells before "destroy" the rows of the table.

CellEditor editor = table.getCellEditor();
if(editor != null) editor.cancelCellEditing();

Similarly, you do not call stopCellEditing() when you press the OK button, so that any current change is recorded.

Tags: Java

Similar Questions

  • Put the active table in respect of the development when the script was interrupted by a dialog box

    I adapted a script which browse tables in a file of Fm and asks the user if he wants the current to be reformatted or not active table

    I have not find a clean way to the table that is currently selected in the variable "tbl" or visible on the screen when the scripts sends a dialog box.

    The workaround I found is to launch a format on the table before sending the guest, in this case the table processing is apparent when the prompt arises.

    But I would like to have the visible table and avoid doing all the treatments on the table until the user has had a chance to respond to the prompt.

    I guess that there must be a method to draw the attention of the active window on an item that is selected in a variable?

    function ApplyTableFormat (doc)
    {
    If (doc.) ObjectValid())
    {
    var tbl is doc. SelectedTbl
    var tbltitle;
    var tblTextItem;
    While (tbl. ObjectValid())
    {
    tbltitle = "";
    tblTextItem = tbl. FirstPgf.GetText (Constants.FTI_String);
    for (var i = 0; i < tblTextItem.length; i ++)
    {
    tbltitle += tblTextItem [i] .sdata;
    }

    / * How my "tbl" visible in the window active doc? */
    If (Alert ("format:" + tbl.)) "Tbltitle + FirstPgf.PgfNumber + '? \nClick Cancel to abort. ((', Constants.FF_ALERT_CANCEL_DEFAULT))
    return;
    / * Insert here the table formatting code * /.

    TBL = tbl. NextTblInDoc;
    }
    }
    on the other
    {
    Alert ('no active doc', Constants.FF_ALERT_CONTINUE_WARN)
    return
    }
    }

    There is a document feature that allows to scroll the window to a location of particular text:

    doc. ScrollToText (textRange);

    You might be able to do something like this:

    doc. ScrollToText (new TextRange (tbl. TextLoc, tbl. TextLoc));

    -Rick

  • Table dialog box not no projection in FM12, unstructured

    Having introduced the tables in headers (in master pages), I don't see dialog box insert a table when I try to insert a table into a page of body. If I hit escape, normal function resumes. If I hit Enter, I get a table with the current values in the dialog box. No idea why it's not showing?

    I thought about it...
    The multiple monitor installation. The dialog box shows on the screen of the laptop, not on one of the large screens.

    Thanks for your help.

  • dialog box not opening not in DW CS3 table creation

    After installing Adobe CS3 Master Collection and uninstall then CS2 Premium, I suddenly more don't create table dialog box when you insert a new table. It falls right in a wide table, 3 columns and 3 rows default 200 px. I can't find any settings or CSS which should be the engine. It wasn't until I uninstalled CS2, but I even ran a repair on CS3 without change installation.

    Any ideas?

    Krisalan,

    Go in Edition > Preferences > General category and make sure that the show «»
    Setting dialog when inserting objects"is turned on.

    HTH,
    Randy

    > After installing Adobe CS3 Master Collection and uninstall then CS2 Premium.
    > I'm suddenly more don't create table dialog box when you insert a
    > new table. It falls right in a wide table, 3 columns and 3 rows default 200 px.
    > I can't find any settings or CSS which should be the engine. It didn't happen
    > until I uninstalled CS2, but I even ran a repair on CS3 without change installation.

  • Dialog box "Bookmark all" is HUGE!

    I have the version 40.0.3 of FireFox running on a Dell XPS under Windows 7 Home Premium laptop.

    When I right click on a tab for "bookmark all tabs" in a window, the dialog box that opens is really long and thin... I want to say, "scroll across the width of the page a couple of times" for a long time. (I think that the box is 150px high and almost long 4000px.)

    What's more interesting? This box goes more often I bookmark stuff.

    Whassup?

    Jason A Schulz

    Wow, that should not happen.

    Sometimes, the file that contains the sizes of window and the dialog box becomes corrupted with dimensions of nonsense. As it is difficult to change, we recommend usually rename this file and have Firefox rebuild. Here's how:

    Open the settings folder (AKA Firefox profile) current Firefox help

    • button "3-bar" menu > "?" button > troubleshooting information
    • (menu bar) Help > troubleshooting information
    • type or paste everything: in the address bar and press Enter

    In the first table of the page, click on the view file"" button. This should launch a new window that lists the various files and folders in Windows Explorer.

    Leave this window open, switch back to Firefox and output, either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Pause while Firefox finishing its cleanup, then rename xulstore.json to something like xulstore.old. If you see a file named localstore.rdf, rename this to localstore.old.

    Launch Firefox back up again. Normally, the dialog box appears again.

    Oh, I should mention that this can turn off the menu bar and the bookmarks toolbar. To activate the different bars on and outside, you can use one of the following methods to view the list of the toolbar, and then select the desired bars it:

  • The use of data in the dialog box

    Hello

    I started using DIAdem Dialog Editor and I wonder how I would use data that has been entered in a dialog box or table cell perform some calculations on it and display the results in another dialog box.

    I'd also be looking to retrieve data in a drop-down list or dialog box and and displayed it in my final report format.


  • A more successful experience in the creation of UIs compositable configuration dialog boxes

    A few weeks I posted an experience in creating user interfaces using sub-panels transparent compositable. The approach can be described as, "It was less remarkable for being novel."

    Today, I write another attempt, this one along more traditional lines, and a lot more successful. Notable: this can be any arbitrary composition of this last AND it solved the problem of order TAB.

    This solution uses an image control and makes copies N of a control. When the user moves a control or move the mouse over the control, a real control slides in this position to be able to catch the events (updated mouse more attract State, highlight to the keyboard focus, manage typing, etc.). If the value changes, a master data table is updated and the image control is updated.

    It is something that has been tried in various forms in the past, but there are two aspects of this particular implementation that make nice:

    1. its programming interface for specifying the behavior of objects should make it fairly easy for a user of the framework generate dialog boxes programmatically

    2. It handles the problem of TAB without flickering, something I've not seen in other attempts

    This idea creates conversation about previous experience - thanks to those of you who have posted on various forums, e-mail me, or, in some cases, showed up at my office. That last is not something I am encouraging unless you work at OR... just saying. :-)

    Now, this experiement has already donnГ an interesting conversation. We note that, as long as the controls are instantiated independently of each other - in other words, any property of a control depends on the property of another control - this system of dialogue is progressing well. But in this experiment, I implemented the option button, which interact with each other - when set to True, the other false go. As soon as the controls are starting to interact with others (such as aging a control when a checkbox is disabled, or with expandable sections or really complex cases like updating a chart as a change in options, as happens in some config dialogs Express VI) then we leave who need ways to make reference to other controls. That leads us quickly in one of two directions: name the controls or creation of references. The naming approach is certainly my preference because it fits better with the data stream and I can make interesting effects with breaking apart some of the tree. But it quickly starts sounding like "Please implement a XAML parser in LabVIEW." For those of you familiar with XAML, in the world of user interface design, it could very well be the best thing since sliced bread. A XAML string would fit well with the data flow, and we could start that accumulate. I am reluctant to go down this road for two reasons. One, many have noted, it is really not a good library written in LabVIEW that can give me a useful analysis of XML DOM tree. Two, it is a huge project and my gut sense is that you need to fill a pretty big part of it before you would start to see any return on investment. But it is worth thinking to-I could be wrong. Wouldn't be the first time. This code I posted today can at least help you get started on the side of the generation if one of you decides to become laborious.

    I'll have my attention away from this project for the time being, coding in G is a lot of fun, and I wish I could spend several days to do, but this has been a side project and it is time to return to my projects assigned in the programming of text. Building a powerful platform for the automatic generation of user interface in LabVIEW would be really useful - I see a lot of requests for this sort of thing, and other languages are ahead of us in this area.

    [Last updated 17/05/2012 - there is an improved version.]

    This isn't a question. It doesn't have an answer.

  • The cancellation of the 'file' dialog box and handle errors caused by the empty path that makes the DB connection

    Hi guys.

    I developed a VI that connects to the database reads the names of tables, columns of the selected table, etc. It works well as I want to.

    However, I have problem with identifying the UDL file with function of dialog 'file' use in a structure of the event that is triggered when the button 'Open' value is changed. It also works well, when I choose the UDL file, but the problem is when I cancel it and I get the error 43.

    I tried to deal with this problem with a "error handler" function to clear the error 43 but the next errors that are associated with the database conncetion appeared. The reason is, when file dialog is cancelled, an empty path passes by reference of connection and I can't start the while loop where are the key codes. I also used a box Structure connected to "Cancelled" with 'DB connection tool' in case of real and connection the reference connection for the while loop, but I get the same result.

    I want to apply for work as: start to push the button "Open" and select the file UDL, the loop run to establish the connections database, if not with the cancellation of the file dialog box, the application waits by pushing the button open and select the UDL file again.

    Thanks a lot for your help in advance.

    Hi lman,.

    start to push the button "Open" and select the file UDL, the loop run to establish the connections database, if not with the cancellation of the file dialog box, the application waits by pushing the button open and select the UDL file again.

    Some pseudocode, easy to implement:

    WHILE
    
      onevent(OPEN button)
        FileDialog
    
      IF file selected THEN
        open database
        do calculations
      ELSE
        do nothing
      ENDIF
    
    WEND
    

    What is your problem with the help of loops and structures of the case?

  • "MB Ethernet Slave Demon.vi" connection lost when opening a windows dialog box in my application

    Hello everyone,

    I am currently working on a LabVIEW application that communicates with a PLC using a Modbus Protocol (with an ethernet cable). The PLC is the master and the PC is the slave.

    The code is based on the Modbus of LabVIEW examples: "MB Ethernet example Master.vi, MB Ethernet example Slave.vi and MB Ethernet slave Demon.vi. It is not the first time I use it.

    But I recently discovered a problem. In my application, I have a pop-up with a button that opens a windows dialog box to select a result file.

    When the windows dialog box opens, the "MB Ethernet Slave Demon.vi" crashes (I put a meter inside to see what happened and it stops at the moment opens the dialog box), then when I close the dialog box, the counter continues to count, the connection ID is empty, and the number of the demon slave VI connection resets to 0. When communication is re-established between the PC and PLC (like 10 seconds after the closure of the dialog box), the number of connection go to 1 and table of login ID is no longer empty.

    Otherwise, the communication works very well. But not when the dialog box opens and is a significant problem for me because the user must be able to open results file during production that needs the Modbus communication at work because it's the controller who gives orders the computer to run the production cycle.

    Thanks in advance for your help.

    If you think that the problem is inside the library NI Modbus (old), why don't you use the most recent which is available on the network of tools? Link is here: https://decibel.ni.com/content/docs/DOC-30140

    Looking into some of the screws in the library, she uses methods of Server VI as "Run a VI" that will perform the loop of the root, as it crashes while the file dialog is open. I suspect that the new version of the library is not the problem.

  • Read in Excel for user dialog box

    Hello

    I am currently working on a senior design project in which I first need to create a username and password for people using the vi.  I am very new to LabVIEW and after a search through the help file in LabVIEW, I discovered a login dialog box that seems to be exactly what I need.  I works fine, but I need to design my code in such a way that an administrator has total control over adding, removing or modifying the usernames and passwords.  I would like to create an Excel file where this administrator can reach this goal through a column "username" and "password" column, so that the vi can call these strings in the Excel file in the vi and the user names and passwords will be always saved.  I posted the vi I've tried to work with below.  Instead of the table user in place, I'm guessing that would be replaced by the Excel file to call from?  Any help would be greatly appreciated.  Thank you.

    Chris

    I couldn't open your vi as a Subvi is missing.

    You can reference vi attached with this post.

    I used the text instead of excelsheet file.

    Text file format is

    UsernamePASSWORD

  • Interface API - menu of the bottom and the entry dialog box?

    Hello!

    It would be preferable if a widget is very similar to a native application on BlackBerry so I am just wondering if there is something like an entry dialog box?

    Like 'Please enter a location"'_' (OK)

    Another thing I would really like to: in some applications like BlackBerry map or calendar, there is a standard menu on the bottom of the screen. Is there a Widget API for this?

    Kind regards

    Alex

    The jump on a fixed positioned div is something you will see on a real device as well.  This is a limitation of the BlackBerry browser when scrolling with content in a fixed position.

    From what you describe, sounds like you want as the toolbar which is available on the device of the storm that allows you to add 4 buttons at the bottom of the screen.  We do not currently have an API available that you activate the toolbar of the storm.

    However, I have seen others accomplish this effect even by an array of the size of the screen and then have a scrolling div statement positioned to the upper part of the screen and then the cells for the buttons at the bottom of table.  That would be usable for touchscreen and trackpad/trackball devices.

  • dialog box "Choose the program you want to open this file" is displayed when I start (after shutdown or restart) with my windows username listed in the file to open

    As I mentioned, the dialog box appears after every restart.  It occurs after I entered my credentials to logon and proceeded to windows.  It seems to be pretty late in the boot process that things like the chat programs and widgets are fully charged at the time wherever the dialog box is displayed.

    The dialog box appears to be the 'Open with' dialog box in Windows 7 standard.

    Specifically the dialogue reads as follows:

    Choose the program you want to open this file:
     
    File: Mathew [it's my user id and he showed not extension)

    If I open the file into something like Notepad, then the information below is presented (the # s are real numbers, but these looked like mac addresses, so I left)

    ===========================================================================
    List of the interface
    ##...## ## ## ## ## ## ...... Dell Wireless 1510 Wireless-N WLAN Mini Card
    ##...## ## ## ## ## ## ...... NVIDIA nForce Networking Controller
    #........................... Software Loopback Interface 1
    #... # # # # # # # # Card Microsoft ISATAP
    #... # # # # # # # # Teredo Tunneling Pseudo-Interface
    #... # # # # # # # # Card Microsoft ISATAP #2
    ===========================================================================

    IPv4 routing table
    ===========================================================================
    Active routes:
    None
    Persistent routes:
    None

    IPv6 routing table
    ===========================================================================
    Active routes:
    None
    Persistent routes:
    None

    Startup in MSCONFIG includes:
    ArcoTray - request for assistance Adobe Acrobat Distiller
    Adobe Reader and Acrobat Manager
    AVG Internet Security
    CyberLink PowerDVD
    Dell Support Center updates
    Reference Dell Webcam Central
    Dell Wireless card wireless network tray Applet WLAND
    Google update
    GoogleTalk
    GrooveMonitor Utility
    Digital Imaging HP - hp all-in-one serious
    HpqSRmon Application
    hpwuSchd Application
    IDT Audio of PC
    iTunes
    Java platform
    Logitech SetPoint
    Microsoft Windows operating system
    Microsoft Windows operating system (Yes, it is listed twice)
    NVIDIA Compatible Windows7 Display driver
    Quicket
    QuickTime
    Synaptics Pointing Device Driver
    TranscodingService

    Samhrutha,

    I solved the problem.

    I found that when creating a new user, no longer had the open with dialog box.

    I started the process of resolution of a corrupted user profile (which seems little more than creating a new and copy and paste a few old values), when I decided to try one last thing.

    I logged on my account corrupted again and when the 'Open with' dialog that I open the file with Notepad.  I tried to "save under" to locate the file and found that it was located in C:\Users.  Something in recent weeks seems to have put a file without an extension, called "Mathew" (my log in name) in this folder, and it began when I started windows.

    I have since deleted the file and am no longer get the "Open with" dialog

    Thanks for your support!
    Carpet

  • State of the coast customer Pass to the modal dialog box

    Hi guys,.

    I would like to open a modal dialog box and change the value of a select list of the modal dialog box. I have to be able to switch the status of the customer value using apex.item("P1_DEPTNO").getValue (). The declarative method to use modal dialog boxes is to use a button and a link to the page, where everything is taken care for us, the value, the checksum for the protection of session state, etc..

    But sometimes we need to go on the side of current customer State the modal page, for example, while we are in the middle of creating a new row in a table... and the value is not yet stored in the database.

    So, how can we do this? By the way the page in progress and also variables to generate the control are appropriate for the items to be passed.

    Since there is no dynamic action to do this directly, I tried to attach a dynamic action to a button and run javascript to open the dialog box (https://docs.oracle.com/cd/E59726_01/doc.50/e39149/javascript_api.htm#AEAPI29504):

    var l_url="f?p="+$v("pFlowId")+":2:"+$v("pInstance")+"::::P2_DEPTNO:"+apex.item("P1_DEPTNO").getValue();
    alert (l_url);
    
    
    apex.navigation.dialog(l_url, {
        title:'About',
        height:'480',
        width:'800',
        maxWidth:'1200',
        modal:true,
        resizable:false },
        '',
        $('#EMP_REPORT'));
      
    
    
    

    Unfortunately, I get an error internal an error:

    2 request 157 dialog page cannot be returned successfully. If make sure that the template in use on page 2 is the type of model 'Page of dialogue', with the JavaScript dialog initialization appropriate, closing the dialog and dialog box cancel the code defined.

    I do not understand the error message since I use the theme 42 and the handling of the ordinary modal dialog box works.

    Would appreciate advice.

    See you soon,.

    ~ Dietmar.

    Hi Dietmar,

    you're always coming to these requirements of fancy...

    The following has worked for me in Chrome. But to test if it works in any browser.

    1. Describe your button as usual with a link to the page of the dialog box
    2. For example to set items , specify P7_CUSTOMER_ID as the name and ~ CUSTOMER_ID ~ as value. ~ CUSTOMER_ID ~ is our placeholder that will NOT get replaced by APEX. We use it in our JavaScript code.
    3. Set the static ID of your my_button button so that we are able to access in JavaScript
    4. In the run when the Page loads page level attribute, add something like
      var myButton$ = $( "#my_button" );
      myButton$.attr( "onclick", myButton$.attr( "onclick" ).replace( "~CUSTOMER_ID~", "' + $v( 'P2_CUSTOMER_ID' ) + '" ));
      

    The JS code above will replace your reserved space and turn the link into something like

    javascript:apex.navigation.dialog('f?p=73380:7:109940056598048::NO:RP:P7_CUSTOMER_ID:' + $v( 'P2_CUSTOMER_ID' ) + '\u0026p_dialog_cs=QxixrjW-ZGmCMXTNBPlITtOG_X3aShXqYmmaugetfJ8rYKRHHpJpeskKbIEO3qpqVIkX-dWYaqbZ0_AGq3ASTg',{title:'Sample Database Application - Customer Details',height:'480',width:'660',maxWidth:'1000',modal:true,dialog:null},'t-Dialog--wizard',$('#my_button'));
    

    Obviously, you will not be able to use the Protection of the Session State for the P7_CUSTOMER_ID dialog page item, so you set the page of dialogue level attribute Access Protection Page to the Unrestricted.

    The amount of control that see you in the URL is really just to protect the dialog box itself.

    Concerning

    Patrick

  • Update of popup when the export dialog box is open

    I am writing an export plugin to export images on my Web page. On the export dialog box, a drop-down menu to select the gallery where the image should I exported. Contextual menu items are read by the web server after the login information is validated, this product only when I update my login information.

    I wonder if there is no way to update the list at the opening of the export dialog box? Add a LrHttp.get call to the startDialog method an output error occurs.

    How can manage us such smart update function dynamically export gui?

    Best,

    Marcus

    You could link the 'items' of the popup_menu property to a key in the property table.  Then have an asynchronous task is the LrHttp.get () and update the value of this key.  In broad terms:

    f: popup_menu {points = LrView.bind ("menuItems")...}

    LrTasks.startAsyncTask (function)

    ... LrHttp.get ()...

    prop.menuItems =... get() property...

  • Refresh the page after registration in the pop-up dialog box

    I have a page that displays read values of VO. I have a contextual dialog which allow you to change the values.

    When I click ok in the dialog box, the changes are committed to the database, but the home page is not refreshed with the updated values.

    How to update?

    Hello

    How do view you vo as a table or a form?

    If the id of the button value context partialTrigger property table.

    and for the partialTrigger property for any attribute form.

Maybe you are looking for

  • Can I use music music of Apple to use in a video?

    If I buy a song at the moment, I can add to a video that I have edited on my phone. Can I do this with music from Apple's music?

  • PCB inspection system

    What is the conventional lighting used for PCB inspection system. I tried a linear led bar on 4 sides with a tilt, but am not satisfied with the result. Can you guys suggest me suitable lighting?

  • Pavilion J410: supported printer/scanner for Windows 8.1

    Hello 8.1 Windows does not support my printer/scanner HP J410.  It works on my laptop, but it's a pretty prehistoric, with Vista OS. So, what can I do for that device installed on Windows 8. 1 as well?

  • PC TURNS OFF WHEN I START A DOWNLOAD

    WHENEVER I TRY TO DOWNLOAD SOME TIME A CLICK RUN VISTA STOPS. IT IS SO FRAUTRATING BECAUSE I CAN NOT DOWNLOAD ANY PROGRAMS PLEASE HELP

  • Don't want to password at startup

    Hello! I have a question for the start (not slumber, but disabled) on Windows 7. He always asks me to connect with a password. Sometimes, I'd rather not have this happen - I just turns without password. Where should I go into Windows to disable passw