/** * Notifies components of input from the client via the <code>Component.processInput()</code> * method. * * @see nextapp.echo.app.Component#processInput(java.lang.String, java.lang.Object) */ void process() { // Process application-level property updates. Iterator applicationUpdateIt = applicationUpdateMap.keySet().iterator(); while (applicationUpdateIt.hasNext()) { String propertyName = (String) applicationUpdateIt.next(); Object propertyValue = applicationUpdateMap.get(propertyName); applicationInstance.processInput(propertyName, propertyValue); } // Process property updates. Iterator componentUpdateIt = clientComponentUpdateMap.values().iterator(); while (componentUpdateIt.hasNext()) { ClientComponentUpdate update = (ClientComponentUpdate) componentUpdateIt.next(); Iterator inputNameIt = update.getInputNames(); while (inputNameIt.hasNext()) { String inputName = (String) inputNameIt.next(); update.getComponent().processInput(inputName, update.getInputValue(inputName)); } } // Process action. if (actionComponent != null) { actionComponent.processInput(actionName, actionValue); } }
/** * Adds a property update received from the client. * * @param component the updated component * @param inputName the name of the input property * @param inputValue the value of the input property */ public void setComponentProperty(Component component, String inputName, Object inputValue) { if (!component.verifyInput(inputName, inputValue)) { // Invalid input. return; } ClientComponentUpdate clientUpdate = (ClientComponentUpdate) clientComponentUpdateMap.get(component); if (clientUpdate == null) { clientUpdate = new ClientComponentUpdate(component); clientComponentUpdateMap.put(component, clientUpdate); } clientUpdate.addInput(inputName, inputValue); }