Enable an inputText when selecting a selectItem [closed]

0

With the tag selectOneRadio I can nest several selectItem as your options.

How can I make a inputText that is previously disabled by selecting one of the options?

Or how can I do so that, instead of using a inputText disabled, I see a p:dialog to place the inputText to enter a value?

    
asked by María Guadalupe León Ruiz 23.01.2017 в 01:32
source

1 answer

1

To enable / disable components in Swing you can use the setEnabled (boolean enabled) method of javax.swing.JComponent , which is the super class for these component types.

final JTextField textField = new JTextField();
textField.setEnabled(false);

then with ActionListener for example:

textField.setEnabled(true);
textField.requestFocusInWindow();
    
answered by 23.01.2017 в 03:19