/** * Create Image with name, id of button_name and set M_Command onClick * * @param name Name of the Image used also for Name24.gif * @param js_command Java script command, null results in 'submit();', an empty string disables * OnClick * @param enabled Enable the immage button, if not uses the "D" image * @return Image */ private static img createControlButtonImage(String name, String js_command, boolean enabled) { StringBuffer imgName = new StringBuffer("wf" + name); if (!enabled) imgName.append("D"); imgName.append("24.gif"); // img img = new img(MobileEnv.getImageDirectory(imgName.toString()), name); if (enabled) img.setAlt(Msg.getMsg(AD_Language, name)); // Translate ToolTip img.setID("imgButton"); // css // append js command only to enabled image if (js_command != null && js_command.length() > 0 && enabled) { img.setOnClick( "document." + FORM_NAME + "." + M_Command + ".value='" + name + "';" + js_command); } // return img; } // createImage
/** * Create Image with name, id of button_name and set M_Command onClick * * @param name Name of the Image used also for Name24.gif * @param js_command Java script command, null results in 'submit();', an empty string disables * OnClick * @param enabled Enable the immage button, if not uses the "D" image * @return Image */ private static img createWorkflowImage( String name, int activeNode, String js_command, boolean pressed) { StringBuffer imgName = new StringBuffer(name); imgName.append("WF"); imgName.append(".gif"); // img img = new img(MobileEnv.getImageDirectory(imgName.toString()), name); if (!(imgName.toString()).startsWith("Spacer") && !(imgName.toString()).startsWith("Arrow")) { if (!pressed) img.setID("imgButton"); // css else img.setID("imgButtonPressed"); } // append js command only to enabled image if (js_command != null && js_command.length() > 0 && activeNode != 0) { String js_command_front = "document." + FORM_NAME + "." + J_Command + ".value='" + activeNode + "'; "; js_command_front = js_command_front + "document." + FORM_NAME + ".submit();"; img.setOnClick(js_command_front + js_command); } // return img; } // createImage