@Override public void render(Context context, String value, SafeHtmlBuilder sb) { // Get the view data. Object key = context.getKey(); ViewData viewData = getViewData(key); if (viewData != null && viewData.getCurrentValue().equals(value)) { clearViewData(key); viewData = null; } String s = (viewData != null) ? viewData.getCurrentValue() : value; if (s != null) { sb.append(template.input(s)); } else { sb.appendHtmlConstant("<input type=\"text\" tabindex=\"-1\"></input>"); } }
@Override protected void finishEditing(Element parent, String value, Object key, ValueUpdater<String> valueUpdater) { String newValue = getInputElement(parent).getValue(); // Get the view data. ViewData vd = getViewData(key); if (vd == null) { vd = new ViewData(value); setViewData(key, vd); } vd.setCurrentValue(newValue); // Fire the value updater if the value has changed. if (valueUpdater != null && !vd.getCurrentValue().equals(vd.getLastValue())) { vd.setLastValue(newValue); valueUpdater.update(newValue); } // Blur the element. super.finishEditing(parent, newValue, key, valueUpdater); }
if ( viewData != null && viewData.getCurrentValue().equals( value ) ) { clearViewData( key ); viewData = null; String s = ( viewData != null ) ? viewData.getCurrentValue() : value; if ( s != null && s.trim().length() > 0 ) {
if ( viewData != null && viewData.getCurrentValue().equals( value ) ) { clearViewData( key ); viewData = null; String s = ( viewData != null ) ? viewData.getCurrentValue() : value; if ( s != null && s.trim().length() > 0 ) {
@Override protected void finishEditing(Element parent, String value, Object key, ValueUpdater<String> valueUpdater) { String newValue = getInputElement(parent).getValue(); // Get the view data. ViewData vd = getViewData(key); if (vd == null) { vd = new ViewData(value); setViewData(key, vd); } vd.setCurrentValue(newValue); // Fire the value updater if the value has changed. if (valueUpdater != null && !vd.getCurrentValue().equals(vd.getLastValue())) { vd.setLastValue(newValue); valueUpdater.update(newValue); } // Blur the element. super.finishEditing(parent, newValue, key, valueUpdater); }
@Override protected void finishEditing(Element parent, String value, Object key, ValueUpdater<String> valueUpdater) { String newValue = getInputElement(parent).getValue(); // Get the view data. ViewData vd = getViewData(key); if (vd == null) { vd = new ViewData(value); setViewData(key, vd); } vd.setCurrentValue(newValue); // Fire the value updater if the value has changed. if (valueUpdater != null && !vd.getCurrentValue().equals(vd.getLastValue())) { vd.setLastValue(newValue); valueUpdater.update(newValue); } // Blur the element. super.finishEditing(parent, newValue, key, valueUpdater); }
@Override public void render(Context context, String value, SafeHtmlBuilder sb) { // Get the view data. Object key = context.getKey(); ViewData viewData = getViewData(key); if (viewData != null && viewData.getCurrentValue().equals(value)) { clearViewData(key); viewData = null; } String s = (viewData != null) ? viewData.getCurrentValue() : value; if (s != null) { sb.append(template.input(s)); } else { sb.appendHtmlConstant("<input type=\"text\" tabindex=\"-1\"></input>"); } }
@Override public void render(Context context, String value, SafeHtmlBuilder sb) { // Get the view data. Object key = context.getKey(); ViewData viewData = getViewData(key); if (viewData != null && viewData.getCurrentValue().equals(value)) { clearViewData(key); viewData = null; } String s = (viewData != null) ? viewData.getCurrentValue() : value; if (s != null) { sb.append(template.input(s)); } else { sb.appendHtmlConstant("<input type=\"text\" tabindex=\"-1\"></input>"); } }
@Override public void render(Context context, String value, SafeHtmlBuilder sb, String id) { // Get the view data. Object key = context.getKey(); ViewData viewData = getViewData(key); if (viewData != null && viewData.getCurrentValue().equals(value)) { clearViewData(key); viewData = null; } String s = (viewData != null) ? viewData.getCurrentValue() : value; if (s != null) { sb.append(template.inputWithValue(id, s)); } else { sb.append(template.input(id)); } }