/* * Isomorphic SmartGWT web presentation layer * Copyright 2000 and beyond Isomorphic Software, Inc. * * OWNERSHIP NOTICE * Isomorphic Software owns and reserves all rights not expressly granted in this source code, * including all intellectual property rights to the structure, sequence, and format of this code * and to all designs, interfaces, algorithms, schema, protocols, and inventions expressed herein. * * If you have any questions, please email
. * * This entire comment must accompany any portion of Isomorphic Software source code that is * copied or moved from this file. */ package com.smartgwt.sample.showcase.client.componentXML; import com.smartgwt.client.rpc.LoadScreenCallback; import com.smartgwt.client.rpc.RPCManager; import com.smartgwt.client.rpc.RPCResponse; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.DynamicForm; import java.util.Map; import com.google.gwt.core.client.EntryPoint; public class AddingHandlers implements EntryPoint { @Override public void onModuleLoad() { final Canvas layout = new Canvas(); RPCManager.loadScreen("addingHandlers", new LoadScreenCallback() { @Override public void execute() { Button saveButton = (Button) this.getScreen().getByLocalId("saveButton"); final DynamicForm saveForm = (DynamicForm) this.getScreen().getByLocalId("saveForm"); saveButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (Boolean.FALSE.equals((Boolean)saveForm.getValue("inStock")) && saveForm.getValue("nextShipment") == null) { SC.warn("New stock items which are not already stocked must have a Stock Date"); } } }); layout.addChild(this.getScreen()); } }); layout.draw(); } }