Command buttons best practice

Hello,
I would like to ask how others design their GUI with several command buttons (OK button Boolean).
For instance, there is a simple application where the user can start data acquisition by clicking on a button with text "Start monitoring". Instead of having another button with text "Stop monitoring", usually I just change the button label text into "Stop monitoring", so it is obvious to the user that again clicking on it will stop the monitoring process of the app (in the event case of this button I read out the actual label text with property node in order to decide which action to message to the DAQ loop from the GUI Event handler loop).
If I have another button with label text like "Start file record", I do the same way: after starting file record, I change the text to "Stop file record".
To avoid unnecessary extra programming, this button is only in Enabled state if the application is already in the "monitoring" state. Also, if there is an ongoing file record (+ DAQ obviously), the user cannot operate the "Stop monitoring" button. So depending on the state of the applications, some buttons are Enabled, some in "Disabled and grayed out" state.
I wonder how others are doing their GUI/application?
I am not sure if this is a good way to do, but at least I can avoid extra state check programming and minimizing the number of buttons...
Solved!
Go to Solution.

Also booleans can have three different images associated with them (well more for things like mouse over but that's not what  I mean).  You can have an image that is shown when the button it True, when the button is False, or an image that is shown when it is either False or True.  So on top of having the text show "Start" or "Stop" I usally replace the True image and the False image with a start and stop icon.  Customize the boolean control, and then right click and choose Import Picture From Clipboard and select the appropriate state.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

Similar Messages

  • Spark Panel close button best practice ?

    Hello,
    I would like to know what is the best practice to add a close button to a Panel and be able to skin it through CSS file ?
    If I add a [SkinPart(required="true")] meta data in the extended Panel for the button created in the Skin file, titleField becomes "null" (it is never created in partAdded() ).
    Many thanks,

    If you're using the beta 1 build, it could be you're running into http://bugs.adobe.com/jira/browse/SDK-21484?  If so, try swapping in the mxmlc.jar attached to that bug.
    Steve

  • Best Practice with Browser navigation buttons

    My Web Ap does a secured login and then the user is
    guided to various pages via Command buttons and links.
    The question I have is if the user presses the browser buttons to
    go back the various prior screens appear with waht the user
    entered. I do ot want this.
    What is the best practice to stop this functionality and or capture a event
    that f the user does this the screens are cleared?

    (I believe all Faces page navigation is done via POST (command{Button,Link}).)
    In our app (pre-Faces, but now we're moving to Faces, and I just can't tell you how much fun it is grafting Faces onto an old JSP/servlet app), we chose to open a new window when the user logs in, without browser decorations (i.e., navigation buttons). (This is done via javascript window.open(), with the appropriate options.)
    The old window can't be closed due to Javascript security constraints, so we redirect it to another page so the user won't be confused if he or she stumbles across what looks like a login page (by exposing that old window).
    After that, it's mostly an effort in user education: we just don't tell them about things like alt-left-arrow to go back or F5 to refresh or right-click anything (except View Source when we're debugging a problem). If they're "smart", we tell them "Don't do that", where "that" is either "stick your finger in your eye" or "use alt-left-arrow", depending on your sense of humor and ability to parse my idiomatic English.
    [There's an old joke in which a man goes to a doctor and says "Doctor, my eye hurts".  The doctor says "Hmm, can you tell me more?"  The patient says "Yes, it hurts when I do [i]this," and proceeds to jab his finger into his eye. The doctor says, "Ah, I see. Well, don't that any more," and the patient walks away satisfied with his "cure."]
    John.

  • Command Authorization Config best practice using ACS

    Hi
    Is there any best practices for configuring Command authorization (for router/switch/asa) in CS-ACS? To be specific, is there any best practices to configure authorization for a set of commands allowed for L1,L2,L3 support levels?
    Regards
    V Vinodh.

    Vinodh,
    The main thing here is to ensure that we have backup/fall-back method configured for command authorization, inorder to avoid lockout situation or do wr mem once you are sure configs are working fine.
    Please check this link,
    http://www.cisco.com/en/US/products/sw/secursw/ps2086/products_configuration_example09186a00808d9138.shtml
    Regards,
    ~JG
    Do rate helpful posts

  • Best Practice for validating radio buttons

    Hi,
    I'm building a form which has quite a lot of questions that a
    user answers my selecting a radio button. All the questions are
    required. Could someone please advise me what the best practice is
    for validating a radio button in a radio button group is checked?
    There doesn't seem to be much information out there on this
    one???
    Thanks...

    Have you found a solution? If yes can you please give me a
    short description?
    Thanks.

  • OS X Server 3.0 new setup -- best practices?

    Alright, here's what I'm after.
    I'm setting up a completely new OS X Server 3.0 environment.  It's on a fairly new (1.5 year old) Mac Mini, plenty of RAM and disk space, etc.  This server will ONLY be used interally.  It will have a private IP address such as 192.168.1.205 which will be outside of my DHCP server's range (192.168.1.10 to .199) to prevent any IP conflicts.
    I am using Apple's Thuderbolt-to-Ethernet dongle for the primary network connection.  The built-in NIC will be used strictly for a direct iSCSI connection to a brand new Drobo b800i storage device.
    This machine will provide the following services, rougly in order of importance:
    1.  A Time Machine backup server for about 50 Macs running Maverics.
    1a.  Those networked Macs will authenticate individually to this computer for the Time Machine service
    1b.  This Server will get it's directory information from my primary server via LDAP/Open Directory
    2.  Caching server for the same network of computers
    3.  Serve a NetInstall image which is used to set up new computers when a new employee arrives
    4.  Maybe calendaring and contacts service, still considering that as a possibility
    Can anyone tell me the recommended "best practices" for setting this up from scratch?  I've done it twice so far and have faced problems each time.  My most frequent problem, once it's set up and running, is with Time Machine Server.  With nearly 100 percent consistency, when I get Time Machine Server set up and running, I can't administer it.  After a few days, I'll try to look at it via the Server app.  About half the time, there'll be the expected green dot by "Time Machine" indicating it is running and other times it won't be there.  Regardless, when I click on Time Machine, I almost always get a blank screen simply saying "Loading."  On rare occasion I'll get this:
    Error Reading Settings
    Service functionality and administration may be affected.
    Click Continue to administer this service.
    Code: 0
    Either way, sometimes if I wait long enough, I'll be able to see the Time Machine server setup, but not every time.  When I am able to see it, I'll have usability for a few minutes and then it kicks back to "Loading."
    I do see this apparently relevant entry in the logs as seen by Console.app (happens every time I see the Loading screen):
    servermgrd:  [71811] error in getAndLockContext: flock(servermgr_timemachine) FATAL time out
    servermgrd:  [71811] process will force-quit to avoid deadlock
    com.apple.launchd: (com.apple.servermgrd[72081]) Exited with code: 1
    If I fire up Terminal and run "sudo serveradmin fullstatus timemachine" it'll take as long as a minute or more and finally come back with:
    timemachine:command = "getState"
    timemachine:state = "RUNNING"
    I've tried to do some digging on these issues and have been greeted with almost nothing to go on.  I've seen some rumblings about DNS settings, and here's what that looks like:
    sudo changeip -checkhostname
    Primary address = 192.168.1.205
    Current HostName = Time-Machine-Server.local
    The DNS hostname is not available, please repair DNS and re-run this tool.
    dirserv:success = "success"
    If DNS is a problem, I'm at a loss how to fix it.  I'm not going to have a hostname because this isn't on a public network.
    I have similar issues with Caching, NetInstall, etc.
    So clearly I'm doing something wrong.  I'm not upgrading, again, this is an entirely clean install.  I'm about ready to blow it away and start fresh again, but before I do, I'd greatly appreciate any insight from others on some "best practices" or an ordered list on the best way to get this thing up and running smoothy and reliably.

    Everything in OS X is dependant on proper DNS.  You probably should start there.  It is the first service you should be configuring and it is the most important to keep right.  Don't configure any services until you have DNS straight.  In OS X, DNS really stands for Do Not Skip.
    This may be your toughest decision.  Decide what name you want the machine to be.  You have two choices.
    1: Buy a valid domain name and use it on your LAN devices.  You may not have a need now for use externally, but in the future when you use VPN, Profile Manager, or Web Services, at least you are prepared.  This method is called split horizon DNS.  Example would be apple.com.  Internally you may name the server tm.apple.com.  Then you may alias to it vpn.apple.com.  Externally, users can access the service via vpn.apple.com but tm.apple.com remains a private address only.
    2: Create an invalid private domain name.  This will never route on the web so if you decide to host content for internal/external use, you may run into trouble, especially with services that require SSL certificates.  Examples might be ringsmuth.int or andy.priv.  These type of domains are non-routable and can result in issues of trust when communicating with other servers, but it is possible.
    Once you have the name sorted out, you need to configure DNS.  If you are on a network with other servers, just have the DNS admin create an A and PTR record for you.  If this is your only server, then you need to configure and start the DNS service on Mavericks.  The DNS service is the best Apple has ever created.  A ton of power in a compact tool.  For your needs, you likely need to just hit the + button and fill out the New Device record.  Use a fully qualified host name in the first field and the IP address of your server (LAN address).  You did use a fixed IP address and disabled the wireless card, right?
    Once you have DNS working, then you can start configuring your other services.  Time Machine should be pretty simple.  A share point will be created automatically for you.  But before you get here, I would encourage starting Open Directory.  Don't do that until DNS is right and you pass the sudo changeip -checkhostname test.
    R-
    Apple Consultants Network
    Apple Professional Services
    Author, "Mavericks Server – Foundation Services" :: Exclusively in the iBooks Store

  • Best practice for mouseless ADF applications

    I am developing an ADF application where the users do not want to use the mouse.
    So I would like to know if there are a best practice for this?
    I am already using the accessKey functionality and subforms defaultCommand
    But I have had problems setting focus to objects on a page like tables. I would like a button to return the focus to the table after it has made the command like delete.
    I have implemented a solution where I have found inspiration several threads and other webpages (see below).
    Is this solution okay?
    Are there any problems with it?
    I would also like to know if there are better pathways to go like
    out of the box solutions,
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/79-global-template-button-strategy-360139.pdf (are there an example implementation?), or
    http://one-size-doesnt-fit-all.blogspot.dk/2010/11/adf-ui-shell-supporting-global-hotkeys.html
    in advance thanks
    Inspiration webpages
    https://blogs.oracle.com/jdevotnharvest/entry/how_to_programmatically_set_focus
    http://technology.amis.nl/2008/01/04/adf-11g-rich-faces-focus-on-field-after-button-press-or-ppr-including-javascript-in-ppr-response-and-clientlisteners-client-side-programming-in-adf-faces-rich-client-components-part-2/
    how to Commit table by writting Java code in Managed Bean?
    Table does not refresh and getting error as UIComponent is Null
    A short description of the solution:
    (jdeveloper version 11.1.1.2.0)
    --- Example where I use onSetFocus in jsff page
    <af:commandButton text="#{hrsusuiBundle.FOCUS}" id="cb10"
    partialSubmit="true" accessKey="f"
    shortDesc="Alt+Shift+F"
    actionListener="#{managedBean_clientUtils.onSetFocus}">
    <af:clientAttribute name="focusField" value="t1"/>
    </af:commandButton>
    --- Examples where I use doTableActionAndSetFocus in jsff page
    --- There have to be a binding in the jsff page to delete, commit and rollback
    <af:commandButton text="#{hrsusuiBundle.DELETE}" id="cb4"
    accessKey="x"
    shortDesc="Alt+Shift+X"
    partialSubmit="true"
    actionListener="#{managedBean_clientUtils.doTableActionAndSetFocus}">
    <af:clientAttribute name="focusField" value="t1"/>
    <af:clientAttribute name="actionField" value="Delete"/>
    </af:commandButton>
    <af:commandButton text="#{hrsusuiBundle.COMMIT}" id="cb5"
    accessKey="s" shortDesc="Alt+Shift+S"
    partialSubmit="true"
    actionListener="#{managedBean_clientUtils.doTableActionAndSetFocus}">
    <af:clientAttribute name="focusField" value="t1"/>
    <af:clientAttribute name="actionField" value="Commit"/>
    </af:commandButton>
    <af:commandButton text="#{hrsusuiBundle.ROLLBACK}" id="cb6"
    accessKey="z" shortDesc="Alt+Shift+Z"
    partialSubmit="true"
    actionListener="#{managedBean_clientUtils.doTableActionAndSetFocus}"
    immediate="true">
    <af:resetActionListener/>
    <af:clientAttribute name="focusField" value="t1"/>
    <af:clientAttribute name="actionField" value="Rollback"/>
    </af:commandButton>
    --- This is the java class I use
    --- It is published in adfc-config.xml as a request scope managedbean
    public class ClientUtils {
    public ClientUtils() {
    public void doTableActionAndSetFocus(ActionEvent event) {
    RichCommandButton rcb = (RichCommandButton)event.getSource();
    String focusOn = (String)rcb.getAttributes().get("focusField");
    String actionToDo = (String)rcb.getAttributes().get("actionField");
    UIComponent component = null;
    String clientId = null;
    component = JSFUtils.findComponentInRoot(focusOn);
    clientId = component.getClientId(JSFUtils.getFacesContext());
    if ( "Delete".equals(actionToDo) || "Commit".equals(actionToDo) || "Rollback".equals(actionToDo) ){
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding operationBinding = bindings.getOperationBinding(actionToDo);
    Object result = operationBinding.execute();
    AdfFacesContext.getCurrentInstance().addPartialTarget(component);
    if (clientId != null) {           
    makeSetFocusJavaScript(clientId);
    public static String onSetFocus(ActionEvent event) {
    RichCommandButton rcb = (RichCommandButton)event.getSource();
    String focusOn = (String)rcb.getAttributes().get("focusField");
    String clientId = null;
    if (focusOn.contains(":")) {
    clientId = focusOn;
    } else {
    clientId = findComponentsClientIdInRoot(focusOn);
    if (clientId != null) {           
    makeSetFocusJavaScript(clientId);
    return null;
    private static void writeJavaScriptToClient(String script) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ExtendedRenderKitService erks = null;
    erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
    erks.addScript(fctx, script);
    public static void makeSetFocusJavaScript(String clientId) {
    if (clientId != null) {
    StringBuilder script = new StringBuilder();
    //use client id to ensure component is found if located in
    //naming container
    script.append("var textInput = ");
    script.append("AdfPage.PAGE.findComponentByAbsoluteId");
    script.append ("('"+clientId+"');");
    script.append("if(textInput != null){");
    script.append("textInput.focus();");
    script.append("}");
    writeJavaScriptToClient(script.toString());
    public static String findComponentsClientIdInRoot(String id) {
    UIComponent component = null;
    String clientId = null;
    component = JSFUtils.findComponentInRoot(id);
    clientId = component.getClientId(JSFUtils.getFacesContext());
    return clientId;
    }

    Hi,
    I am developing an ADF application where the users do not want to use the mouse. So I would like to know if there are a best practice for this?
    Well HTML (and this is the user interface you see) follows a tab index navigation that you follow with "tab" and "shift+tab". Anything else is a short cut for which you use mnemonics (as you already do) or shortcuts (explained in http://one-size-doesnt-fit-all.blogspot.dk/2010/11/adf-ui-shell-supporting-global-hotkeys.html). There is a distinction to make between non-web environments (which I think you and your users have abackground in) and client desktop environments. Browsers block some keyboard functionality for their own purpose. So you may have to find a list of keys first that work across browsers. Unlike desktop clients, which allow you to "press a button" without the button to take focus, this cannot be done on the web. So you need to be clever here, avoiding buttons at all.
    The following paper is about JavaScript in ADF and explains the basics for what Chris Muir explains in : http://one-size-doesnt-fit-all.blogspot.dk/2010/11/adf-ui-shell-supporting-global-hotkeys.html
    http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
    It has the outline for how to register short cut keys that perform a specific action (e.g. register ctrl+d to delete the current row you are on, or press F11 to execute a query (similar to Oracle Forms frmres files)). However, be aware that this includes some code you have to write (actually quite some code to be honest).
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/79-global-template-button-strategy-360139.pdf (are there an example implementation?), or
    http://one-size-doesnt-fit-all.blogspot.dk/2010/11/adf-ui-shell-supporting-global-hotkeys.html
    Actually these are implementations as they come with example code for you to use and customize, do they? So what is this question asking for more ? Also note that global buttons don't quite have anything in common with the question you asked. I assume you want to see it as an implementation of the Forms toolbar that operates on the form or table the focus is in. This however does not work for the web as there is nothing that keeps track of which component has a focus and to what iterator (data block) it belongs. This would involve even more coding (though possibly doable)
    Frank

  • ADF JSF 10.13 how do you reference a binding from a command button?

    I have developed the following code as a model as I am trying to utilise ADF JSF without using a database.
    I have a collection called School. This has the appropriate operations that populate the school with a number of Child. A Child simply has a firstname and a surname.
    I have generated data controls for these collections and created two JSP pages and added a navigation link as follows:
    index.jsp --> goToSchool (navigation) --> school.jsp
    I have then added a command button to the index.jsp page. When the button is then pressed the school.jsp page is displayed. This works correctly.
    I would like to override the action of the button though so that before the navigation is executed I can get a handle on the school collection and populate it so that it will be displayed on the school.jsp page.
    I have previously done this in 10.12 when I had the following setup:
    index.jsp --> getSchool (dataAction) --> school.jsp
    by overriding the getSchool dataAction.
    I have looked through the 10.13 ADF user guides and tried various different things but have not managed to successfully acheive my goal of populating the school collection when the button is pressed prior to navigating to the school.jsp page.
    I would appreciate it if you could offer any advice, and if possible let me know the recommended best practices to acheive this.
    Thanks in advance for your help
    David

    Check out the ADF Tutorial (TopLink edition) chapter 5 has a section called:
    Adding a Drilldown Link
    I think this is what you are looking for.
    http://www.oracle.com/technology/obe/ADF_tutorial_1013/ADF_tutorial.pdf

  • _msdcs subdomain best practice with NS records?

    I have the _msdcs subfolder under my domain (the grey folder). example below
    It has only one DC inside of it for a NS server. This DC is old and no longer exists. I checked my test environment and it has the same scenario (an old DC that does that not exist). example below
    I'm just wondering:
    1) Is this normal, should this folder update itself with other servers?
    2) should I be adding one of my other DC's? and removing the original?
    I have a single forest, single domain setup 2008 functional level. My normal
    _msdcs Zone does behave as expected and removes and add the appropriate records. Thanks.

    I apologize for the late response. I see you've gone further than what I've recommended.
    No, you shouldn't have deleted the _msdc.parent.local zone!!!!!! I'm not sure why you did that. Are you working with someone else on this that recommended to do that? If not,
    you're over-thinking it. I provide specifics to fix it by simply  updating the NS records, that's it. If you only found the _msdcs folder had the wrong record, then that's all you had to change.
    In cases where DCs are removed, replaced, upgraded, etc, it's also best practice to check a few things to make sure things are in order, and one of them is check the NS records on all zones and delegations. Delegation's NS records won't update
    automatically with changes, but zone NS records will if DCs are properly demoted.
    The _msdcs delegated zone is required by Active Directory. And yes, based on your thread subject, it's best practice. When Windows 2000 came out, and IF you had created the initial domain with it, it did not have it this way, but all domains initially created
    with Windows 2003 and newer are designed this way. If you had upgraded from 2000 to 2003, then one of the steps that we must perform is to create the _msdcs delegation.
    Please re-create it in this order:
    In the DNS console, right-click Forward Lookup Zones, and then click
    New Zone. Click Next
    On the Zone Type page in the New Zone Wizard, click
    Primary zone, and then click to select the Store the zone in Active Directory check box. Click
    Next
    On the Active Directory Zone Replication Scope page, click "To all DNS servers in the Active Directory forest parent.local.
    On the Zone Name page, in the Zone Name box, type
    _msdcs.parent.local
    Complete the wizard by accepting all the default options.
    After you've done that:
    Delete the _msdcs subfolder under parent.local.
    Right-click parent.local, choose New Delegation.
    Type in _msdcs
    In the Nameserver page, type in the name of your server, and its IP address.
    Complete the wizard
    You should now see a grayed out _msdcs folder under parent.local.
    Go to c:\windows\system32\config\ folder
    Find netlogon.dns and rename it to netlogon.dns.old
    Find netlogon.dnb and rename it to netlogon.dnb.old
    Open a command prompt
    Run ipconfig /registerdns
    Run net stop netlogon
    Run net start netlogon
    Wait a few minutes, then click on the _msdcs.parent.local zone, and click the F5 button to refresh it.
    You should see the data populate.
    Ace Fekay
    MVP, MCT, MCITP/EA, MCTS Windows 2008/R2 & Exchange 2007, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP - Directory Services
    Technical Blogs & Videos: http://www.delawarecountycomputerconsulting.com/
    This post is provided AS-IS with no warranties or guarantees and confers no rights.

  • Best Practice Suggestions?

    Hey CF World,
    I have to revamp an online order process. The process is broken into 4 steps.
    The app as it exists today was built by a different developer and for the life of me, I have wasted about 5 hours trying to figure out exactly what the person is doing in the code just so I can make some basic tweaks to the process.
    Could anyone offer what might be considered today's best practice for a step by step order process?
    The thought is, if the user could complete step 1, upon clicking next the data elements of the form would be validated and then they would be taken to step 2, etc, etc... until the end where upon submission, the order would then be written to the database and next process triggered internally.
    Should I have one page that upon submit of step 1 cycles back to itself, processes the data and then loads a separate div of info for step 2 or...?
    Any suggestions would be great.  Thank you so much in advance for your help, I sincerely appreciate it.
    Ciao'
    D.

    I'm not going to attempt to answer the user interface side, that's not my area of expertise.
    In terms of validation, ideally this should occur at three levels
    1) Client-side - immediate response. Traditionally this is Javascript. For instance, if the user tries to enter a letter into a numeric field, they get feedback as soon as they press the button.
    1a) Client side - on submit. Any extra validation (blank mandatory fields, comparison of fields) that doesn't require a trip to the server. Also traditionally Javascript.
    2) Application level. Assume that the user had Javascript disabled, and none of your previous validation had happened. Also, there are tools such as Firebug that let them edit your HTML before running it: adding extra items to a SELECT, for instance. Redo all previous validation!
    This is also where you check things against your database - and parameterise any database interface. SQL injection is a Bad Thing. Do as much as you can via stored procedures called by CFCs, and if your code only needs read access, use a datasource that only has read access.
    3) Database level. Assume they've somehow got in via a route other than your application: maybe a malicious or careless employee using command-line SQL. Enforce all business rules and all data integrity constraints at database level: constraints, triggers, whatever your database provides.
    Sounds horribly paranoid, doesn't it? But that trick of editing the SELECT is done by 13-year-olds hacking games, so if you're dealing with real money and adults, it's the sort of thing you have to allow for.

  • Best Practice: Executing the same code from different triggers

    Swing supports the idea of Actions, which seems to be an implementation of the "Command" pattern. One can create an instance of an Action implementation and set it to several JComponents, like JButton and JMenuItem. Whenever the button or the menu item is triggered, the action gets executed. So far, so good.
    But there are more triggers in Swing that cannot get configured to trigger an action, namely Drops and pressing the window's [X] Close icon. Certainly these fire events, but they do not automatically trigger actions.
    Certainly one can react to importData(TransferSupport) and windowClosing() by manually calling the action's actionPerformed(ActionEvent) method, but as there is no setAction(Action) method at neither the TransferHandler class nor the WindowAdapter class, the question is: Where to take that Action instance from, and what command name to pass to it's constructor, and what to provide as the event source?
    It just seems like the Action framework has a gap here, as it nicely covers these questions for JComponents, but not for JFrame and JDialog.
    So unless there are JFrame.setDropAction(Action) and JFrame.setCloseAction(Action) methods added to the Swing framework (and I doubt they will get added any time near), my question is whether there have been establed some widely accepted best practices (i. e. something that 75% of the programmers will do, not something ONE programmer always does but just he does). Any Swing expert here answering this?

    The window decorations are handled by the OS. That [X] close button isn't a JButton at all.
    JFrame's and JDialog's, however, do have a root panes. And you can ask the root pane to take over window decorations via JFrame#setDefaultLookAndFeelDecorated(true). JDialog has a similar method. When the root pane takes over window decorations, then the [X] icon is a JButton and you could, in theory, set its action to an Action object.
    The the metal LAF window decorations, however, are ugly (I think at least) and I'm not sure how many programs actually use it.

  • Best Practice for Designing Database Tables?

    Hi,
    I work at a company for tracking devices (GPS Devices). Our SQL Server database is designed to have a table for each device we sell, currently there is 2500 tables in our database and they all have the same columns they only differ in table name. Each device
    sends about 4K records per day.
    currently each table hold from 10K records to 300K records
    What is the best practice to design a database in this situation? 
    When accessing database from a C# application, which is better to use, direct SQL commands or views? 
    a detailed description about what is best to do in such scenario would be great. 
    Thanks in advance.
    Edit:
    Tables columns are:
    [MessageID]
          ,[MessageUnit]
          ,[MessageLong]
          ,[MessageLat]
          ,[MessageSpeed]
          ,[MessageTime]
          ,[MessageDate]
          ,[MessageHeading]
          ,[MessageSatNumber]
          ,[MessageInput]
          ,[MessageCreationDate]
          ,[MessageInput2]
          ,[MessageInput3]
          ,[MessageIO]

    Hello Louis, thank you so much for your informative post. I'll describe in detail what situations I came through my 9 months of work in the company (working as a software engineer, but I am planning to take over database maintenance since no one is maintaining
    it right now and I cannot do anything else in the code to make it faster)
    At every end of the month our clients generate report for the previous month for all their cars, some clients have 100+ cars, and some have few. This is when real issue start, they are calling their data from our server through internet while having 2000
    unit sending data to our server, they keep on getting read time out since SQL Server gives priority to insert and hold all select commands. I solved it temporary in the code using "Read Uncommitted" once I initialize a connection through C#. 
    The other issue is generating reports for a month or two takes lots of time when selecting 100+ units. Thats what I want to solve, the problem is the one who wrote the C# app used hard coded SQL Statements
    AND
    the company is refusing to upgrade from SQL Server 2003 and Windows Server 2003. 
    Now talking about reports, there are summary reports, stops reports, zone reports ..etc most of them depend usually on at least MessageTime, MessageDate, MessageSpeed, MessageIO and MessageSatNumber.
    So from your post I conclude that for now I need to set snapshots so that select statements don't get kicked out in favor for insert commands, but does SQL Server automatically select from the snapshots or do I have to tell it to do so? 
    Other than proper indexing what else I need? Tom
    Phillips suggested Table partitioning but I don't think it is needed in my case since our database size is 78GB
    When I run code analysis on the app, Visual Studio tells me I better use stored procedures, views than using hard coded Select Statements, what difference will this bring me when talking about performance?
    Thanks in advance. 

  • IPhone Best Practices - A Work In Progress

    Hello all. I've been tasked with introducing my coworkers into the inner workings of the iPhone, and there are a good number of pointers that I find myself saying over and over again. I'd like to share my best practices with everyone, as well as collect more pointers and opinions from the community at large.
    Care and Handling:
    First - wash your hands, often. Now I know we all do this often anyway, but I'd like to point out that a healthy amount of hand washing will really go a long way to keep your iPhone screen smudge free. The worst offender, unfortunately, is doughnuts. A small layer of sugar will render that area un-tappable, without any real indication that it has done so. If you are frantically tapping the screen on the iPod button and nothing is happening, clean your phone before you do a hard reset.
    Second - Pockets. Keeping your phone in your front pocket is natural and what most of us do. In these summer months, however, keeping your phone in a sweaty front pocket can do a good deal to the dirt level of the screen. If you find yourself cleaning your phone constantly, try a belt clip.
    Lastly - Battery Life. Your iPhone's battery life is in your hands, literally. Being aware of your power consumption and planning accordingly is going to be infinitely more important that the battery's native charge-holding ability. This goes especially for the day of purchase - as tempting as it may be to open the box and activate, immediately running around the house watching YouTube, it is best to let the phone charge for 12 hours before use. Charging the phone every night is an absolute must, skipping a day will kill the battery life as your ride the bottom edge the following day. Most of us have access to a USB port while we're at work, best idea will be to plug in your phone when you sit down at your desk.
    iPod:
    Large Libraries: In the opening weekend, I got many complaints that you cannot manually manage your music. There is a workaround that has made me change the way I work with all of my iPods: the iPhone specific playlist. Simply create a playlist with all of the music you wish to put on your phone and sync that one playlist. This also helps with sync time - you have a start sync and an end sync, not a constant sync all throughout your music management, slowing your computer down in the process.
    TV Shows: I watch a lot of MST3K, which I have organized into iTunes as TV shows, split into seasons, the works. The problem that has arisen, therefore, is the one of selective synchronization - you cannot specifically select the TV show you want to sync to the device, instead getting the choices to sync all, unwatched, or latest shows. This is problematic when each show is 700MB large. Here's the work around - select all of the episodes of a specific show and right click, selecting "Mark as Not New", removing all of the little blue dots from the episodes. Select the one, three, or five episodes, and right click them, selecting "Mark as New", then sync the last one, three, or five unwatched episodes. The shows you selected will sync.
    iPhoto:
    Many users are complaining that iPhoto opens whenever the phone is connected. This is not a preference of the phone, but rather iPhoto. Remember when you first launched iPhoto and it asked you if you wanted to use iPhoto whenever your camera was attached? iPhoto is detecting that your phone is a camera and launching, just as you told it to do.
    Mail:
    POP accounts - too many unread messages: When first adding a POP account, all of the messages downloaded to the phone arrive as unread. Tapping a message, tapping back, and then tapping the next message can get tedious. Here's the workaround - tap the small down arrow to the upper right hand side of the screen, watching closely to the number next to Inbox. When that number goes down by one, tap the arrow again. If that number hasn't gone down yet, wait a sec, and do not try to tap tap tap tap tap, you'll flood the input queue and crash Mail.
    Syncing Mail accounts - All too often people blame the iPhone when their mail does not work. A perfect test is sync you accounts from Mail. If they work in mail, they'll work on the phone, if they are unreliable in Mail, they will also be unreliable on the phone. The Mail client on the iPhone is just as powerful as any other mail client in terms of how it connects to mail servers, if you are having problems you need to check your settings before blaming the hardware. If you prefer to leave your install of Mail.app alone, create a new user account on your Mac, set up all of the accounts you want there, and use iTunes to sync that data to the phone. Make sure to remove that portion of sync from your actual user account's instance of iTunes, however, or it will all sync back.
    This message has not been downloaded from the server: This message has snagged a couple users, but upon investigation, these users have filled their iPhones to the absolute brim with music and video. It hasn't been downloaded from the server because there is no space to download to - this also applies to the Camera application dumping to the Home screen. Because there is no space, it can't add any new data. Make some room, then be patient as the mail client gets to that message in cleanup (often a sync or reboot will clear it up).
    Safari:
    Safari and iPod: Many users have reported iPod stopping in the middle of browsing, often pouting and pursing their lips crying, "This is terrible, I can't even browse the web and listen to music at the same time?". I then check their phone, and lo and behold they have upwards of eight separate pages open at the same time. This device (like every other computer out there) has a finite amount of memory, each page taking up a significant portion depending on how busy the page is. I've routinely gotten through entire albums while browsing through Safari, but I've got one page open in total, and it's usually mostly text. Keep it to one or two pages open and iPod will run forever if you let it.
    Web Apps: "This web app is terrible, it keeps booting me to Home!" When was your last reboot? How many other pages are open? In the same vein as Safari and iPod, Web Apps need a good deal of breathing room - give it to them. Close down other pages, stop iPod, or even reboot. Give the app a clean slate and it will perform, every time. iPhoneRemote users will attest to this.
    iCal:
    Multiple Calendars - Default Calendar: When adding a new appointment, it adds to the default calendar. Appointments can't be shunted to the correct calendar until after sync anyway, so create an "iPhone" calendar and make that the default. Because it's in that calendar, you'll know enough to move it to the appropriate calendar after sync.
    Please feel free to add your own best practices, and ask questions, too.

    is there any application you can get for the iphone to enlarge text and phone numbers ?
    If included with an email or on a website, yes with no application needed.
    If you are referring to the text size for your iPhone's contact list, no.
    can you insert a phone number from your contact list into a text message ?
    No.
    i cant seem to figure it out, does the alarm clock work if you turn off the phone at night,
    No - powered off with the iPhone means powered off. Any phone that provides for this is not powered off - it is in deep sleep or deep standby mode, which the iPhone does not support. If you don't want your phone ringing or don't want to receive SMS at night but you want to use the iPhone's alarm feature as a wake-up alarm, you can turn on Airplane Mode before going to bed, which will also conserve the battery if your iPhone is not plugged in at night.
    can you send a multi media text message ?
    No.

  • Command button remains disabled after a request redirect to a PDF Servlet

    Hi All,
    I've a command button to generate PDF on the fly and used to work in JDev 10.1.3.3.
    When we migrated to 11g, it works for the first time on a page, and the file Open/Save dialog will come up.
    But then the command button remains grayed out, and clicking doesn't generate a server call.
    If I do something on the page which does a partial or full submit, then the button will get enabled again.
    Any suggestions?
    Thanks,
    Jaimon
    Sample code:
    Facelets:
    <af:commandButton text="Create PDF" action="#{fs02.createPDF}" />
    Java:
    public String createPDF() {
    //Validation checks here. If there are any errors, it gets added to FacesMessages to display on the same page.
    if(!validate()) {
    //sf.addInfoMessage('message here..');
    }else {
    FacesContext ctx = FacesContext.getCurrentInstance();
    HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
    HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
    RequestDispatcher rd = request.getRequestDispatcher("/pdfdownloader");
    rd.forward(request, response);
    ctx.responseComplete();
    return null;
    pdfdownloader is mapped as a servlet, which writes the actual PDF content as a stream.

    Herewith the code which is triggered with the post-forms-commit trg. As far as I can see it, there is no code to disable/enable the save button in the menubar.
    ===
    PROCEDURE validate_enbr_records IS
    CURSOR c_enbr
    IS
    SELECT exlb.exlb_length
    , enbr.enbr_ind_break
    FROM dog_envelop_breaks enbr
    , dog_extrnl_labels exlb
    WHERE enbr_appl_cod = :flow_appl_cod
    AND enbr_flow_cod = :flow_cod
    AND enbr_sort_seqnr <> :enbr_sort_seqnr
    AND enbr_appl_cod = exlb_appl_cod
    AND enbr_exlb_cod = exlb_cod;
    CURSOR c_exlb
    IS
    SELECT exlb_length
    FROM dog_extrnl_labels
    WHERE exlb_appl_cod = :flow_appl_cod
    AND exlb_cod = :enbr_exlb_cod;
    l_lengte_break_label NUMBER := 0;
    l_lengte_sort_label NUMBER := 0;
    l_length NUMBER := 0;
    l_aant NUMBER := 0;
    r_enbr c_enbr%ROWTYPE;
    mi_id MenuItem;
    BEGIN
    FOR r_enbr in c_enbr LOOP
    IF r_enbr.enbr_ind_break = 'Y'
    THEN
    l_lengte_break_label := l_lengte_break_label + r_enbr.exlb_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + r_enbr.exlb_length;
    END IF;
    l_aant := l_aant + 1;
    END LOOP;
    OPEN c_exlb;
    FETCH c_exlb INTO l_length;
    CLOSE c_exlb;
    IF :enbr_ind_break = 'Y' THEN
    l_lengte_break_label := l_lengte_break_label + l_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + l_length;
    END IF;
    IF l_lengte_break_label > 48
    THEN
    qms$errors.show_message('DOG-10194');
    END IF;
    IF l_lengte_sort_label > 50
    THEN
    qms$errors.show_message('DOG-10195');
    --set_record_property(3,'enbr',status,changed_status);
    END IF;
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    END;
    ===
    After the message has been throughn and the OK-button has been clicked, the code is never reaching the code:
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    The save-button remains disabled.
    Best regards
    John.

  • Best Practices:: How to generate XML file from a ResultSet

    Hi all,
    Could someone please suggest the best practices of how to generate an XML file from a resultset? I am developing a web application in Java with Oracle database and one of my tasks is to generate an XML file when the user, for example, click a "download as XML" button on the JSP. The application is basically like an Order with line items. I am using Struts and my first thought has been to have an action class which will extend struts's DownloadAction and through StAX's Iterator API to create an XML file. I intend to have a POJO which will have properties of all columns of my order and line items tables so that for each order I get all line items and:
    1. Write order details then
    2. Through an iterator write line items of that order to an XML file.
    I will greatly appreciate for comments or suggestions on the best way to do this through any pointers on the Web.
    alex

    Use a OracleWebRowSet in which an XML representation of the result set may be obtained.
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/oracle10g/webrowset/Readme.html
    http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/jcrowset.htm

Maybe you are looking for

  • Installation on Vista Issue!!

    I am running into problems installing Flash remoting on new vista machine on both business and ultimate versions with both get error 1606. could not access network location %SystemDrive%\inetpub\wwwroot\flashremoting cannot seem to find a solution..h

  • Order of photos into a book

    I have 400 photos I wish to import into a book. The max pages pf a book is 100. I wish to design the pages and then import the phots in a pre arranged order to save time. Is this possible?  have done the following. I have used autoflow and it does no

  • Ios operating system order of packet flow

    Is there a DETAILED packet processing flow chart for IOS (specially the ISR platform)? Something like; packet comes to input interface -->      decision branches (depending on processing modes, route, inspection processes, session, policy lookup, nat

  • Error on installation: printer keeps searching for updates.

    I get an error on installation: printer keeps "searching for updates" Installation is OK, printer works, but because of the continued messaging on the printer, the screen on printer is unusable. Any ideas? 

  • Problem deploying an ADF Application - SOLVED

    I am having a problem deploying an ADF Faces + BC4J application to my 10.1.3.1 App server. When I deploy to the Jdev embedded oc4j or to a standalone oc4j from Jdeveloper, everything works fine, but when I deploy to the app server, the first page sub