@Override protected void onBeforeRender() { updateFields(); super.onBeforeRender(); }
@Override protected void onModelChanged() { // when the client programmatically changed the model, update the fields // so that the textfields will change too updateFields(); visitChildren(TextField.class, new Component.IVisitor() { public Object component(Component component) { ((TextField) component).clearInput(); return CONTINUE_TRAVERSAL; } }); }
@Override protected void onBeforeRender() { updateFields(); super.onBeforeRender(); }
@SuppressWarnings("unchecked") @Override protected void onModelChanged() { // when the client programmatically changed the model, update the fields // so that the textfields will change too updateFields(); visitChildren( TextField.class, (component, visit) -> { ((TextField<String>) component).clearInput(); }); }
void initComponents() { updateFields(); add(minXLabel = new Label("minXL", new ResourceModel("minX"))); add(minYLabel = new Label("minYL", new ResourceModel("minY"))); add(maxXLabel = new Label("maxXL", new ResourceModel("maxX"))); add(maxYLabel = new Label("maxYL", new ResourceModel("maxY"))); add( minXInput = new DecimalTextField( "minX", new PropertyModel(this, "minX")) ); add( minYInput = new DecimalTextField( "minY", new PropertyModel(this, "minY")) ); add( maxXInput = new DecimalTextField( "maxX", new PropertyModel(this, "maxX") )); add( maxYInput = new DecimalTextField( "maxY", new PropertyModel(this, "maxY")) ); crsContainer = new WebMarkupContainer("crsContainer"); crsContainer.setVisible(false); crsPanel = new CRSPanel("crs", new PropertyModel(this, "crs")); crsContainer.add(crsPanel); add(crsContainer); }
void initComponents() { updateFields(); add(minXLabel = new Label("minXL", new ResourceModel("minX"))); add(minYLabel = new Label("minYL", new ResourceModel("minY"))); add(minZLabel = new Label("minZL", new ResourceModel("minZ"))); add(maxXLabel = new Label("maxXL", new ResourceModel("maxX"))); add(maxYLabel = new Label("maxYL", new ResourceModel("maxY"))); add(maxZLabel = new Label("maxZL", new ResourceModel("maxZ"))); add(minXInput = new DecimalTextField("minX", new PropertyModel<Double>(this, "minX"))); add(minYInput = new DecimalTextField("minY", new PropertyModel<Double>(this, "minY"))); add(minZInput = new DecimalTextField("minZ", new PropertyModel<Double>(this, "minZ"))); add(maxXInput = new DecimalTextField("maxX", new PropertyModel<Double>(this, "maxX"))); add(maxYInput = new DecimalTextField("maxY", new PropertyModel<Double>(this, "maxY"))); add(maxZInput = new DecimalTextField("maxZ", new PropertyModel<Double>(this, "maxZ"))); minZInput.setVisible(is3D()); minZLabel.setVisible(is3D()); maxZInput.setVisible(is3D()); maxZLabel.setVisible(is3D()); crsContainer = new WebMarkupContainer("crsContainer"); crsContainer.setVisible(false); crsPanel = new CRSPanel("crs", new PropertyModel<CoordinateReferenceSystem>(this, "crs")); crsContainer.add(crsPanel); add(crsContainer); }