I have a custom TextBox that has a IndicatorTextBox.ui.xml file as well as
IndicatorTextBox.java file.
Ussually adding an evenhadler to a textbox is simple.
@UiHandler("txtFirstName")
void onTxtFirstNameKeyUp(KeyUpEvent event)
{
validateFields();
}
How would I add the handler if the txtFirstName was the custom textbox with
label that I am adding to this page.?
So, in other words txtFirstnName is not *@UiField TextBox txtFirstName* but
*IndicatorTextField txtFirstName* instead.
Sorry if this question seems a bit silly but still coming to grips with gwt
and ui binder.
The IndicatorTextBox.java file looks as follow
import com.google.gwt.core.client.GWT;
public class IndicatorTextField extends Composite implements HasText{
public interface Binder extends UiBinder<Widget, IndicatorTextField> {
}
private static final Binder binder = GWT.create(Binder.class);
public interface Style extends CssResource{
String textStyling();
String requiredInputLabel();
String colorNotValidated();
}
@UiField Style style;
@UiField Label label;
@UiField TextBox textBox;
public IndicatorTextField()
{
initWidget(binder.createAndBindUi(this));
}
public void setBackgroundValidateTextbox(boolean validated)
{
if(validated)
{
textBox.getElement().addClassName(style.colorNotValidated());
}
else
{
textBox.getElement().removeClassName(style.colorNotValidated());
}
}
@Override
public String getText() {
return label.getText();
}
@Override
public void setText(String text) {
label.setText(text);
}
regards
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/8af8cna0m5MJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.