public class Simple extends Base { private Simple(TextBox t) { super(t); // continue doing stuff with t here } public Simple() { this(new TextBox()); } }
/** * Constructor for {@link SuggestBox}. Creates a {@link TextBox} to use with this {@link SuggestBox}. * * @param oracle the oracle for this <code>SuggestBox</code> */ public SuggestBox(SuggestOracle oracle) { this(oracle, new TextBox()); }
/** * Constructor for {@link SuggestBox}. Creates a {@link TextBox} to use with this {@link SuggestBox}. * * @param oracle the oracle for this <code>SuggestBox</code> */ public SuggestBox(SuggestOracle oracle) { this(oracle, new TextBox()); }
TextBox txt = new TextBox(){ public void onLoad(){ final TextBox finalThis = this; this.addFocusHandler(new FocusHandler(){ finalThis.doSomething(); ); } };
if(NumberOfTextBoxes <= 10) { TextBox tb = new TextBox(); Placeholder1.Controls.Add(tb); NumberOfTextBoxes++; }
int id = 1; // You'd have access to this. TextBox tb = new TextBox(); tb.Attributes.Add("onClick", string.Format("javascript:someFunction({0})", id)); // add other stuff. form1.Controls.Add(tb);
divAltriIndirizzi.Controls.Add( new TextBox () { ID = "txtIndirizzo", CssClass= "form-control" });
// c# var tb = new TextBox(); tb.ID = "txtABC"; // Add the control to a container on the page. Any server control can be // a container. This makes it part of the page lifecycle. this.Controls.Add( tb );
public class Base { protected TextBox t; public Base(TextBox t, String arg) { this.t = t; this.t.doSomething(arg); } } public class Simple extends Base { public Simple(){ super(new TextBox(), "stuff"); } }
Panel username = new Panel(new Border.Invisible(), Panel.Orientation.HORISONTAL); username.addComponent(new Label("Username: ")); TextBox userBox = new TextBox(null, 15); username.addComponent(userBox); addComponent(username); // ... and later elsewhere usernameIn = userBox.getText();
// create the textboxes of the form with their proper form names final TextBox tbName = new TextBox(); final TextBox tbEmail = new TextBox(); final TextBox tbMessage = new TextBox(); // create the form submit button Button btnSubmit = new Button( "Submit", new ClickHandler() { @Override public void onClick(ClickEvent event) { submitEmailFormRequestBuilder( tbName, tbEmail, tbMessage ); } } ); // TODO: add textboxes and Submit-Button to the DOM-tree
final TextBox editTb = new TextBox(); editTb.addStyleName(EDIT_FAV_DELETE_STYLE); editTb.setText(favoriteBean.getName()); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { editFavoriteTb.setFocus(true); editTb.setCursorPos( favoriteBean.getName().length()); } });
System.Web.UI.HtmlControls.HtmlGenericControl subDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV"); subDiv.ID = "DivIndirizzo"+ (i+1); subDiv.Attributes["class"]= "col-lg-8"; subDiv.Controls.Add( new TextBox () { ID = "txtIndirizzo", CssClass= "form-control" }); divAltriIndirizzi.Controls.Add(subDiv);
//pass in your own TextBox when you construct the SB: TextBox tb = new TextBox(); SuggestBox sb = new SuggestBox(oracle, tb); //...and later disable the TextBox: tb.setEnabled(false);
public class Simple extends Base { private static TextBox t; static { t = new TextBox(); t.doSomething(); } public Simple(){ super(t); } }
public class Simple extends Base { public Simple(){ super(createTextBox()); } private static TextBox createTextBox() { TextBox t = new TextBox(); t.doSomething(); // ... or more return t; } }
@Override public TextBox createWidget() { final TextBox textBox = new TextBox(); textBox.addKeyDownHandler(KeyDownEvent::stopPropagation); textBox.addMouseDownHandler(MouseDownEvent::stopPropagation); return textBox; }
@Override public TextBox createWidget() { final TextBox widget = new TextBox(); widget.addKeyDownHandler( ( e ) -> e.stopPropagation() ); widget.addMouseDownHandler( ( e ) -> e.stopPropagation() ); return widget; }
Document doc = Document.get(); final OListElement ol = doc.createOLElement(); LIElement li = doc.createLIElement(); li.appendChild((new Label()).getElement()); ol.appendChild(li); li = doc.createLIElement(); li.appendChild((new TextBox()).getElement()); ol.appendChild(li); panel.add(new Widget() {{ setElement(ol); }});
public ConstraintMatchInputWidget(final AbstractActionConstraintMatch actionConstraintMatch) { constraintMatchTextBox = new TextBox(); helpBlock = new HelpBlock(); add(constraintMatchTextBox); add(helpBlock); constraintMatchTextBox.setValue(actionConstraintMatch.getConstraintMatch() == null ? "" : actionConstraintMatch.getConstraintMatch()); constraintMatchTextBox.setEnabled(false); }