/** * Invoked when the label is in edit mode, and received a cancel event. Typically, nothing * should be done here. * * @param target * the ajax request target */ protected void onCancel(AjaxRequestTarget target) { label.setVisible(true); editor.setVisible(false); target.addComponent(AjaxEditableLabel.this); }
/** * Invoked when the editor was successfully updated. Use this method e.g. to persist the changed * value. This implementation displays the label and clears any window status that might have * been set in onError. * * @param target * The ajax request target */ protected void onSubmit(AjaxRequestTarget target) { label.setVisible(true); editor.setVisible(false); target.addComponent(AjaxEditableLabel.this); target.appendJavascript("window.status='';"); }
/** * Called when the label is clicked and the component is put in edit mode. * * @param target * Ajax target */ protected void onEdit(AjaxRequestTarget target) { label.setVisible(false); editor.setVisible(true); target.addComponent(AjaxEditableLabel.this); // put focus on the textfield and stupid explorer hack to move the // caret to the end target.appendJavascript("{ var el=wicketGet('" + editor.getMarkupId() + "');" + " if (el.createTextRange) { " + " var v = el.value; var r = el.createTextRange(); " + " r.moveStart('character', v.length); r.select(); } }"); target.focusComponent(editor); }
private void addImageHistoryFLow() { WebComponent imageHistFlow; if (requirementPK != null) { String classCss = " col-md-12 "; FlowInstance flowInstance = requirementService.getRequirement(requirementPK).getFlowInstance(); flowInstance.getTasksOlderFirst(); if (flowInstance.getFlowDefinition().getFlowMap().getAllTasks().size() <= QUANTIDADE_MAX_TAKS_TO_MIDDLE_SIZE) { classCss = " col-md-6 col-md-offset-3 "; } byte[] bytes = generateHistImage(flowInstance); DynamicImageResource imageResource = new DynamicImageResource() { @Override protected byte[] getImageData(IResource.Attributes attributes) { return bytes; } }; imageHistFlow = new Image("imageHist", imageResource); imageHistFlow.setVisible(bytes.length != 0); imageHistFlow.add(new AttributeAppender("class", classCss)); } else { imageHistFlow = new WebComponent("imageHist"); imageHistFlow.setVisible(false); } add(imageHistFlow); }
Component linkImage = new WebComponent("searchLinkImage").setVisible(false); if (pBuilder.imageResource != null || pBuilder.imageResourceReference != null)