Help, need to add a delete button to my application?

i have a little application that you can add numbers and friends email too
i would like to add a minus selection/entry button?
do any of you guys have any ideas?
stop();
//create a new sql connection
var conn:SQLConnection= new SQLConnection();
//add an event handeler for the open event
conn.addEventListener(SQLEvent.OPEN, openHandler);
//create the database if it doesn't exist, otherwise just opens it
var dbFile:File =File.applicationDirectory.resolvePath ("exemplu.db");
conn.openAsync(dbFile);
function openHandler(event:SQLEvent):void {
//create a new sql statement
var sql:SQLStatement=new SQLStatement();
//set the statement to connect to our database
sql.sqlConnection=conn;
//parse the sql command that creates the table if it doesn't exist
sql.text= "CREATE TABLE IF NOT EXISTS contacte(" +
"id INTEGER PRIMARY KEY AUTOINCREMENT, " +
"nume TEXT, " +
"telefon INTEGER)";
//add a new event listener to the sql when it completes creating the table
sql.addEventListener(SQLEvent.RESULT,retrieveData);
//call the execute function to execute our statement
sql.execute();
function retrieveData(event:SQLEvent = null):void {
//create a new sql statemant
var sql:SQLStatement = new SQLStatement();
sql.sqlConnection=conn;
//this sql command retrieves all the fields from our
//table in the database and orders it by name
sql.text =  "SELECT id, nume, " +
"telefon " +
"FROM contacte ORDER BY nume";
//add a new event listener if there is data
//to display it
sql.addEventListener(SQLEvent.RESULT, selectHandler);
sql.execute();
function selectHandler(event:SQLEvent):void {
//first we clear our list
lister.removeAll();
//the we create a result variable that holds
//all our contacts
var result:SQLResult=event.target.getResult();
//we check if results is not empty
if (result!=null&&result.data!=null) {
//and we add a new item to our list for
//each contact in our database
for (var i:Number = 0; i < result.data.length; i++) {
lister.addItem ({ label:result.data[i].nume + "-" +result.data[i].telefon
, nr:result.data[i].id });
plus.addEventListener(MouseEvent.CLICK,adder);
xu.addEventListener(MouseEvent.CLICK,closeapp);
back.addEventListener(MouseEvent.MOUSE_DOWN,drag);
//because my buttons are not real buttons
//but movieclips i need to set the
//buttonMode property to true
plus.buttonMode=true;
xu.buttonMode=true;
function adder(e:MouseEvent):void{
//remove the eventlistener and move to the
//next frame
plus.removeEventListener(MouseEvent.CLICK,adder);
nextFrame();
function closeapp(e:MouseEvent):void {
//close the application
NativeApplication.nativeApplication.exit();
function drag(e:MouseEvent):void {
//drag the application
this.stage.nativeWindow.startMove();
this is on the second key frame-
//this line restricts the user input
//to just numbers in the phone input box
//add a new event listener to our plus button
plus.addEventListener(MouseEvent.CLICK,adder2);
function adder2(e:MouseEvent):void {
//create a new sql statement variable
var sql:SQLStatement=new SQLStatement();
sql.sqlConnection=conn;
//the next sql command creates a new entry
//in the table contacte from our database
sql.text =  "INSERT INTO contacte(nume, " +
"telefon)" +
"VALUES(@nume, " +
"@telefon)";
//to insert variables into sql commnads
//we use the parameters definition
sql.parameters["@nume"]=nume.text;
sql.parameters["@telefon"]=tel.text;
//add a new event listener that calls the
//function that retrieves the data
sql.addEventListener(SQLEvent.RESULT,retrieveData);
sql.execute();
//go to frame no. 1
prevFrame();
//remove the eventlistener from our plus button
plus.removeEventListener(MouseEvent.CLICK,adder2);

use:
minus_btn.addEventListener(Event.MouseEvent,CLICK, clear)
function clear(e:MouseEvent){
var sql:SQLStatement = new SQLStatement();
sql.sqlConnection = conn;
var s:String = "DELETE from contacte WHERE nume= :numeparam AND telefon=:telefonparam";
sql.text = s;
sql.parameters[":numeparam"] = whatever;
sql.parameters[":telefonparam"] = whatever else;
//add listeners if you want
sql.execute();

Similar Messages

  • UWL -- Need to add Thrash(Delete) Button

    Hi all,
    We are maintaing two tabs(Alerts and Notifications) in UWL and our clients wants to add "Delete" button at last of each lineitem(Subject,from,sent,priority,attachemtns), so client wants to delete unnessary notifications or alerts by pressing "Delete" button. I am not able to find any document how to maintain Icons in the Universal worklist. Please guide me if anybody come across thiw type of requirement or atleast let me know whether it can feasible in UWL.
    Thanks in advance
    Regards,
    Preetham

    Hi preetham,
    I am facing same issue.
    Could you please describe?
    Thanks

  • Captivate 4 - I need to add a Email Button that reads Submit

    I looked in the Help feature for Captivate 4 and couldn't find my answer.
    So my predecessor put a button on the quiz results page that would allow people to submit their quiz results to the LMS. I am unable to recreate this button. When I look at the button on projects she created, it is showing as an "email button". I have no clue how to add an "email button". I also can't copy/paste the button from one project to another. Nor can I copy/paste the slide from one project to another.
    Anyone have a clue how I add a "email button" from scratch?
    Here is a screen shot that partially shows the quiz results page, and the properties window for the button. THANK YOU for all the help!!!!!

    Hi Rick, thanks for the response. I appreciate it!
    So the issue isn't what the buttons are doing on the actual quiz slides, it's needing to add an Email button on the slide that gives the final scoring information (the reporting slide?). The screen shot you have shown me, isn't that the submit button on the quiz slides, not the final scoring slide?
    As you can see here, I have the Submit button on quiz slides:
    When I look at the properties of this Submit button, it shows as a Text button, not an Email button like the Submit button on the reporting slide is.
    Now I know you are probably thinking I should just click the drop down and select "email", but that selection is not there:
    Here are screen shots of my Quiz preferences and Reporting preferences:
    What I need to create is a Submit button on the reporting slide for the quiz that is an Email button. Like this one:
    When I look at the properties of this Submit button, it is an Email button. Notice how the tab says "Email Button" and not "Submit button" like the other properties windows for the other "Submit" buttons.
    This is where I'm stuck. When I go to Captivate projects that have a reporting page with a Submit button, I can't copy/paste the button. I tried to do a right click and I don't have a copy option:
    When I higlight Submit and go to Edit, I don't see the option to copy the button there either.
    So I figured I would copy the slide to the presentation that needs this Submit/Email button and I can't copy/paste the slide either. When I do a right click on the slide, there isn't a copy option:
    When I go to to Edit to try to copy the slide, the option isn't there either:
    I am really thinking that the Submit button the final reporting slide for the quiz is a Widget of some sort. Hum.
    Thanks! Karen

  • Add a delete button

    Hi all,
    I'm trying to add a delete button on the search page in the Content server (Search tab) but I don't know which service and template I must edit. Have anybody an idea?
    Thanks in advance!

    Hi,
    Well I would just be concerned with a delete button on the search page simply because it's a very easy to use delete button. When you delete, there's a good chance you're loosing content permenetly and if someone takes the time to check something in to a content managment system that person probably felt there was some value at some time for that content.
    Deleting just scares me a bit, though it also has it's purpose as well. If at all possible though I'd rather expire content, espesially if it's something you may need later. You could also archive it off. Every organization is different though, it's a very subjective decision.
    From you reply though, I do have one word of caution; You don't want to delete directly from the database. You absolutly want to call a service for that. There are a number of tables that need to be updated when a delete happens in addition to a variety of application events that fire including search indexing.
    I think John(JRS) is right that you'll probably need to loop through all the revisions and call the delete service for each one. The repository manager is able to delete all revisions of a document with one click though, so there may be an undocumented "super" delete service hanging out there as well.
    What I might do make the "Delete" button an expire button and just set the expiration date using an update service call. From there, you could the remove expired content using archiver jobs, perhaps as a monthly administrative process. There's also a way to set up a trash can delete, so the content can be brought back.
    Thanks
    David

  • I need to add and delete individuals.

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/867558]]</blockquote>
    I need to add and delete individuals. How do I do that?

    Individual what?

  • Without data in textfield and datagrid if i click add or delete button it should through msgbox

    hi friends ,,
                     i am new to flex i am doing a application in flex4,i need help from this, i have two text inputs and one datagrid, and one add button and delete button.
    my requirement is without data if i click add or delete it should through error box how to do that,
    In 3 condtition it should  thorugh error or msg box;
    conditions are,
                      1.both textinputs and datagrid----> click (add or delete)--->error or msg box
                       2.both textinputs dont have value and datagrid have values----> click (add or delete)--->error or msg box
                       3..both textinputs  have value and datagrid  dont have values----> click (add or delete)--->error or msg box
    any suggession or snippet code are welcome
    Thanks in advance,
    B.venkatesan.

    Hi,
    Please try following code:
    <?xml version="1.0" encoding="utf-8"?><s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="
    library://ns.adobe.com/flex/spark" xmlns:mx="
    library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
     <fx:Declarations>
     <!-- Place non-visual elements (e.g., services, value objects) here -->
     </fx:Declarations>
     <fx:Script>
    <![CDATA[
     import mx.collections.ArrayCollection; 
    import mx.controls.Alert; 
    public function check():void{ 
    if(input1.text=="" || input2.text=="" || Dg1.dataProvider==""){
    Alert.show(
    "Enter the text boxes and DataGrid.");}
    else{Alert.show(
    "Do not Enter the text boxes DataGrid."); 
    ]]>
    </fx:Script>
     <s:TextInput x="77" y="107" id="input1"/>
     <s:TextInput x="254" y="107" id="input2"/>
     <mx:DataGrid x="80" y="150" id="Dg1">
     <mx:ArrayCollection>
     </mx:ArrayCollection>
     </mx:DataGrid>
     <s:Button x="95" y="329" label="Add" click="check()" />
     <s:Button x="290" y="329" label="Delete" click="check()"/></s:Application>
    I am keeping Arraycollection empty for example.Please try when you provide data to Arraycollection.
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • How to add the delete button

    Hello Guru's and Experts.
    I am working on a change request , the change request is as follows
    Once a cost simulation is run for a maintenance item and the data transferred to BI, it cannot be deleted from BI, only overwritten with an updated cost simulation. In the instance where the such items are no longer required to be included in the simulation, it must be made possible to delete the simulation costs in BI.
    The current design in my project significantly increases the effort required to identify unwanted cost simulations and greatly increases the potential for incorrect data to be used in Budgeting and forecasting.
    My question is how to add the delete functionality in the report. is it acheavable through the portal or WAD,
    iam new to SAP BI , if possible can anyone kindly suggest me the steps to do this functionality.
    Appreciate your quick response..
    Thanks
    Ravi.

    Hi Guru
    Thanks for your valuable information.
    We got the requirment changed now from the users , the delete button should display in the report, i mean in protal, Now the user wants to delete with the selection criteria, for example, once the user hits the row in the report, that means if he selects the Main work center, and selects the delete button , he wants all the data related to that main work center to be deleted.  and another senario is what ever row the user selects  the characteristics in the row, for example, if the user select  for any row, i mean it can be any cost center or fiscal year, maintaiance item, cost elements, ..etc.  
    Once the user  selects the row and hit the delete button,  and he wants to hit the save save button in the report to make sure it deleted, the other way around , if the dont want to hit save, then he wants the data to be in the report.
    In the above  scenario's  can  you please suggest me with the steps how can we acheive it.
    Please reply back if you need any other info., Apprieciate your quick response. its very urgent requirment which we have to start...
    sorry to bother u..
    Thanks
    Ravi.

  • Examples of Add and Delete buttons in Forms

    Hello, I have group project and we are having a hard time finding examples of how to add and delete records.
    We have tried for the add:
    INSERT INTO order_line VALUES
    (:orders.o_id,
    :order_line.inv_id,
    :order_line.ol_quantity);
    COMMIT;
    And this for the Delete:
    DELETE FROM order_line      WHERE
    o_id = :orders.o_id
    AND inv_id = :order_line.inv_id;
    COMMIT:
    We are just looking for a generic example of how the code should look. Please ignore any errors I may have typed I copied it from a print off.

    Please ask this question in the Forms discussion area instead of the Database discussion area.
    Thanks.

  • I need to add a new report to the application that is done using visual studio and SSRS and SQL Server 2008

    I have an application that is done using SSRS on visual studio and it connects to the report server on SQL server 2008 environment.
    I've been changing the existing reports using visual studio 2008 and modifying the reports on the report server. How do I add a new report to the application ? I created a new report and deployed it on the report server but it didn't show up in the application.
    I can access the application source code on visual studio 2010 and TFS (Team Foundation). Thanks. 

    Hi,
    I have a question. This application retrieves SSRS reports from the report sever. When I download the reports
    from the SQL Server I can open them in visual studio 2008 but they don't open in visual studio 2010. I can access the application files on visual studio 2010 and team foundation server 2010. I was unable to open team foundation server 2008 on visual studio
    2008. The issue is that I am unable to add a report with a new name to the application. I use visual studio 2008 to deploy the reports on the report server but it has to be the same name to be able to run the report from the application. I can deploy any report
    on the report server but I can't access it from the application unless it has to be the same name as the present reports. If I keep the report the same name then it will replace the old report and the new report will run from the application. But only if it's
     the same name. I guess when I add a new report to the application with a new name I am supposed to add a definition in the application C sharp files  on visual studio 2010 so that the new report will show in the application. What's your opinion
    ? I have attached 2 images of the application and team foundation server 2010 and the report server.
    Thanks. 

  • Help needed - OS Command foe deleting a file from Appplication server.

    Hi,
    I have requirement, where in i need to delete a file from the application server. It has to be done automatically. I thought of using OS Command for achieving the same. Can anyone help me in achieving it. The OS of my application server system is UNIX.
    Thanks in advance!!
    P.S: Points will be rewarded.

    Hello Sudeep,
    If you define the command for each operating system using transactions SM69 (You can test it with SM49) and then call it using SXPG_COMMAND_EXECUTE which contains a parameter defining the operating system (SY-OPSYS)
    then it does not matter which operating system is running, the function module always calls the correct version of the command.
    So, for example you could define a command 'OS_COMMAND'
    which deleted a file. This would have one version for Dos
    which said 'del', and a second version for unix which said 'rm'.
    The correct command would be specified by the call to SXPG_COMMAND_EXECUTE because the operating system parameter differentiates between the two commands.
    [USING PROCESS CHAINS IN SAP BW|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0a7cd90-0201-0010-49a1-d730a56895f4]
    SXPG_COMMAND_LIST_GET – Reads a list of external OS commands
    Thanks
    Chandran

  • Help needed to add an image to a datagrid cell in actionscript

    Morning all,
    I am still quite new to flex development and I have an application which uses xml to populate a datagrid. One of the row columns should display a small image but I don't know how to do that.
    Can anyone show me how to add an image to a datagrid cell in actionscript?
    I've added a sample of the code I have written already below. Any help would be much appreciated.
    Thanks in advance,
    Xander
    My XM
    <?xml version="1.0" encoding="UTF-8"?>
    <dataset>
    <modules>
    <module id="1">
    <icon>assets/sample_image1.png</icon>
    <key>core</key>
    <name>Core</name>
    <description>Description of module</description>
    <installed>Wednesday, 24th June 2009 @ 15:59 UK</installed>
    </module>
    <module id="2">
    <icon>assets/sample_image2.png</icon>
    <key>webproject</key>
    <name>Web Project</name>
    <description>Description of module</description>
    <installed>Wednesday, 24th June 2009 @ 17:32 UK</installed>
    </module>
    </modules>
    </dataset>
    My Actionscript
    private function dataSetHandler(event:Event):void {
        var ds:XML = new XML(event.target.data);
        var rows:XMLList = ds.elements('modules').elements('module') as XMLList;
        var columns:Array = new Array();
        for (var i:int=0; i<rows[0].elements().length(); i++) {
            var column:DataGridColumn = new DataGridColumn();
            var tag:String = rows.*[i].name();
            column.headerText = rows.*[i].name();
            column.dataField = rows.*[i].name();
            if (tag == 'icon') {
                var img:Image = new Image();
                img.id = "iconpath";
                img.width = 23;
                img.height = 20;
                img.source = rows.*[i].name();
               column.itemRenderer = img;   <-- this line shows as an error when I try to compile
            columns[i] = column;
        mydatagrid.columns = columns;
        mydatagrid.dataProvider = rows;

    you cant just set image object to itemrenderer, you need to use classfactory.
    http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_4.html

  • Help Needed to add Hyphen in REGEXP_REPLACE

    Hi All,
    I need a help to add hyphen in my select criteria so that it does not filter the hypen.
    I am using below REGEXP_REPLACE to get my output, everything is fine now except the Hyphen (-) character is not recognized.
    select REGEXP_REPLACE('abcd-efgh123{}$(),', '[^[a-z,A-Z,0-9,(,),{,},_,$,.,'',[:space:]]]*','') from dual;
    Can you please help?
    Thanks

    The hyphen has a special meaning inside a regular expression. You can use if you make clear that the extended meaning is not possible in this case.
    example
    with testdata as (select 'A-C' txt from dual union all
                      select 'X-12' txt from dual union all
                      select '1''2' txt from dual union all
                      select 'ab#' txt from dual union all
                      select '()' txt from dual union all
                      select 'a b*~' txt from dual union all
                      select 'ab' txt from dual union all
                      select 'abcd-efgh123{}$(),'  txt from dual
    select txt
          ,REGEXP_REPLACE(txt, '[^[a-zA-Z0-9(){}_$.''[:space:]-]]*','') keep_chars
          ,REGEXP_REPLACE(txt, '[[a-zA-Z0-9(){}_$.''[:space:]-]]*','') remove_chars
    from testdata;
    TXT     KEEP_CHARS     REMOVE_CHARS
    A-C     A-C     
    X-12     X-12     
    1'2     1'2     
    ab#     ab     #
    a b*~     a b     *~
    ab     ab     
    abcd-efgh123{}$(),     abcd-efgh123{}$()     ,I removed the comas. In case you want that char also to be removed just add it somewhere. It is not used as a separator in this specific case.

  • Help needed urgently! Accidentally deleted Excel sheet, then saved

    The back-story:  I was working with a spreadsheet in Microsoft Excel 2007, and I had it saved as a 97-03 document (Compatibility Mode). When I saved it, it said "minor loss of fidelity" and that some cell styles would need to be changed. It has been saying this every time I save the document for quite a file. I always just say "OK." This time, I decided I should try to figure out which cells it is referring to. It said there were 11 such cells, but didn't bother to tell me which ones. So I saved a second copy of the file, as "filename exp.xls," to experiment. Only, here's the problem:  When I saved this second copy, it gave me the "loss of fidelity" warning, and I clicked Cancel, not realizing this would prevent the second copy from saving. Now, I deleted one of the sheets in my workbook, and I saved the file. Turned out that sheet was the one with the errors, because it didn't give me the warning that time. But it also turned out that the sheet I had deleted (which contained a lot of information!) was now gone, because the back-up hadn't saved as I had intended it to.
    The process:  I did a System Restore to about six hours ago, to before I had made this deadly mistake, hoping it would revert my workbook and resolve the problem. Unfortunately, it looks like System Restore (although it was successful) doesn't revert any of your files to their older versions.
    The question:  Is there any way I can get this sheet back? I have backed up onto a flash drive everything that I have modified on my computer between the System Restore time and now. I am willing to do anything it takes to get the old version of my workbook back. There must be some back-up copy that MS Office has saved, in the cache or whatnot ... Is there any hope for me to revive all my hard work?
    I now know that in the future I will be even more extra careful to back up all my documents as frequently as possible ... but for now, I just want this one back! please help ...

    Unfortunately, I was never able to recover the document. It appears that any sheet you delete in Excel is permanently gone. The only solution is to make sure you back-up your files constantly, using a service like Mozy or Dropbox or Carbonite, or manually ... so that you have it saved somewhere else when you lose your work. =\

  • How to add a delete button on each row of the table.

    i create a table with a list , and i add a new column.
    and then i drag a delete botton from the list operation to the column.
    when i create several rows. and click any delete botton of the new created rows. all the new created rows will be deleted.
    rows that already exist when the page render are not influenced.and when i click these rows' delete botton,
    just the current row will be delete.
    that's because when i click the new created rows' delete botton,all the new created botton in this column will automatically be clicked.
    i think adf consider all the delete botton are the same one.
    is it the table bug? please tell me how to resolve this problem. thanks.
    Edited by: 917391 on 2012-3-21 下午6:53
    Edited by: 917391 on 2012-3-21 下午10:07
    Edited by: 917391 on 2012-3-21 下午10:16

    i don't use the adf BC, so it is not a VO. it's just a service method that return a list.
    and i create the datacontrol and drag it to the page.
    Edited by: 917391 on 2012-3-21 下午10:26

  • Help needed with a messageDialog without button

    Hi
    This is probably a quite easy problem but I havn't been able to get it working so I thought I should try to get some help.
    I'm trying to create a message dialog that pops up in the center of a JFrame just like when calling showMessageDialog(...). The problem is that my messageDialog is not supposed to be a standard message dialog but one with just some text and a progress bar. It is supposed to be visible until some processing in another thread is finished.
    I thought about using a JDialog but it could always be closed by pressing the X in the upper corner.
    Is there any way to disable the X in the corner of a JDialog or could anybody tell me a better way of doing this?
    Best regards
    Henrik

    with 1.4 you can also set the dialog to "undecorated" meaning you can have a modal dialog w/o the titlebar. InstallAnywhere has a similar progress interface and I think it looks really sharp. You can set an etched border or something on it so it looks good. A progress dialog with no buttons but a titlebar would look a bit goofy I think.

Maybe you are looking for