I assume you would want to enable a text input based on whether an "Other" value is selected in the ListButton?!

The way we are doing that is something like this:
enum ListEnum {
    FIRST,
    SECOND,
    OTHER
}
listButton.setListData(new ListAdapter<ListEnum>(Arrays.asList(ListEnum.values()))); listButton.getListButtonSelectionListeners().add(new ListButtonSelectionListener.Adapter() {
    @Override
public void selectedItemChanged(ListButton listButton, Object previousSelectedItem) { textInput.setVisible(((ListEnum)listButton.getSelectedItem()) == ListEnum.OTHER);
    }});

On 11/16/11 8:30 AM, sarah wrote:
I'm new at this.  Is there an example of how to add a textinput based on a
selection from a listbutton?

Can I add a textinput and set it visible/invisible as needed?

Thanks

--
View this message in context: 
http://apache-pivot-users.399431.n3.nabble.com/programmatically-adding-a-textinput-tp3513202p3513202.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Reply via email to