本文整理匯總了Java中org.apache.wicket.markup.html.form.Form.setMultiPart方法的典型用法代碼示例。如果您正苦於以下問題:Java Form.setMultiPart方法的具體用法?Java Form.setMultiPart怎麽用?Java Form.setMultiPart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.form.Form
的用法示例。
在下文中一共展示了Form.setMultiPart方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initLayout
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void initLayout() {
Form mainForm = new Form("mainForm");
mainForm.setMultiPart(true);
add(mainForm);
mainForm.add(new ScenePanel(ID_PRIMARY_DELTAS_SCENE, primaryDeltasModel));
mainForm.add(new ScenePanel(ID_SECONDARY_DELTAS_SCENE, secondaryDeltasModel));
WebMarkupContainer policyViolationsContainer = new WebMarkupContainer(ID_POLICY_VIOLATIONS_CONTAINER);
policyViolationsContainer.add(new VisibleBehaviour(() -> !policyViolationsModel.getObject().getPart().isEmpty()));
policyViolationsContainer.add(new InformationPanel(ID_POLICY_VIOLATIONS, policyViolationsModel));
mainForm.add(policyViolationsContainer);
WebMarkupContainer approvalsContainer = new WebMarkupContainer(ID_APPROVALS_CONTAINER);
approvalsContainer.add(new VisibleBehaviour(() -> !approvalsModel.getObject().isEmpty()));
approvalsContainer.add(new ApprovalProcessesPreviewPanel(ID_APPROVALS, approvalsModel));
mainForm.add(approvalsContainer);
initButtons(mainForm);
}
示例2: initLayout
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void initLayout() {
Form mainForm = new Form("mainForm");
mainForm.setMultiPart(true);
add(mainForm);
WebMarkupContainer protectedMessage = new WebMarkupContainer(ID_PROTECTED_MESSAGE);
protectedMessage.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
ObjectWrapper wrapper = accountModel.getObject();
return wrapper.isProtectedAccount();
}
});
mainForm.add(protectedMessage);
PrismObjectPanel<ShadowType> userForm = new PrismObjectPanel<ShadowType>("account", accountModel, new PackageResourceReference(
ImgResources.class, ImgResources.HDD_PRISM), mainForm, this);
mainForm.add(userForm);
initButtons(mainForm);
}
示例3: initLayout
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void initLayout() {
WorkItemSummaryPanel summaryPanel = new WorkItemSummaryPanel(ID_SUMMARY_PANEL,
new PropertyModel<>(workItemDtoModel, WorkItemDto.F_WORK_ITEM), workItemDtoModel, this);
add(summaryPanel);
Form mainForm = new Form(ID_MAIN_FORM);
mainForm.setMultiPart(true);
add(mainForm);
mainForm.add(new WorkItemPanel(ID_WORK_ITEM_PANEL, workItemDtoModel, mainForm, this));
initButtons(mainForm);
}
示例4: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
final RI requirement = loadRequirement();
currentModel = $m.loadable(() -> requirement != null && requirement.getCod() != null ? requirementService.getRequirement(requirement.getCod()) : requirement);
currentModel.setObject(requirement);
fillTransitionControllerMap(transitionControllerMap);
SingularSpringInjector.get().injectAll(transitionControllerMap.values());
SingularSpringInjector.get().injectAll(transitionConfirmModalMap.values());
singularFormPanel.setViewMode(getViewMode(config));
singularFormPanel.setAnnotationMode(getAnnotationMode(config));
singularFormPanel.setInstanceCreator(() -> createInstance(formRequirementService.loadRefType(config.getFormName())));
Form<?> form = new Form<>("save-form");
form.setMultiPart(true);
form.add(singularFormPanel);
form.add(modalContainer);
BSModalBorder enviarModal = buildConfirmationModal(modalContainer, getInstanceModel());
form.add(buildSendButton(enviarModal));
form.add(buildSaveButton());
form.add(buildFlowButtons());
form.add(buildValidateButton());
form.add(buildExtensionButtons());
form.add(buildCloseButton());
form.add(closeModal);
form.add(buildExtraContent("extra-content"));
add(form);
}
示例5: ExportImportDependenciesPanel
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
/**
* Constructor for the import/export dependencies panel. The page is initialized in this method,
* including the event type dropdown and export button and the upload for importing.
*
* @param id initialized ID
* @param page the page the panel belongs to
*/
ExportImportDependenciesPanel(String id, final GeneratorPage page) {
super(id);
this.page = page;
exportForm = new Form("exportForm");
this.add(exportForm);
importForm = new Form("importForm") {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit() {
final FileUpload uploadedFile = uploadField.getFileUpload();
if (uploadedFile == null) {
this.error("File not found.");
return;
}
// make sure provided file is json
final String fileName = uploadedFile.getClientFileName();
String fileFormat = fileName.substring(fileName.lastIndexOf('.') + 1);
if (!"json".equals(fileFormat)) {
error("Please provide a json file.");
return;
}
// generate dependencies from file
File newFile;
try {
newFile = uploadedFile.writeToTempFile();
String fileContent = Files.readFirstLine(newFile, Charset.defaultCharset());
boolean success = JsonImporter.generateAttributeDependenciesFromString(fileContent);
if (!success) {
error("Dependencies could not be created. "
+ "Make sure you have the correct event type stored and the attribute values match their type.");
return;
}
} catch (Exception e) {
logger.warn("File could not be read.", e);
return;
}
success("Saved attribute dependencies.");
}
};
importForm.setMultiPart(true);
this.add(importForm);
this.addEventTypeDropDown();
this.addExportButton();
this.addImportField();
}