How to terminate remaining Actions in a script sequence if the user presses "Cancel" during SaveAs

Hello,
I'm using the following script to email a completed form to a pre-programmed email address and would like a way to cancel remaning in-line scripts if the user cancels teh first Step.
Basically, after completing the form I cereated, the user would click the submit button and a series of actions will take place:
1. Execute a menu item: SaveAs giving the user a chance to Save the current state of the form.
[Here is where I need a Arcobat script that terminates all remaning actions if the user cancels the SaveAs action]
2. Once the form has been saved (and not canceled), the next action involves prepping and generating an email to send the form using the user's default email client:
var e = this.getField("ccAdd");  //There is a field on the form that enables the user to enter a CC: address, if applicable
var cCCAddr = e.value;
   var cSubLine = "Subject goes Here"; //preformatted subject
   var cBody = "File attached." // preformatted Body text
   // Build the e-mail URL
   var cEmailURL = "mailto:[email protected]?cc=" + cCCAddr
                 + "&subject=" + cSubLine
                 + "&body=" + cBody;
//Before sending, set ALL form fields to "readonly"
for (var i = 0; i < this.numFields; i++) {
    var fname = this.getNthFieldName(i);
    var f = this.getField(fname);
        f.readonly = true;
// hide submit display button, so that it doesn’t show on “readonly” version
var h = getField("Button1");
h.display = display.hidden;
//Generate the outgoing email using the user’s default email client. Send attachment as a PDF
   this.submitForm({cURL: cEmailURL, cSubmitAs:"PDF", cCharSet:"utf-8"});
3. Once the form has been emailed, another SaveAs menu item fires, thereby, allowing the user to save the "readonly" version.  So now, he has a clean "open version"  that he saved before Step #2, and a "readonly" version after step #2.
The only thing that's causing an issue now is if the user presses Cancel after the Step #1  (where he/she is asked to save the form), the remaining scripts in-line continue to fire, alougth the "Cancel" button was pressed. 
SO, I need a script that terminates all remaining scripts (i.e. end process) if the user hits cancels during Step #1, thereby preventing step 2 from starting.
Any ideas? Thanks in advance.
S

ok, i've had a play with it . . . and come up with two options, one that breaks attempts to break any code being run if the cancel button is hit.  either way, they need to be added into a document level javascript, and applies the required action to your submit button (trust me, this becomes a lot easier than applying script to buttons directly!)
i just wrote functions that chain, so the first function calls the second, and the second calls the third.  seemed easier than trying to nest them.  i know the finaliseForm function simply calls the first in the chain, but that's just a matter of personal preference, i prefer to define functions with logical names.  also, that way, you can test each function individually, or all together, and write more code to the finaliseForm function if you need to.
not sure if you're using acrobat 9 or X, but the document level javascript is in two different places.  in 9 it's under advanced - document processing - document javascripts.  just give it a name, add it, remove any lines in the window that appear and paste in this code.
so here's the one that continues the script, with prompts, even when the no button is hit. let me know how you go!
function saveasEditable() {
    //prompt the user to continue save as
    var saveasPrompt = app.alert({
                cMsg : "Do you want to save an editable version of this file before emailing?",
                cTitle : "Save As Editable Form",
                nIcon : 2,
                nType : 2
    //where 4 is yes and 3 is no
    if (saveasPrompt == 4) {
        app.execMenuItem("SaveAs");
        emailForm();
    } else {
        emailForm();
function emailForm() {
    //and invoke a second alert to prompt emailing the form
    var emailPrompt = app.alert({
                cMsg : "Do you wish to email the form now?",
                cTitle : "Submit form via email",
                nIcon : 2,
                nType : 2
    if (emailPrompt == 4) {
        var e = this.getField("ccAdd"); //There is a field on the form that enables the user to enter a CC: address, if applicable
        var cCCAddr = e.value;
        var cSubLine = "Subject goes Here"; //preformatted subject
        var cBody = "File attached."// preformatted Body text
            // Build the e-mail URL
            var cEmailURL = "mailto:[email protected]?cc=" + cCCAddr
             + "&subject=" + cSubLine
             + "&body=" + cBody;
        //Before sending, set ALL form fields to "readonly"
        for (var i = 0; i < this.numFields; i++) {
            var fname = this.getNthFieldName(i);
            var f = this.getField(fname);
            f.readonly = true;
        // hide submit display button, so that it doesn’t show on “readonly” version
        var h = this.getField("Button1");
        h.display = display.hidden;
        //Generate the outgoing email using the user’s default email client. Send attachment as a PDF
        this.submitForm({
                cURL : cEmailURL,
                cSubmitAs : "PDF",
                cCharSet : "utf-8"
        saveasReadonly();
    } else {
function saveasReadonly() {
    //and invoke a third alert to prompt save of the read only form
    var readonlyPrompt = app.alert({
                cMsg : "Do you wish to also save a read-only copy of this file?",
                cTitle : "Save As Read-only Copy?",
                nIcon : 2,
                nType : 2
    if (readonlyPrompt == 4) {
        app.execMenuItem("SaveAs");
    } else {}
function finaliseForm() {        saveasEditable();
//assign all of this to the submit button from the doc level
this.getField("Button1").setAction("MouseDown", "finaliseForm();");

Similar Messages

  • How to create a program that accepts 5 digits from the user between 0 and 9

    how to create a program that accepts 5 digits from the user between 0 and 9 then put them in ascending order using link-list method..

    You can use a scanner to get user input from the command line.
    import java.util.*;
    public class Test {
        private List<Integer> list;
        private Scanner in;
        public static void main (String... args) {
            new Test ();
        public Test () {
            list = new LinkedList<Integer> ();
            in = new Scanner (System.in);
            for (int i = 0; i < 5; i ++) {
                System.out.format ("Please enter a number (%d more): ", (5 - i));
                list.add (in.nextInt ());
            Collections.sort(list, new Comparator<Integer> () {
                public int compare (Integer i1, Integer i2) {
                    return i2 - i1;
            System.out.println (list);
    }

  • How do I resend an invite email for one of the user in my Aruba Central account?

    Q: How do I resend an invite email for one of the user in my Aruba Central account?
    A: Aruba Central allows administrator to create multiple user of different access levels to help manage the system.  As new uses are created by administrator, an invitation email is sent to the user's email address to activate the account. 
    In certain situations, these emails get into spam or junk folders with no visibility to end-user. These are cases, where re-sending an invitation email is of much helpful.
    Follow these steps to resend invite email to a specific user:
    Login to Aruba Central and click on "All Groups"
    In the left-menu, click on "Maintenance" and then "User Management"
    Clik on "Resend Invite email" and mention the email address you wanted to send the invite again:

    By default, the Menu Type option for menus is set to Top Level Pages. You can change this behavior by choosing Menu Type > All Pages from the menu options. The steps to do this are described in Adding a Horizontal Menu widget

  • How do I run a script so that the user does not have to click into and out of a read-only calculated numeric field?

    Hi all
    I have a read-only calculated field, and I want to build actions on it, dependent on what the answer to the calculated field is.
    I have used action builder, and it works, but only if the form filler clicks in and out ("exits") the field, which they didn't have to enter in the first place, because it populates as a result of a previous script.
    To be more precise, The questions asked before this field are:
    Date of submission (submitdate):
    Date of event (eventdate):
    Calculation occurs (days between event and submission), and answer is populated in a field called 'daysbetween'
    Now I have a set of conditions:
    If the daysbetween is < or = 14, then I want a message to come up saying ineligible to apply
    If the daysbetween is >14 and < or = 28, then I want a message to come up saying a fast track fee will be applied, and I want the fast track fee box to be populated, and I want the fast track fee box to appear.
    I used the action builder to get all of this to work, except that it only works if the user then clicks in and out of  the 'daysbetween' field, which they shouldn't have to, because it's already calculated for them
    I feel like I have to put this script in an earlier field...but I don't know where - action builder won't let me do it in the 'eventdate' field
    Thanks in advance

    Put a shift register on the border of your loop. Have a case statement that contains the "Get time" function in one case of the case statement. Make that case = 3 and wire the loop iteration to the case selector. Have the time value loaded onto the shift register in the "2" case (interations count from zero), have the shift register passed through on all others ("Default"). Then subtract this time from current to get elapsed time. You probably want to put the subtraction/comparison in a "sub-case" in the "default" that only is valid for interations > 3 or you will get some really ugly "times" until the shift register is loaded, or you could initialize it from outside the loop with the time, but this will cause it to show elapsed times from the beginning that suddenly jump back to a low number after iteration 2.
    P.M.
    @ Corning? Which one? I was doing LabVIEW at Corning back in '96
    Message Edited by LV_Pro on 09-23-2005 10:07 AM
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion
    Attachments:
    elapsed time.vi ‏24 KB

  • How do I compare two csv files and not disable the user if the username is found in the 2nd file using powershell?

    Hi Guys
    I have two csv files with the following headers and I need to import both files into the script to check whether the StaffCode is present in the Creation/Renewal of Contract csv in a DisableAccount Script so I can stop any action to disable the account as
    the staff has renewed the contract with the company so the account should not be disabled.
    However my accounts are still being disabled. I am not sure now to construct the query so that it detects that the account is to be left alone if the staffcode is present in both files
    I does recognize that the $staffcodeN in the renewal file matches the $staffcode in the termination file
    but still proceeds to disable or set an expiry date to the account anyway based on the termination file. 
    How do I stop it from doing that?
    1)In the Creation/Renewal of contract file the following headers are present
         -  TranCode,StaffCode,LastName,FirstName,SocialSecurityNo,DateJoin,Grade,Dept,LastUpdateDate,EffectiveDate
    2)In the Disable of contract file the following headers are present
        - TranCode,StaffCode,LastName,FirstName,SocialSecurityno,LastDateWorked,Grade,Dept,LastUpdateDate,
    My data is not very clean , I have a-lot of special characters such as = , ' ,/ and \ characters to remove first before i can compare the data
    Thanks for the help in advance.
    Yours Sincrely
    Vicki
    The following is a short snippet of the code 
    $opencsv = import-csv "D:\scripts\Termination.csv"
    $opencsv2 = import-csv "D:\scripts\RenewContractandNewStaff.csv"
    foreach ($usertoaction in $opencsv) 
    $Trancode = $usertoactionTranCode
    $StaffCode = $usertoaction.StaffCode.replace("=","").replace('"','')
    $LastName = [string]$usertoaction.LastName.Replace("/","\/").Replace(",","\,")
    $FirstName = [string]$usertoaction.FirstName.Replace("/","\/").Replace(",","\,")
    $socialsecurityno = $usertoaction.SocialSecurityNo.replace("=","").replace('"','')
    $DateJoin = $usertoaction.DateJoin.replace("=","").replace('"','')
    $LastDateWorked = $usertoaction.LastDateWorked.replace("=","").replace('"','')
    $Grade = [string]$usertoaction.Grade
    $Dept = [string]$usertoaction.Dept
    $LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
    $AccountExpiry = [datetime]::Now.ToString($LastDateWorked)
    foreach ($usertoaction2 in $opencsv2) 
    $TrancodeN = $usertoaction2.TranCode
    $StaffCodeN = $usertoaction2.StaffCode.replace("=","").replace('"','')
    $socialsecurityNoN= $usertoaction2.SocialSecurityNo.replace("=","").replace('"','')
    $DateJoinN = $usertoaction2.DateJoin.replace("=","").replace('"','')
    $GradeN = [string]$usertoaction2.Grade
    $DeptN = $usertoaction2.Dept
    $LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
    $EffectiveDate = $usertoaction.EffectiveDate.replace("=","").replace('"','')
    $LastName2 = [string]$usertoaction2.LastName.Replace(",", "").Replace("/","").trim()
    $FirstName2 = [string]$usertoaction2.FirstName.Replace("/","").trim()
    # Use DirectorySearcher to find the DN of the user from the sAMAccountName.
    $Domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
    $Root = $Domain.GetDirectoryEntry()
    $Searcher = [System.DirectoryServices.DirectorySearcher]$Root
    $Searcher.Filter = "(sAMAccountName=$samaccountname)"
    $doesuserexist1 = $Searcher.Findall()
    if ($doesuserexist1 -eq $Null)
    {Write-Host $samaccountname "account does not exist"}
    elseif ($StaffCodeN -match $staffcode)
    write-host "user has renewed the contract, no action taken"
    else
    if(($lastupdatedate -ne $null)-or($LastDateWorked -ne $null))
                        write-host "Setting Account Expiry to"$accountexpirydate
    #$ChangeUser.AccountExpires = $accountexpirydate
               #$Changeuser.setinfo()
    if ($UserMailforwarding -ne $null)
    #Set Account expiry date to Last Date Worked
    # $ChangeUser.AccountExpires = $accountexpirydate
    # $Changeuser.setinfo()
     write-host "staff" $displayname "with staff employee no" $samaccountname "has                          
    mailforwarding" 
    Write-host "Please disable the account manually via Active Directory Users & Computers and 
    Elseif ($accountexpirydate -lt $todaysdate)
    #disable the account

    Hi Vicki,
    This Forum has an insert-codeblock function. Using it will make your script far more readable
    Your script is missing some parts, it is impossible to follow the problem.
    You are performing the same string cleaning action on $opencsv2 for each element in $opencsv, when doing it once should suffice. Why not start it all by cleaning the values and storing the cleaned values in new arrays?
    The Compare-Object function is great, why not take it out for a stroll on these lists, it might just safe you lots of unnecessarily complicated code ...
    You are creating a new $Domain, $Root and $Searcher object each iteration, when doing it once should suffice. Probably not much of a time-saver, but every little thing contributes.
    Try pinpointing the problem by doing extensive logging, not only by writing which action was taken, but writing the inidividual information (variables, mostly) before evaluation occurs. Your if/elseif/else looks sound, so if it's still not doing what you
    want, the ingoing data must be different from what you think should be there.
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • How to know that the user pressed the refresh button??

    hi there..
    how can i no that the user has pressed the browser "Refrsh" button so that i can respond with the appropriate action????
    thanx..

    Well, you can't know if refresh was pressed vs. hitting enter in the location bar to trigger a refresh. There isn't any simple way to know, though. Some kind of page hit counter or something, maybe.

  • How to change company logo dynamically using login information of the user in flex4 CSS styl method?

    hi all,
    I am doing mxml flex4 web application. i am using a login in my application. this login for multi user  purpose.
    My need is when a user login using his username and password his company logo should show the top of my application and his copyright details show the bottom of my application
    if another user login means his company logo and copywrights should show in my application.
    This logo and copyrights details should change dynamically based on the login information.
    I want to create this using CSS file (skins and sparks)
    How to do this,i am struck in this place,
    Looking for useful and helpful suggession or snippet code,
    Thanks in advance,
    Cheers,
    B.Venkatesan.

    If the user is logging in, presumably you are having the user hit a back end web-server and database and using something like Blaze to connect? Right?
    I personally would not do this with CSS. I would map the company icons to the users in the DB, retrieve the proper company icon and then pass it down (or embed it in the app) when the user logs in. Then, I would just set the source of the icon to be what I passed down:
    Add your image where you want it to go:
    <s:Image id="emptyImage" x="locationx" y="locationy".../>
    Then in your ActionScript, when the user logs in and you know what company the user belongs you could do this:
    private function loginUserBlazeResponse(resultEvent:ResultEvent):void {
    var bytes:ByteArray = ByteArray(resultEvent.target);
    emptyImage.source = bytes;
    addElement(img);
    img.visible = false;
    img.addEventListener(FlexEvent.UPDATE_COMPLETE, imageLoaded);

  • Script to get the user details by running a view from powershell

    Hi,
        I have a use-case of getting the list of users, who got modified in last one week or so. There was no direct way of getting the results as office-365 doesn't have the option. As i posted in a forum they suggested to use view based for retrieving
    the user details. I was able to get some user details through UI. When i asked for the option of getting it from powershell they suggested to post in this forum. Link on the question posted in forum is
    community.office365.com/en-us/forums/148/p/212305/646170.aspx#646170 your help is appreciated. Thanks in Advance

    Hi Sam,
    My list of servers are exported from CMDB data base and filter criteria i have used is role,status and first few characters of the server name.
    $CIlist = Import-Csv C:\Scripts\DiskSpace\Servers_CI.csv
    $diskspace = @()
    $CIlist | where {($_.Name -like '*XXXXXXXX*') -and ($_.Role -like '*XXXXXXXXXX*') -and ($_.Status -like '*XXXXXXXXXXXXXX*') } |
    select Name | FT
    # This part gives the list of servers.
    # below script gives the hard disk details of servers from a list
    $comp= Get-Content "C:\Scripts\DiskSpace\systems.txt"
    $diskvalue = @()
    foreach($pc in $comp)
    if (test-connection -CN  $pc -Count 1 -erroraction silentlycontinue)
        $diskvalue += Get-WmiObject -Class Win32_logicaldisk -ComputerName $pc -Filter DriveType=3 | 
        Select SystemName , DeviceID , @{Name=”size(GB)”;Expression={“{0:N1}” -f($_.size/1gb)}}, @{Name=”freespace(GB)”;Expression={“{0:N1}” -f($_.freespace/1gb)}}
        $diskvalue | Export-Csv C:\Scripts\DiskSpace\DiskReport.csv -NoTypeInformation
    else
    "$pc `t offline" | Out-file C:\Scripts\DiskSpace\offlinesystems.csv -encoding ASCII -append
    Is there any option to pass the result of first part to second part without exporting to a csv ot txt. or club this both together ??
    ToJo

  • How to show list of items when the user pressed tab key in an empty field

    Hi all
    i would like to know if there is a way to open a form with items list which will be shown to the user when he pressed the tab key within a field for instance "item code" field will present a search form with a table filled with item codes and their description.
    i'm currently working in 2004 version. i know how to catch the event.
    i'm creating a form with a matrix object binded to a datasource which is connected to the data base table which contains all the items.
    what would like to know if there is a better way to this. maybe using buisness partner objects. and if so how
    appriciate the help
    Yoav

    You Should use Formatted Search in this case.
    You must create and associate a query for your field.
    click on the field you want items to be listed and press Shift + F2
    catch the keydown event of this field  and check pval.charpressed = 9 (tab key press)
    then execute
    SBO_Application.SendKeys("+")

  • How can I get BCC to present timestamps localized for the user

    I work on an ATG deployment has Internal users accessing a server located in Washington from all over the world. The users want to see all timestamps presented in their timezone (10/18/2011 09:30 Pacific Daylight Time is 10/19/2011 12:30 China Standard Time) not the timezone of the server. How can I get this effect in the BCC?
    Bob

    I do not see that form in the page source, so it looks that it the login form gets created via JavaScript and the Firefox Password Manager doesn't work in such cases. Form fill may store the name.

  • Vb scripts to remove the user from the member of perticular group (say from domain admin) from windows servers 2003 and 2008

    Hi,
    I need VB script which to checks the perticular user in AD and if it exists;that user needs to be removed from the member of perticular group
    Ex:- Lets say
    I have a user 783562 , I need to search this user in AD to verify user exists or not. If not then I no need to remove the mebership from perticular group
    Second scenario:-
    If user exists then I need to remove the user membership from the perticular group.I want to do it in automation
    Manual Path:-
    1.Type dsa.msc in run command of IT session(we using it to connect remote desktop).
    2. Select the domain & right click (EX:-corp.ds.xxyyzz.com) and select "Find" to find the user form the domain.
    3. Type the user name in the Name field and click on "Find Now" button user name will be displayed in search result.
    4. Double click on this user ID and select "Member Of" tab.
    5. Select any member of group from the Name section then click on "Remove" button.
    6. Finally click on "Apply" and "OK" button.
    Kindly help me out to do this by using vb script.
    Thanks
    Raja

    Usage: CScript NameOfVBS.vbs //NOLOGO /User:Jane.Doe /GroupDN:CN=Group1,DC=Contoso,DC=com
    Option Explicit
    On Error Resume Next
    Dim str_User
    Dim str_GroupDN
    Dim obj_Connection
    Dim obj_Command
    Dim obj_RootDSE
    Dim str_DNSDomain
    Dim str_Base
    Dim str_Filter
    Dim str_Attributes
    Dim str_Query
    Dim obj_RecordSet
    Dim obj_Group
    Dim str_ADsPath
    Dim obj_User
    str_User = WScript.Arguments.Named("User")
    str_GroupDN = WScript.Arguments.Named("GroupDN")
    If Len(Trim(str_User)) > 0 And Len(Trim(str_GroupDN)) > 0 Then
    Set obj_Connection = CreateObject("ADODB.Connection")
    Set obj_Command = CreateObject("ADODB.Command")
    obj_Connection.Provider = "ADsDSOOBject"
    obj_Connection.Open "Active Directory Provider"
    Set obj_Command.ActiveConnection = obj_Connection
    Set obj_RootDSE = GetObject("LDAP://RootDSE")
    str_DNSDomain = obj_RootDSE.Get("defaultNamingContext")
    str_Base = "<LDAP://" & str_DNSDomain & ">"
    str_Filter = "(&(objectCategory=person)(sAMAccountName=" & str_User & "))"
    str_Attributes = "cn,ADsPath"
    str_Query = str_Base & ";" & str_Filter & ";" & str_Attributes & ";subtree"
    obj_Command.CommandText = str_Query
    obj_Command.Properties("Page Size") = 1000
    obj_Command.Properties("Timeout") = 1
    obj_Command.Properties("Cache Results") = False
    Set obj_RecordSet = obj_Command.Execute
    obj_RecordSet.MoveFirst
    If obj_RecordSet.RecordCount = 0 Then
    WScript.Echo str_User & " was not found"
    Else
    Set obj_Group = GetObject("LDAP://" & str_GroupDN)
    str_ADsPath = obj_RecordSet.Fields("ADsPath")
    Set obj_User = GetObject(str_ADsPath)
    obj_Group.Remove(obj_User.AdsPath)
    If Err.Number = 0 Then
    WScript.Echo str_User & " was removed from group " & str_GroupDN
    ElseIf Err.Number = -2147016651 Then
    WScript.Echo str_User & " not a member of group " & str_GroupDN
    Else
    WScript.Echo str_User & " error removing from group " & str_GroupDN
    End If
    End If
    End If

  • Unix script for checking the user account status

    Hi All,
    i have created one unix script to check the status of the user in diff databases.
    #!/bin/ksh
    useracctreport.txt if [ ! -f hh ];
    then
    echo "Database file does not exist"
    fi
    echo "Enter Username"
    read USER
    echo "Enter the password"
    stty -echo
    read PASS
    stty echo
    for j in `cat users`
    do
    j="`echo $j| tr '[a-z]' '[A-Z]'`"
    for i in `cat hh`
    do
    sqlplus -s $USER/$PASS\@$i <<EOF >> useracctreport.txt
    column USERNAME format a8
    column ACCOUNT_STATUS format a5
    !echo "*****User $j Status in $i DB*****"
    select USERNAME,ACCOUNT_STATUS from dba_users where username=('$j');
    select OBJECT_TYPE,count(*) from dba_objects where owner='$j' group by object_type;
    EOF
    done
    done
    In log file ,i get the below error when its unable to connect to the DB.
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    ERROR:
    ORA-01017: invalid username/password; logon denied
    Is there any way i can supress this error?
    and is there any other way i can make this script faster.Thanks a lot for your help

    Hi,
    The failing line is
    sqlplus -s $USER/$PASS\@$i <<EOF >> useracctreport.txtYou should test the connect statement you provide to sqlplus. For example:
    CONSTRING=$USER/$PASS\@$i
    echo Connect string used: $CONSTRING
    sqlplus -s $CONSTRING <<EOF >> useracctreport.txtCheck the echoed value. It's malformed. Correct it appropriately.
    Yoann.

  • How to make JTable editable by me but not by the user?

    Hi. I am doing an application to show data in a JTable.
    I need to update the data but do not want the user to change the data.
    Could somebody tell me how to do it?
    Thanks a lot!

    Yes, the above solution is clean. To add a little bit, if you donot want to have a JDialog to your application, just check for the password that is sent in an argument at the start of the application.
    java MyApp <password> // to be run by you
    java MyApp // to be run by user
    This would check the password and then sets the edit mode for the table. (But mind you, this can be done only at the start). If you want to determine the editing mode during the runtime, then you have to go for a login dialog. But, as far as I can imagine, you develop the application and will give it to the user. Is that correct?
    Thanks,
    Kalyan

  • Script to list the users and their privileges in a database

    Hi Team,
    Can someone provide me a script that list all the users and their privileges in a database?
    DB version:11.2.0.2
    OS:AIX

    Osama_mustafa wrote:
    Why you create your own script
    SELECT * FROM USER_SYS_PRIVS;
    SELECT * FROM USER_TAB_PRIVS;
    SELECT * FROM USER_ROLE_PRIVS;
    That won't tell him what privileges a user has via a role. It will only tell him what privilges were granted directly, and what roles were granted directly. But those roles have privileges, and may have other roles, which have still more roles and privs, etc. It's a recursive issue and a simple select from user__privs won't get it.
    Pete Finnigan has a good script for reporting the entire picture. I leave it as an exercise for the student to use google to find it. I have already given all the information needed to complete that exercise.

  • How can I still be able to execute some codes after user press Ctr-C

    When user press Ctr-C to exit my program, I want to do something before the program terminated, how can I do that?
    Thanks for help.

    BOOL CtrlHandler(DWORD fdwCtrlType)
    switch (fdwCtrlType)
    // Handle the CTRL+C signal.
    case CTRL_C_EVENT:
    Beep(1000, 1000);
    return TRUE;
    default:
    return FALSE;
    * Class: alexiworld_yahoo_com_CtrlCHanler
    * Method: init
    * Signature: (V)V
    JNIEXPORT void JNICALL Java_alexiworld_yahoo_com_CtrlCHanler_init
    (JNIEnv *env, jobject this)
         SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlHandler, TRUE);
    }

Maybe you are looking for

  • "Layout" option in iPhoto 09 - multiple photos per page

    I am trying to printing several different photos on a single page. While I can achieve this by selecting a smaller image size and letting iPhoto arrange them automatically I would like to adjust the layout. When I selected "Layout" (under "customize"

  • Jumper Settings for new Hard Disks in RAID

    How do i have to jumper new disks which should be added to my RAID. In factory settings they come with the cable select setting. Do i have to set all the jumpers to master or does cable select work too?

  • X-Fi's Mode Switcher reboots the system / EAX 5.0 issues

    I have strange problems with my Sound Blaster X-Fi XtremeMusic: When I'm trying to use a different audio mode (e. g. switching from Audio Creation Mode to Game Mode), my system restarts suddenly, like the same when I push the reset button on my compu

  • Can't re-install Mac OS X Lion

    I am not able to start my Macbook Air – I get the grey screen and revolving circle. So - I am trying to re-install Mac OS X Lion via the Command-R utility on start up. I am asked for my Apple ID and on entering it I get the message: "This Apple ID ha

  • Wait statement stuck in Invoice workflow BUS2081

    Hi, I have a problem in invoice workflow where it sends a mail and waits for 8 Hours for GR to be created. These steps are called in loop. After 8 hours it compares PO quantity with GR quantity and when GR is complete, it exits the loop. If GR is not