Quick question - making button visible if two conditions are met

I simply want a button to be visible is once condition is true and another condition is false. Shouldn't this line of code work?
<mx:Button id="Btn"label="
Submit"color="
#FF0000"enabled="
{islRequired}" visible=" 
{!.isAdmin}  {isRequired}"
click="submit()" 
/>
isadmin = false
isrequired = true
the button should be visible
Am I missing something?

Maybe you miss OR (||) or AND (&&), but I never use at mxml
visible="{!.isAdmin && isRequired}" 
Works?
Best Regards,
Miguel

Similar Messages

  • Quick Question about Button Visibility!

    I have a form, and I only want the "submit" button to show up after the user has checked a checkbox. I have it showing and hiding by applying this code the check box "Click" event.
    if (this.rawValue == "1")
    EmailSubmitButton1.presence = "visible";
    else
    EmailSubmitButton1.presence = "invisible";
    But the thing is, I want the button to be invisible initially, whenever i do that tough, I've tried different things, it never reapears when the box is checked.

    Make sure your form is saved as a dynamic form.

  • Keep focus in a control until certain conditions are met?

    Hello,
    Is there a way to keep focus at a control until certain conditions are met?
    For example, if I might want to keep the focus set to a text field inside a tab unless the text field contains something valid.
    If user tries to switch to different tab without having valid text inside the text field, I would like to pop up a stage/dialog and abort the tab switching.
    Please help!
    Thanks.

    Hi. Here is an example:
    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.*;
    import javafx.scene.layout.*;
    import javafx.scene.paint.Color;
    import javafx.stage.Modality;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    import javafx.stage.WindowEvent;
    public class SSNValidation extends Application {
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(final Stage primaryStage) {
            primaryStage.setTitle("SSN Validation");
            Button btn = new Button();
            final TextField tfSSN = new TextField();
            StackPane layout = new StackPane();
            Scene scenePopup = new Scene(layout, 424, 154, Color.TRANSPARENT);
            final Stage stage = new Stage();
            stage.initModality(Modality.APPLICATION_MODAL);
            stage.setScene(scenePopup);
            stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
                @Override
                public void handle(WindowEvent event) {
                    tfSSN.requestFocus();
            tfSSN.focusedProperty().addListener(new ChangeListener<Boolean>() {
                public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, final Boolean newValue) {
                    if (!newValue) {
                        if (tfSSN.getText().length() < 9) {
                            stage.show();
            final TextField tf2 = new TextField();
            btn.setText("Submit");
            VBox root = new VBox();
            root.getChildren().addAll(tfSSN, tf2, btn);
            primaryStage.setScene(new Scene(root, 300, 250));
            primaryStage.show();
    }

  • Hold indicator state if conditions are met for review at end of test

    I am looking to have an indicator stay true if conditions are met. I can get it to go on just not stay on. Example: if 5>0 and 10>0 then true (and stay true until reset. It is probably something really easy and I am just missing it but I am not sure what labview combination of items to make the value stay until reset.

    Paul and IanW,
    I thank you for your posts....I think I have the solution but not sure why it does not work in my application. Attached is Paul's version modified to look like my version but they do not act the same.....My VI was created in 6 and migrated to 7.1 with the upgrades. This is the only thing that I can think of. Does this mean I have to redo my VI in the new version to fix this issue or am I just missing something.
    Thanks,
    Kyle
    Attachments:
    keepBooOn.vi ‏143 KB
    Full Lab_verlatch.vi ‏170 KB

  • Problem making buttons visible

    Hi there, I have a poker game that all worked fine until I was told to restructure it in a MVC style. I never had this problem before I changed it but I'm having issues with making my buttons visible when it's the players turn. At first I setVisible to false which works fine, then I call my method to display them from my model and they display fine, so seemings as all is good to here I think it's the next bit that's causing my issue, I have actionListeners attached that when fired setsVisible on all the buttons to false again (which works) but the next time I call my method to make certain buttons visible they don't appear. I've tested that the method is being called with the correct parameter passed and it is. Now I must apologise because my knowledge of swing is very poor but I have searched and read alot and tried several approaches with no joy, I will definitly be studying up more on it in the future but time is against me at the mo. The only thing that seems to half work is if I use this.paint(g) the buttons display as I want them but my program crashes cos to be honest I don't know what g should be. Is this the right approach or is there a more simple way I can update my GUI to display my buttons?

    Works for me but you could try to add a revalidate(); repaint(); on the buttons parent.
    import java.awt.BorderLayout;
    import java.awt.EventQueue;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class TestVisible {
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    final JButton button = new JButton("I do nothing");
                    final JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.getContentPane().add(button);
                    frame.getContentPane().add(new JButton(new AbstractAction("Toggle") {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            button.setVisible(!button.isVisible());
    //                        frame.getRootPane().revalidate();
    //                        frame.getRootPane().repaint();
                    }), BorderLayout.PAGE_START);
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
    }

  • Hiding Button if Conditions are met

    I have a form that has 3 drop down boxes with options 1,2 and 3 in them.  I want to hide a button if "1" is selected for either of the 3 drop down boxes.  But the problem is I want it to re appear if the user changes their mind and wants to select 2 or 3.  So at no point and time do I want the button visible if "1" is selected.  But I do want it visible if  none of the boxes have "1"or are blank.
    Thanks in advance for taking the time to help.

    Hi uschad123,
    Here's a way to do it:
    Set the bound values as numbers: 1,2,3 in the Binding Tab of the Object Pallet
    then using formCalc you put a script "like" this on the "exit" event on all 3 drop-down boxes:
    ////////////////////// formCalc:
    if ($ le "1" | ddl2 le "1" | ddl3 le "1") then
         button1.presence = "hidden"
    else
         button1.presence = "visible"
    endif
    you'll need to adjust the script slightly for each drop-down box. My example uses formCalc, but javaScript is just as easy.
    ////////////////// javascript:
    if (this.rawValue <= "1" || ddl2.rawValue <= "1" || ddl3.rawValue <= "1")
          button1.presence = "hidden";
    else
         button1.presence =  "visible";
    also with this, you'll need to adjust the script slightly for each drop-down box.
    Good luck,
    Stephen

  • Quick question, making a picture

    Know how to do the freeze frame, but how do you convert a frame into a basic png picture file?
    Thanks.

    And here's a clever little tip: If you need to make multiple still files, make single frame subclips and do a batch export.

  • RBATP - is it possible to activate them only if certain conditions are met?

    Hello APO - RBATP experts!
    I have a question that I hope you can help me with:
    Is it possible to have rules that become active only in certain circumstances, for example, if the RDD of the sales order is today or tomorrow?
    I have limited knowledge on the topic; so your help will be greatly appreciated.
    This is my scenario:
    A sales order is raised in plant A for Material X, if there isn't enought inventory of Mat. X, there will be a rule to look for inventory in plant B. If stock is found in plant B; then an ATP Tree structure is created, which is then turned into a purch req; and then into an STO from Plant B to Plant A. Then the shipment is sent to the customer from Plant A. This is good, however, this is not what we want for sales orders that are placed with too much time in advance; because by the time the sales order needs to be delivered, the inventory may be available in Plant A, and those requirements are meaningless at that point. Any ideas of how to handle this? Thanks in advance!

    Hi DB:
    Here are my answers:
    If the requirement is placed upon B, how is it possible to later have excess inventory in A? 
    If the sales order was placed let's say 7 weeks in advance; during that time the whse could have received inventory from the plant.
    This is mainly why I need to find a way for the rule to do the substitution and create the requirement in B, only if RDD is very close to today's date.
    Is there a reason why wouldn't ship directly from B to the customer? (instead of first moving the stock to A) 
    Yes there is, the requirement of the business is that any sales order raised in A, must be shipped from A; but stock must be found in alternate locations to satisfy the order. If stock is not found, then the order is cut and shipped.
    Is A a plant, depot, or both?
    Is B a plant, depot, or both?
    How is 'B' normally supplied? 
    Are you using MLATP?  CTP?
    Both are depots; and are supplied from different  manufacturing plants across the country.
    We are using MLATP.
    Thanks again for your input!

  • Print When with two conditions

    I only want to print a page if two conditions are met. On each section I am using the following Print When Condition:
    DateFormat(query.asofdate, "mm/dd/yyyy") NEQ DateFormat(calc.AmtDate, "mm/dd/yyyy")  AND LSNumberFormat((query.bal + calc.anticipated), "_.__") LTE LSNumberFormat(25.00, "_.__").
    The date check works great by itself and the amount check works great by itself but I can't get them to work together. Any ideas?
    I am using CF10.

    Cozmo2 wrote:
    That fixed the problem Thanks!
    Is there anyway I can apply this to the whole page and not have to add it to every sections 'Print When Condition'?
    One way would be to exclude records that meet those conditions. That way you would not need to take them into account in your report.

  • How to combine two conditions :  Exists and Item not null ?

    Hello !
    I have a flash chart region that I would like to display only if two conditions are both true.
    The first condition is this one :
    Exists (SQL query returns at least one row) :
    select 1
    from    observatoire.fiche aa, observatoire.activite_faite bb
    where   aa.fiche_id = bb.fiche_id
    and     bb.fiche_id = aa.fiche_id
    AND     bb.activites_id = TO_NUMBER(:P23_ACTIVITES_ID)
    AND     TRUNC(aa.date_activite, 'YYYY') = TRUNC(TO_DATE(:P23_ANNEE, 'YYYY'), 'YYYY')And the second condition would be :
    Item not null :
    P23_ACTIVITES_IDHow to combine these two conditions into one display condition ?
    Thank you .
    Christian

    Hello,
    The issue is that you're doing -
    TO_NUMBER(:P23_ACTIVITES_ID)When you leave the Null return value blank like that, you'll typically see '%null%' used in session state (i.e. it's not actually null). Obviously '%null%' can't be converted to a number, hence the error you're seeing.
    A simple solution would be to make your null return value -1 or some other value that is guaranteed not to be a valid id (and alternative is to convert the %null% to a real null via an App/Page process etc (if you search this forum you'll find a few examples on how to do that). Another alternative is to use a DECODE to detect the '%null%' etc.
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Restarting the executable until all conditions are true

    I wonder if I could be very clever and find the way out of my problem here.
    I am communicating with a device over UDP and for some reason, the device doesn't often establish communication with my Labview Executable on the first attempt.
    I run it, it fails, I then use CTRL+ALT+Delete to shut it down. I donubleclick the executable ICON on the desktop again and I sometimes do it five or six times then finally the communication is established and it all works.
    I wonder if I could add some code in the application to automate this process. One of the way I could now think to do is by creating another vi and call my current vi dynamically and add all those conditions into cluster, call this cluster (by wiring to the output terminal of the current main vi into new main vi) and monitor my cluster in the new main vi to see if the conditions are true if so continue or reload the current vi until those conditions are met? Is it the right way to do this? Or can I make my life easier and applcation more stable by doing something different?
    Kind Regards Austin

    Can you post your current code and show us the part that is communicating via UDP. I think the way to go is deffinately make your current code stable rather than an automation of failing code.
    Also what is the device you are trying to communicate with. Does this have a set protocol that you need to follow or is it one you are trying to figure out.
    Let us know and we could help you further.
    Matthew Trott
    Applications Engineer
    National Instruments UK
    www.ni.com/ask

  • Quick question about making system calls

    hello all
    i have a simple quick question regarding making system calls. Basically I want to mimic the command "system" for perl. I am not quite sure how to do this for java.
    any feedback would be appreciated.

    look at:
    java.lang.RunTime

  • Making a button visible upon closing a document

    Kind of a weird question, but is there a way to make a button visible upon closing a document? Here's my situation. I want users to click a link which will open a PDF. I then want the users to take a quiz based off of the information in the PDF. Is there a way to have the users click the link to open the PDF, then a button to start a quiz becomes visible when the users close the PDF? I have a feeling it's probably not possible, but I figured I'd check. Thanks.

    I was actually able to find a bit of a workaround. I created an advanced action to open the PDF and show the button (it was hidden to begin with) once I click the hyperlink. It's not exactly what I wanted to do, but I think it'll suffice until I figure out a way to show the button upon closing the PDF. I'll look into the java scripting, even though I'm not really a coder. Thanks!

  • Hi guys. Just a quick question. My wife has a Mac Book Pro and when she is browsing the web she can use a two fingered gesture to go back to her previous page (by swiping from right to left). Is there any way to set that up on my iPad Mini. Many thanks.

    Hi guys. Just a quick question. My wife has a Mac Book Pro and when she is browsing the web she can use a two fingered gesture to go back to her previous page (by swiping from right to left). Is there any way to set that up on my iPad Mini. Many thanks.

    Not in the Safari browser she can't. That is not supported on the iPad. There are other mobile browsers that do have that functionality - one is iCab Mobile.
    https://itunes.apple.com/us/app/icab-mobile-web-browser/id308111628?mt=8

  • Two quick questions about Library after moving beginning on a new computer

    Hi there,
    I just moved from Windows to Mac, meaning I had to move my iTunes library from the old PC to my new MBA.
    Just a couple of quick questions.
    1. When I started iTunes on my new Mac, in the preferences I directed the media folder to the folder with all my itunes music/podcasts etc, and then I imported the Library XML file.  Is this incorrect? Should I have imported a different file? Should I have used the itl file instead? 
    If so, should I delete the library and start again?  (if this is the case, please suggest the best way of doing this without affecting my media)
    - a kind of sub-question to this one:  some of the media files arent showing up in the iTunes library, but they are in the media folder on the ext HDD.  Is there a way I can find out which ones havent been recognized by iTunes?  Whats the best way of getting them in to my library?
    2. Pretty much half of my podcasts have not been loaded in the new iTunes.  The ones that havent were ones that I subscribed to on my iPhone, whereas the ones that show up in iTunes were ones I downloaded from iTunes.  When I connect my iPhone and sync it with iTunes, will those podcasts show up in iTunes?  Or is there a risk that they will be deleted from my iPhone?
    Cheers,

    The .xml is lacking some information such as ratings, date added, and play count.  Using the .itl includes this information but cannot be imported using the method you did.
    A complete library is everything in the iTunes folder.  By using the method you did you left the artwork behind in the artwork folder on the other machine.
    Selecting the media folder in preferences does not get iTunes to recognize the media.  All it does is tell iTunes to start storing new media in that location.
    Using the method I outlined nothing will be missed (with the exception of WMA) because you aren't rebuilding your library, you are using the one that already exists.
    You don't have to re-copy everything as long as you get the stuff you missed and re-assemble it all as it was before except not on the Mac.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391

Maybe you are looking for

  • How to call an applet on click of a button in core java?

    On this, I suggest that if we can call commond prompt on background and then pass the path of the class file of another applet we can open another applet on clicking on the button what u says ? if any suggestions or code u can give it is our pleasure

  • Can't send mail to POP Account which has attachment or signature

    Since installing the Update 10.4.6, I have been unable to send email to my pop account which has either a signature or an attachment (when there is no attachment or signature it works fine). I have cleared the caches using tiger cache cleaner. I have

  • MacBook Pro as a Signal Booster?

    Hey, My Macbook Pro (13" Late 2011) has a full WiFi signal at home but my iPhone 5 barely connects to the same network. Is there a way connect my iPhone to the WiFi through my MacBook? (As a signal booster) Thanks in advance.

  • Route-List not using 2nd Route-Group when PRI cable is removed from H323 gw

    CCM 4.1.3sr3b Router - 2811 - 12.4.4T2 1 site with 2 gateways, gw1 and gw2 RL has both gateways as RG's. If gw1 has its PRI cable removed, CCM RL will not pass call into gw2 - Not working. If gw1 is turned of/Ethernet removed RL will wait the h323 ti

  • Deprecated Xpath 1.0 functions in 11gR2

    According to this whitepaper: http://www.oracle.com/technetwork/database/features/xmldb/xmlqueryoptimize11gr2-168036.pdf Starting 11gR2, Oracle has deprecated many older proprietary mainly XPath 1.0 based operators in favor of standards based XQuery