Reputation: 20571
On UI I have a TextBox. I want to show Tree element when user clicks on TextBox. I want to prevent user from direct input text to TextBox (it's value must depend which item user select from Tree)
Upvotes: 0
Views: 172
Reputation: 16079
Set ReadOnly attribute for your textbox, and for your tree widget addSelectionHandler
tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
public void onSelection(SelectionEvent<TreeItem> event) {
textbox.setText(event.getSelectedItem().getText());
}
});
Upvotes: 2
Reputation: 2670
You should use this attribute: http://www.w3schools.com/tags/att_input_readonly.asp
Upvotes: 1