How to alter a button's enabled state from a script?

How do I enable a button's enabled state from a script?
The problem is, that I can't figure out how to reference that
button!!! Let's say I have this script:
pbPreviewTest.enabled() = lbTest.length >= 1;
OK... well how do I get my script to be able to access
pvPreviewTest and lbTest?
I got this mxml...
<mx:Button id="pbPreviewTest" label="Preview Test"
right="5" top="5" enabled="false"/>
and this also:
<mx:DataGrid id="lbTest" height="413" width="100%" y="31"
draggableColumns="false">
but it doesn't seem to work :(

This is my mxml, how do I access pbPreviewTest from the
application script?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Panel layout="absolute" top="0" bottom="0" left="0"
right="0">
<mx:Script>...
</mx:Script>
<mx:TextInput x="6" y="5" width="162"/>
<mx:Button x="176" y="5" label="S" width="22"/>
<mx:Button x="202" y="5" label="B" width="22"/>
<mx:VDividedBox id="div1" x="0" y="35" height="100%"
width="100%">
<mx:HDividedBox width="100%" height="159">
<mx:DataGrid id="lbPaths"
initialize="lbPaths.dataProvider = acPaths" height="100%"
sortableColumns="false" draggableColumns="false">
<mx:columns>
<mx:DataGridColumn headerText="Path"
dataField="Name"/>
</mx:columns>
</mx:DataGrid>
<mx:DataGrid id="lbView" height="100%" width="176"
sortableColumns="false" draggableColumns="false">
<mx:columns>
<mx:DataGridColumn headerText="View"
dataField="col3"/>
</mx:columns>
</mx:DataGrid>
<mx:DataGrid id="lbQuestions" height="100%"
draggableColumns="false">
<mx:columns>
<mx:DataGridColumn headerText="Title"
dataField="col1"/>
<mx:DataGridColumn headerText="Questions"
dataField="col2"/>
<mx:DataGridColumn headerText="Level"
dataField="col3"/>
<mx:DataGridColumn headerText="Apparatus"
dataField="col3"/>
</mx:columns>
</mx:DataGrid>
</mx:HDividedBox>
<mx:Canvas id="cn1" width="100%" height="100%">
<mx:Text x="3" y="7" text="Questions in Test:"
width="209"/>
<mx:DataGrid id="lbTest" height="413" width="100%" y="31"
draggableColumns="false">
<mx:columns>
<mx:DataGridColumn headerText="No." dataField="col1"/>
<mx:DataGridColumn headerText="Title"
dataField="col2"/>
<mx:DataGridColumn headerText="Question"
dataField="col3"/>
<mx:DataGridColumn headerText="Level"
dataField="col4"/>
<mx:DataGridColumn headerText="Apparatus"
dataField="col5"/>
</mx:columns>
</mx:DataGrid>
<mx:Button id="pbPreviewTest" label="Preview Test"
right="5" top="5" enabled="false"/>
</mx:Canvas>
</mx:VDividedBox>
<mx:Button x="300" y="5" label="Add"/>
<mx:Button x="357" y="5" label="Remove"/>
<mx:Button label="Preview Question" enabled="false"
right="4" top="5"/>
</mx:Panel>
</mx:Application>

Similar Messages

  • How to make a button load a sprite from library??

    PLEASE HELP!!
    Hey everyone.. iv been looking for help for a few weeks but cant seem to find the awnsers
    I am trying to create a newspaper that consists of four pages. Each   page i have created and are sitting in the library as sprites. Each page   has buttons that need linking so that when pressed it loads the next   page or page that i want. This is the part i am confused with =/ how do i   make the buttons on each page load the next page (sprite) from the   library??
    Basically i want to no how to make a button load a sprite from the library when clicked. Does anyone no the script for this?
    Thanks for any help

    A question arises as to whether or not you are posting in the right forum.  Sprites are AS3 objects.
    If you want to add movieclips to the stage from the library using AS2, then you need to assign them each an Identifier via right clicking them in the library and selecting the Linkage option... from there you slect the option to Export for Actionscript and then assign the Identifier.
    You then use the attachMovie() method to make use of that Identifier to dynamically load the library object.

  • How to find the button is enable/disabled by sql coding

    Hello friends,
    How can i find a button is disabled or enabled state by plsql coding ?
    I have a requirement to ckeck out the user try to close login window without click out button..I should make a warning message to user when he try to close window improperly..Pls help me

    Hi
    ur requirement is not clear...
    How can i find a button is disabled or enabled state by plsql coding ?
    IF ur_condition  THEN
    SET_ITEM_INSTANCE_PROPERTY('BLK_NAME.ITEM_NAME',NAVIGABLE,PROPERTY_TRUE);
    ELSE
    SET_ITEM_INSTANCE_PROPERTY('BLK_NAME.ITEM_NAME',NAVIGABLE,PROPERTY_FALSE);
    END IF;
    REgards,
    Abdetu..

  • How could I extract past executed SQL statement from dictionary ?

    We use oracle11gR2 on win2008R2.
    How could I extract the past executed SQL statement from dictionary ? (Is it possible from V$SQLTEXT or other dictionary table ?)

    IvicaArsov wrote:
    Hi,
    You can find executed SQL in V$SQLAREA view (if it's still in memory). If it does'n't exist and you have AWR enabled you can query DBA_HIST_SQLTEXT table, but remember that the statistic information in AWR tables is filtered (1 out of 10).
    I.Arsov
    As you know when taking snapshot oracle will capture only top sql statements and stored in AWR.
    But can you please link(source) dba_hist_sqltext contain only 1 out of 10 filtered data?. In dba_hist_active_sess_history yes it contain 1 out of 10 sampled data.

  • How to remove the buttons which are coming from a report?

    Hi All,
    I need to remove the buttons from an iview which is a sap transaction. when i execute the  report program which uses a ldb (PCH) shows a selection screen having all the buttons.
    We have created variants for this.Now i want to remove the buttons which are coming from the report program.how to do this ?
    Lakshmi.

    Hi,
    I think u r mentioning about the addition buttons that appear in the selection screen when using a logical database. for removing these buttons u can use a function module RS_SET_SELSCREEN_STATUS  for setting ur own pf-status
    do this in "at selection screen output" of the program..
    in the tables parameter, u have the option for giving the ok-codes that u want to remove. append all the ok-codes into this table.
    for getting the ok-codes u can use "tab" and go the button.. press F1. it will give the ok-code.
    Regards,
    Anoop

  • How To Execute SQL Statements From Shell Scripts?

    I need to extecute some SELECT statements from a shell scripts. Could anybody kindly tell me how to do that, or which document i should refer to ? Thank you very much!

    You can execute SQLPlus with the SQL in a file (sqlplus -s @<sql-script>).

  • How Do I Link to Custom Component States From Scrolling Content Buttons?

    Hi there, I'm in need of some help as i've got a deadline to meet within the next few weeks and im stuck!
    Basically what I've done is i've made a scrolling content lists, containing about 10 products in each one, my plan was to turn each product into a button so that users could click on that product, and take them to a new page containing more detailed information on that product; when they've finished looking at that product they can click a button to return them to the list they were on previously. However I can't just make a brand new state for each product as there is a limit to 20 states, and I will need around 50 of them.
    So, from what i've read I will need to create custom components. the only trouble with doing this is that I can't link to the custom component on a different main timeline state (I dont get the option to link to the states of the custom component).
    If i put the image of the detailed product into the scroll panel I am able to link to it, however, it's inside the scrolling content and it just scrolls around and stuff which isn't what I want; as it makes it look messy.
    - Basically I just need to link from the buttons in the scrolling list, to a more detailed page for that product. Then be able to return to the list using a button.
    If anybody has any input on how to achieve this, please help me out. Starting to panic now as this needs to be finished before september :s
    Btw i'm happy to share my .fxp file it that helps.
    Thanks alot, Hoping for some helpful replies on this topic
    - Tom

    Hi Tom,
    Adding this back here to share my wireframe with the community.
    Have put a quick .fxp together based on the 'product' section of your project.
    Take a look at how the product lists are linking into the product detail pages within their custom components. 
    Using this model you should be able to expand out to infinite product detail states.  If a particular product area has more than the maximum allowed states, just start a new custom component (part 2 for that product section).
    Let me know if you have any questions. Hope this sets you on a path to getting your project complete.  It's looking nice.
    Tanya

  • How to set radio buttons in horizontal state in the JRadioButtonGroup

    How to set horizontal alignment in the JRadioButtonGroup

    I don't know of any JRadioButtonGroup class.
    A ButtonGroup is just a simple data structure that ensures that only one button is selected. It is not a component.
    Just add your JRadioButtons to a JPanel with any LayoutManager you wish.

  • How to check the button Disable/enable property in openscript

    I am creating a test script using openscipt 12.2.0.1 and needs to verify whether a button is in disabled or enabled mode.
    I am trying below code:
    boolean enable=adf.commandToolbarButton(
    *125, "/web:window[@index='0' or @title=' - Collections Customer - Oracle Applications']/web:document[@index='0' or @name='13hipll5e2_1']/web:ADFCommandToolbarButton[@text='Pay' or @absoluteLocator='pt1:USma:MAnt1:pt1:TRX_FL:AP1:AT2:_ATp:ctb1']".exists();*
    if(enable)
    fail("Test failed");
    But this code is not working and Test failed for both enabled and disabled button.
    Please suggest the code which i can use for my scenario.
    Edited by: robi sharma on Apr 12, 2013 2:41 AM
    Edited by: robi sharma on Apr 12, 2013 2:42 AM
    Edited by: robi sharma on Apr 12, 2013 2:42 AM
    Edited by: robi sharma on Apr 12, 2013 2:43 AM
    Edited by: robi sharma on Apr 12, 2013 2:43 AM

    Hi Robi,
    Try this...
    String disabled = adf.commandToolbarButton("XPATH").getAttribute("disabled");
    if(disabled.trim().equals("false"))
        fail("Test failed");
    }If you want to convert your string to boolean use the following:
    boolean boolValue = Boolean.parseBoolean(disabled);
    if(! boolValue)
        fail("Test failed");
    }Regards,
    Deepu M

  • How to code a button to enable the user to download music?

    I am trying to build a site where you can download music.  Has anyone done this before in AS3?  Any tips?
    Thanks
    m

    use the filereference class to download files.

  • How to disable print button in outoput screen from vf03

    hi,
    i have a requirement to display error message and, disable the print and print preview button.
    below its the step,
    1)vf03
    2)key in document type
    3)select output type
    4)if there's error, display error message and disable print and print preview button.
    what i have done was
    1) i've put the error message in my 1st part of code,
    *determine discount
    it_zmas-discount = it_zmas-gross_value - zkwert.
    MODIFY it_zmas.
    ELSE.
    MESSAGE ID 'Z0' TYPE 'S' NUMBER '999' WITH 'Please maintain cust pricing grp 34 for ' wa_zmas-matnr.
    p_proc_screen = 'X'.
    ENDIF.
    CLEAR zknumh.
    2)then i set itcpo-tdpreview = ' ' to display my print button after display the error message
    CLEAR itcpo.
    MOVE-CORRESPONDING nast TO itcpo.
    itcpo-tdcover   = nast-tdocover.
    itcpo-tddest    = nast-ldest.
    itcpo-tddataset = nast-dsnam.
    itcpo-tdsuffix1 = nast-dsuf1.
    itcpo-tdsuffix2 = nast-dsuf2.
    itcpo-tdimmed   = nast-dimme.
    itcpo-tddelete  = nast-delet.
    itcpo-tdcopies  = nast-anzal.
    itcpo-tdprogram = sy-repid.
    IF us_screen NE space
    AND p_var EQ space.
    itcpo-tdpreview = 'X'.
    itcpo-tdnoprint = 'X'.
    ELSE.
    itcpo-tdpreview = ' '.
    ENDIF.
    CASE nast-nacha.
    WHEN '1'.
    xdevice = 'PRINTER'.
    itcpo-tdnewid = 'X'.
    itcpo-tdgetotf = 'X'.
    WHEN '2'.
    xdevice = 'TELEFAX'.
    itcpo-tdtelenum = nast-telfx.
    itcpo-tdteleland = us_country.
    itcpo-tdsenddate = nast-vsdat.
    itcpo-tdsendtime = nast-vsura.
    WHEN '3'.
    xdevice = 'TELETEX'.
    itcpo-tdtelenum = nast-teltx.
    itcpo-tdteleland = us_country.
    itcpo-tdsenddate = nast-vsdat.
    itcpo-tdsendtime = nast-vsura.
    3) my last problem its, i am not sure how to disable the print button.i need  to show an error message for my invoice via vf03 when error occur when user click print or print preview button. however with my code above, i am only able to display the error message and disable the print preview.
    could anyone guide me how do i disable my print button? really appreciate your help.
    regards,
    sw

    Instead of disabling the print buttons, you can restrict creating the actual output message for a specific output type.
    You can achieve it by creating the Output Requirement in transaction VOFM. You need to assign this requirement to your Output type. In this Requirement you can check all your conditions. If they all validation pass through than and than create the Output.
    Regards,
    Naimesh Patel

  • How can I test the log in state from in side the Operator Interface code.

    From inside LabVIEW Full OI, I want to test if the operator logged in after the IApplicationMgr Start.
    Right after the IApplicationMgr ‘Start’ I have a loop that tests the IApplicationMgr ‘LoginLogoutRunning’ state and waits until the LoginLogout call back is done.
    I want to exit if the program if operator canceled the login and did not log in.
    I have tried “GetEngine” ref. From there get the “CurrentUser” ref but seems not to contain any information about the Current User.
    How can I test from my Operator Interface code logged in state of the application?
    Thanks
    Jim D.

    Try Engine.CurrentUserHasPrivilege
    For the string parameter 'privilegeName' enter Priv_UserLoggedIn or the string value "*".
    "Priv_UserLoggedIn–(Value: "*") Use this value with the Engine.CurrentUserHasPrivilege method to determine whether a user is logged in."
    Option 2: You could also setup a callback on application manager for UserChanged Event.  If the User is null then the login was canceled.  (see a copy of the help further down)
    From the teststand help for Engine.CurrentUserHasPrivilege method below...
    CurrentUserHasPrivilege Method
    Syntax
    Engine.CurrentUserHasPrivilege ( privilegeName)
    Return Value
    Boolean
    True if the current user has the privilege.
    Purpose
    Confirms whether the current user or any user group that the user is a member of has a specific privilege.
    Remarks
    Returns True when the privilege property is True, when the privilege property of any group that contains the privilege is True, or when privilege checking is disabled, StationOptions.EnableUserPrivilegeChecking is False. If privilege checking is disabled but StationOptions.RequireUserLogin is True, this function returns True only if there is a user currently logged on.
    Parameters
    privilegeName As String
    [In] Specifies the name of the privilege to check. You can specify the name of any privilege property. You can specify the full privilege path in the user privileges property tree, for example, Debug.RunSelectedSteps, or you can specify the base privilege name, RunSelectedSteps. If you specify only the base privilege name and more than one instance of the base privilege name exists, then the method returns the value of the first base privilege it finds with that name. Refer to UserPrivileges for more information.
    Teststand callback for UserChanged Event...
    UserChanged Event
    Syntax
    ControlName_UserChanged ( user)
    Applies To
    ApplicationMgr
    Purpose
    Occurs when the current user logged in changes.
    Remarks
    Use this event to update the parts of your user interface that depend on user permissions when the current user logged in changes.
    Parameters
    user As User
    [In] Current user. If this parameter is NULL, there is no user logged in.

  • How can i get my card 's state from op_ready to initialize

    i work with JCOP tools and Eclipse 2.1 ,now the card's state is op_ready,and i want to change it's state to initilize,then what shall i do?Any help will be appreciated.
    Thanks!

    Hello there,
    If you can Authenticate (by that I mean send an Initialise Update command and External Authenticate command) successfully the ISD keys are already on the card. If you cannot Authenticate then you will need to load these onto the card and this is done with the Put Key command. You need to load 3 keys - these are 16 byte keys usually all with the same value e.g. 41 42 ...........4F. Once these keys are on the card you need to set the SCP option (which should be 0105) and then you will be able to Authenticate. You will then be able to send a Set Status command to change the life cycle state of the card (either with the apdu or from an applet using the setCardContentState() method).
    I'm guessing that your JCOP card probably has the ISD keys on already and has the SCP option set so there is no need for any additional keys to be loaded at this stage.
    Hope this helps,
    Stephanie

  • How to alter my display name when sending from an alias?

    When sending emails from my iphone, using an alias, I've noticed that it sends it using my real name. This defeats the purpose of using an alias!
    When I send it from my Mac using the mail app, or from icloud on the web, it uses the name I've designated for the alias, but this is not the case on my phone.
    How can I get the mail app on my iphone to use the display name I've designated for the alias?

    Just go to icloud.com and click the gear in the top right corner (Preferences). Then go to the "accounts" tab and click on the alias you are trying to use and then when it comes up, insert the name you would like to use. If there's any more questions you have, just reply.

  • Calling SQL statements from Shell scripts

    Hi,
    I want to call external package procedures, declare some variables & do some oracle validations in the shell script.
    How SQL environment is set in shell script & is this one time process or I have to write few statements before every SQL statement.
    Please explain with an example.
    Thanks..

    is this one time process Yes. Example :
    $ cat script.sh
    export ORACLE_HOME=/home/oracle/base/OraHome10
    export ORACLE_SID=db102
    export PATH=$ORACLE_HOME/bin:$PATH
    sqlplus -s / as sysdba << EOF
    select to_char(sysdate,'dd/mm/yyyy hh24:mi:ss') date_time
    from dual;
    exit
    EOF
    sqlplus -s / as sysdba << EOF
    col global_name for a60
    select * from global_name;
    exit
    EOF
    $ ./script.sh
    DATE_TIME
    27/02/2008 11:11:27
    GLOBAL_NAME
    DB102
    $

Maybe you are looking for

  • I can't get icloud to work on my computer not sure how to create an icloud account

    Hi there, can anyone help me with this?  I have been trying all day to get icloud to work on my computer.  I have successfully downloaded it on to my laptop.  I am having trouble creating an iCloud ACCOUNT as it won't let me sign in with my Apple ID

  • S10 92 BIOS Online

    New Bios for S10 14CN92WW the 92 is ready for download here: http://consumersupport.lenovo.com/en/DriversDownloads/drivers_show_1283.html# Summary of changes ================== 1. Resolve the problem with One Key Recovery button which makes the syste

  • Opening B&N books in ADE

       Hi there.  I installed Nook for Mac, downloaded a book, and moved it from My Documents to ADE. As per instructions from someone on the nook forum. I actually use a Kobo reader, which is why I wanted to move it to ADE. When I tried to move or open

  • What is the available memory for user in iPad

    In iPad 3rd generation wifi model, what is the available memory for users? Capacity          Available Memory 16 GB                      ? 32 GB                      ?

  • TO FIND PRIMARY KEY!

    HI FRIENDS I HAVE A ONLY A TABLE NAME OF A PARTICULAR TABLE AND I WANT TO KNOW THAT WHICH COLUMN IS PRIMARY KEY. EVEN I DONT KNOW THE NAMES OF THE COLUMNS OF THAT TABLE. CAN ANYBODY TELME. THANKS RITESH