1 14 package org.wings.plaf.css; 15 16 17 import org.wings.*; 18 import org.wings.io.Device; 19 import org.wings.session.SessionManager; 20 21 import java.io.IOException ; 22 23 public class FormCG extends AbstractComponentCG implements org.wings.plaf.FormCG { 24 25 private static final SIcon BLIND_ICON = (SIcon) SessionManager.getSession() 26 .getCGManager().getObject("FormCG.blindIcon", SIcon.class); 27 28 protected void writeContent(final Device device, final SComponent c) throws IOException { 29 final SForm component = (SForm) c; 30 31 device.print("<form method=\""); 32 if (component.isPostMethod()) { 33 device.print("POST"); 34 } else { 35 device.print("GET"); 36 } 37 device.print("\""); 38 39 Utils.optAttribute(device, "name", component.getName()); 40 Utils.writeEvents(device, component); 41 Utils.optAttribute(device, "class", component.getStyle()); 42 Utils.optAttribute(device, "enctype", component.getEncodingType()); 43 Utils.optAttribute(device, "action", component.getRequestURL()); 44 45 Utils.printCSSInlineFullSize(device, component.getPreferredSize()); 46 47 66 device.print("><input type=\"image\" name=\"_capture_enter1\" border=\"0\" "); 67 Utils.optAttribute(device, "src", BLIND_ICON.getURL()); 68 device.print(" width=\"0\" height=\"0\" tabindex=\"\" style=\"border:none;padding:0px;margin:0px;position:absolute\"/>"); 69 70 device.print("<input type=\"hidden\" name=\""); 72 Utils.write(device, Utils.event(component)); 73 device.print("\" value=\""); 74 Utils.write(device, component.getName()); 75 Utils.write(device, SConstants.UID_DIVIDER); 76 device.print("\" />"); 77 78 Utils.renderContainer(device, component); 80 81 device.print("<input type=\"image\" name=\"_capture_enter2\" border=\"0\" "); 83 Utils.optAttribute(device, "src", BLIND_ICON.getURL()); 84 device.print(" width=\"0\" height=\"0\" tabindex=\"\" style=\"border:none;padding:0px;margin:0px;position:absolute\"/>"); 85 86 device.print("</form>"); 87 } 88 89 } 90 | Popular Tags |