Java Code Examples for org.apache.wicket.markup.html.form.Form#setOutputMarkupId()
The following examples show how to use
org.apache.wicket.markup.html.form.Form#setOutputMarkupId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractTypesPage.java From ontopia with Apache License 2.0 | 6 votes |
public AbstractTypesPage(PageParameters parameters) { super(parameters); // add part containing title and help link int subMenuIndex = getSubMenuIndex(); add(new MenuHelpPanel("titlePartPanel", getSubMenuItems(getTopicMapModel()), subMenuIndex, getNameModelForHelpLinkAddress(subMenuIndex))); Form<Object> form = new Form<Object>("form"); add(form); form.setOutputMarkupId(true); // topic types title form.add(new Label("subTitle", getNameModelForType(subMenuIndex))); // function boxes createFunctionBoxes(form, "functionBoxes"); // add tree panel form.add(createTreePanel("tree")); // initialize parent components initParentComponents(); }
Example 2
Source File: MyPictures.java From sakai with Educational Community License v2.0 | 6 votes |
private void createGalleryForm(final String userUuid, long pageToDisplay) { Label galleryHeading = new Label("galleryHeading", new ResourceModel( "heading.pictures.my.pictures")); add(galleryHeading); Form galleryForm = new Form("galleryForm"); galleryForm.setOutputMarkupId(true); populateGallery(galleryForm, userUuid, pageToDisplay); add(galleryForm); Label addPictureHeading = new Label("addPictureHeading", new ResourceModel("heading.pictures.addpicture")); add(addPictureHeading); }
Example 3
Source File: MyPicture.java From sakai with Educational Community License v2.0 | 6 votes |
public MyPicture(String userId, GalleryImage galleryImage, long galleryPageIndex) { configureFeedback(); Label galleryImageHeading = new Label("galleryImageHeading", new Model<String>(galleryImage.getDisplayName())); add(galleryImageHeading); Form galleryImageForm = new Form("galleryImageForm"); galleryImageForm.setOutputMarkupId(true); add(galleryImageForm); GalleryImageEdit galleryImageEdit = new GalleryImageEdit( "galleryImageEdit", userId, galleryImage, galleryPageIndex); galleryImageForm.add(galleryImageEdit); }
Example 4
Source File: MyPictures.java From sakai with Educational Community License v2.0 | 6 votes |
private void createGalleryForm(final String userUuid, long pageToDisplay) { Label galleryHeading = new Label("galleryHeading", new ResourceModel( "heading.pictures.my.pictures")); add(galleryHeading); Form galleryForm = new Form("galleryForm"); galleryForm.setOutputMarkupId(true); populateGallery(galleryForm, userUuid, pageToDisplay); add(galleryForm); Label addPictureHeading = new Label("addPictureHeading", new ResourceModel("heading.pictures.addpicture")); add(addPictureHeading); }
Example 5
Source File: MyPicture.java From sakai with Educational Community License v2.0 | 6 votes |
public MyPicture(String userId, GalleryImage galleryImage, long galleryPageIndex) { configureFeedback(); Label galleryImageHeading = new Label("galleryImageHeading", new Model<String>(galleryImage.getDisplayName())); add(galleryImageHeading); Form galleryImageForm = new Form("galleryImageForm"); galleryImageForm.setOutputMarkupId(true); add(galleryImageForm); GalleryImageEdit galleryImageEdit = new GalleryImageEdit( "galleryImageEdit", userId, galleryImage, galleryPageIndex); galleryImageForm.add(galleryImageEdit); }
Example 6
Source File: ViewPicture.java From sakai with Educational Community License v2.0 | 5 votes |
public ViewPicture(GalleryImage galleryImage) { configureFeedback(); Label galleryImageHeading = new Label("galleryImageHeading", new Model<String>(galleryImage.getDisplayName())); add(galleryImageHeading); Form galleryImageForm = new Form("galleryImageForm"); galleryImageForm.setOutputMarkupId(true); add(galleryImageForm); GalleryImageRenderer galleryImageRenderer = new GalleryImageRenderer( "galleryImageRenderer", galleryImage.getMainResource()); galleryImageForm.add(galleryImageRenderer); }
Example 7
Source File: ActiveLearningSidebar.java From inception with Apache License 2.0 | 5 votes |
private Form<?> createLearningHistory() { Form<?> learningHistoryForm = new Form<Void>(CID_LEARNING_HISTORY_FORM) { private static final long serialVersionUID = -961690443085882064L; }; learningHistoryForm.add(LambdaBehavior.onConfigure(component -> component .setVisible(alStateModel.getObject().isSessionActive()))); learningHistoryForm.setOutputMarkupPlaceholderTag(true); learningHistoryForm.setOutputMarkupId(true); learningHistoryForm.add(createLearningHistoryListView()); return learningHistoryForm; }
Example 8
Source File: ViewPicture.java From sakai with Educational Community License v2.0 | 5 votes |
public ViewPicture(GalleryImage galleryImage) { configureFeedback(); Label galleryImageHeading = new Label("galleryImageHeading", new Model<String>(galleryImage.getDisplayName())); add(galleryImageHeading); Form galleryImageForm = new Form("galleryImageForm"); galleryImageForm.setOutputMarkupId(true); add(galleryImageForm); GalleryImageRenderer galleryImageRenderer = new GalleryImageRenderer( "galleryImageRenderer", galleryImage.getMainResource()); galleryImageForm.add(galleryImageRenderer); }
Example 9
Source File: OpenDocumentDialogPanel.java From webanno with Apache License 2.0 | 5 votes |
public OpenDocumentDialogPanel(String aId, AnnotatorState aState, ModalWindow aModalWindow, IModel<List<DecoratedObject<Project>>> aProjects, SerializableBiFunction<Project, User, List<DecoratedObject<SourceDocument>>> aDocListProvider) { super(aId); modalWindow = aModalWindow; state = aState; projects = aProjects; docListProvider = aDocListProvider; projectListChoice = createProjectListChoice(aState); userListChoice = createUserListChoice(aState); docListChoice = createDocListChoice(); Form<Void> form = new Form<>("form"); form.setOutputMarkupId(true); form.add(projectListChoice); form.add(docListChoice); form.add(userListChoice); buttonsContainer = new WebMarkupContainer("buttons"); buttonsContainer.setOutputMarkupId(true); LambdaAjaxSubmitLink openButton = new LambdaAjaxSubmitLink("openButton", OpenDocumentDialogPanel.this::actionOpenDocument); openButton.add(enabledWhen(() -> docListChoice.getModelObject() != null)); buttonsContainer.add(openButton); buttonsContainer.add( new LambdaAjaxLink("cancelButton", OpenDocumentDialogPanel.this::actionCancel)); form.add(buttonsContainer); form.setDefaultButton(openButton); add(form); }
Example 10
Source File: GalleryImageEdit.java From sakai with Educational Community License v2.0 | 4 votes |
public GalleryImageEdit(String id, final String userId, final GalleryImage image, final long galleryPageIndex) { super(id); log.debug("GalleryImageEdit()"); // feedback label for user alert in event remove/set actions fail final Label formFeedback = new Label("formFeedback"); formFeedback.setOutputMarkupPlaceholderTag(true); add(formFeedback); Form imageEditForm = new Form("galleryImageEditForm"); imageEditForm.setOutputMarkupId(true); add(imageEditForm); imageOptionsContainer = new WebMarkupContainer("galleryImageOptionsContainer"); imageOptionsContainer.setOutputMarkupId(true); imageOptionsContainer.setOutputMarkupPlaceholderTag(true); imageOptionsContainer.add(new Label("removePictureLabel", new ResourceModel("pictures.removepicture"))); AjaxFallbackButton removePictureButton = createRemovePictureButton(imageEditForm); imageOptionsContainer.add(removePictureButton); Label setProfileImageLabel = new Label("setProfileImageLabel", new ResourceModel("pictures.setprofileimage")); imageOptionsContainer.add(setProfileImageLabel); AjaxFallbackButton setProfileImageButton = createSetProfileImageButton(imageEditForm); if ((true == sakaiProxy.isOfficialImageEnabledGlobally() && false == sakaiProxy.isUsingOfficialImageButAlternateSelectionEnabled()) || preferencesLogic.getPreferencesRecordForUser(userId).isUseOfficialImage()) { setProfileImageLabel.setVisible(false); setProfileImageButton.setVisible(false); } imageOptionsContainer.add(setProfileImageButton); imageEditForm.add(imageOptionsContainer); removeConfirmContainer = new WebMarkupContainer("galleryRemoveImageConfirmContainer"); removeConfirmContainer.setOutputMarkupId(true); removeConfirmContainer.setOutputMarkupPlaceholderTag(true); Label removeConfirmLabel = new Label("removePictureConfirmLabel", new ResourceModel("pictures.removepicture.confirm")); removeConfirmContainer.add(removeConfirmLabel); AjaxFallbackButton removeConfirmButton = createRemoveConfirmButton( userId, image, (int) galleryPageIndex, formFeedback, imageEditForm); //removeConfirmButton.add(new FocusOnLoadBehaviour()); removeConfirmContainer.add(removeConfirmButton); AjaxFallbackButton removeCancelButton = createRemoveCancelButton(imageEditForm); removeConfirmContainer.add(removeCancelButton); removeConfirmContainer.setVisible(false); imageEditForm.add(removeConfirmContainer); setProfileImageConfirmContainer = new WebMarkupContainer("gallerySetProfileImageConfirmContainer"); setProfileImageConfirmContainer.setOutputMarkupId(true); setProfileImageConfirmContainer.setOutputMarkupPlaceholderTag(true); Label setProfileImageConfirmLabel = new Label("setProfileImageConfirmLabel", new ResourceModel("pictures.setprofileimage.confirm")); setProfileImageConfirmContainer.add(setProfileImageConfirmLabel); AjaxFallbackButton setProfileImageConfirmButton = createSetProfileImageConfirmButton( userId, image, (int) galleryPageIndex, formFeedback, imageEditForm); //setProfileImageConfirmButton.add(new FocusOnLoadBehaviour()); setProfileImageConfirmContainer.add(setProfileImageConfirmButton); AjaxFallbackButton setProfileImageCancelButton = createSetProfileImageCancelButton(imageEditForm); setProfileImageConfirmContainer.add(setProfileImageCancelButton); setProfileImageConfirmContainer.setVisible(false); imageEditForm.add(setProfileImageConfirmContainer); add(new GalleryImageRenderer("galleryImageMainRenderer", image .getMainResource())); }
Example 11
Source File: MyBusinessEdit.java From sakai with Educational Community License v2.0 | 4 votes |
public MyBusinessEdit(final String id, final UserProfile userProfile, List<CompanyProfile> companyProfilesToAdd, List<CompanyProfile> companyProfilesToRemove, TabDisplay tabDisplay) { super(id); log.debug("MyBusinessEdit()"); this.companyProfilesToAdd = companyProfilesToAdd; this.companyProfilesToRemove = companyProfilesToRemove; // heading add(new Label("heading", new ResourceModel("heading.business.edit"))); // setup form Form form = new Form("form", new Model(userProfile)); form.setOutputMarkupId(true); // form submit feedback final Label formFeedback = new Label("formFeedback"); formFeedback.setOutputMarkupPlaceholderTag(true); form.add(formFeedback); // add warning message if superUser and not editing own profile Label editWarning = new Label("editWarning"); editWarning.setVisible(false); if (sakaiProxy.isSuperUserAndProxiedToUser( userProfile.getUserUuid())) { editWarning.setDefaultModel(new StringResourceModel( "text.edit.other.warning", null, new Object[] { userProfile .getDisplayName() })); editWarning.setEscapeModelStrings(false); editWarning.setVisible(true); } form.add(editWarning); // business biography WebMarkupContainer businessBiographyContainer = new WebMarkupContainer( "businessBiographyContainer"); businessBiographyContainer.add(new Label("businessBiographyLabel", new ResourceModel("profile.business.bio"))); TextArea businessBiography = new TextArea( "businessBiography", new PropertyModel<String>(userProfile, "businessBiography")); businessBiography.setMarkupId("businessbioinput"); businessBiography.setOutputMarkupId(true); //businessBiography.setEditorConfig(CKEditorConfig.createCkConfig()); businessBiographyContainer.add(businessBiography); form.add(businessBiographyContainer); // company profiles WebMarkupContainer companyProfileEditsContainer = createCompanyProfileEditsContainer(userProfile, tabDisplay); form.add(companyProfileEditsContainer); AjaxFallbackButton addCompanyProfileButton = createAddCompanyProfileButton( id, userProfile, form, formFeedback); form.add(addCompanyProfileButton); AjaxFallbackButton removeCompanyProfileButton = createRemoveCompanyProfileButton( id, userProfile, form); form.add(removeCompanyProfileButton); AjaxFallbackButton submitButton = createSaveChangesButton(id, userProfile, form, formFeedback); //submitButton.add(new CKEditorTextArea.CKEditorAjaxSubmitModifier()); form.add(submitButton); AjaxFallbackButton cancelButton = createCancelChangesButton(id, userProfile, form); form.add(cancelButton); add(form); }
Example 12
Source File: ViewPictures.java From sakai with Educational Community License v2.0 | 4 votes |
private void createGalleryForm(final String userUuid) { Label galleryHeading = new Label("galleryHeading", new StringResourceModel( "heading.pictures.view.pictures", null, new Object[] { sakaiProxy.getUserDisplayName(userUuid) })); add(galleryHeading); Form galleryForm = new Form("galleryForm") { private static final long serialVersionUID = 1L; }; galleryForm.setOutputMarkupId(true); populateGallery(galleryForm, userUuid); add(galleryForm); }
Example 13
Source File: InstancePage.java From ontopia with Apache License 2.0 | 4 votes |
public InstancePage(PageParameters parameters) { super(parameters); String topicMapId = parameters.getString("topicMapId"); String topicId = parameters.getString("topicId"); this.topicModel = new TopicModel<Topic>(topicMapId, topicId); Topic topic = topicModel.getTopic(); if (topic == null) throw new NoSuchTopicException("No topic with id " + topicId + " found."); // if "topicType" parameter is specified, pull out most specific direct type TopicType tt = null; String topicTypeId = parameters.getString("topicTypeId"); if (topicTypeId != null) tt = topic.getMostSpecificTopicType(new TopicTypeModel(topicMapId, topicTypeId).getTopicType()); // if not topic type found, use first available direct type if (tt == null) tt = OntopolyUtils.getDefaultTopicType(topic); this.topicTypeModel = new TopicTypeModel(tt); String viewId = parameters.getString("viewId"); if (viewId != null) this.fieldsViewModel = new FieldsViewModel(topicMapId, viewId); else this.fieldsViewModel = new FieldsViewModel(FieldsView.getDefaultFieldsView(topic.getTopicMap())); Privilege privilege = ((OntopolySession)Session.get()).getPrivilege(topic); // Block access to page if user has privilege NONE if (privilege == Privilege.NONE) { setResponsePage(new AccessDeniedPage(parameters)); return; } // page is read-only if topic type is read-only setReadOnlyPage(tt.isReadOnly() || Objects.equals(getRequest().getParameter("ro"), "true") || !((AbstractOntopolyPage)this).filterTopic(topic) || privilege != Privilege.EDIT); this.isOntologyPage = (parameters.get("ontology") != null); // Add form Form<Object> form = new Form<Object>("form"); add(form); form.setOutputMarkupId(true); int subMenuIndex = -1; if (isOntologyPage) { // Adding part containing title and help link add(new MenuHelpPanel("titlePartPanel", AbstractTypesPage.getSubMenuItems(getTopicMapModel()), subMenuIndex, AbstractTypesPage.getNameModelForHelpLinkAddress(subMenuIndex))); } else { // Adding part containing title and help link TitleHelpPanel titlePartPanel = new TitleHelpPanel("titlePartPanel", new PropertyModel<String>(topicModel, "name"), new HelpLinkResourceModel("help.link.instancepage")); titlePartPanel.setOutputMarkupId(true); add(titlePartPanel); } // topic title form.add(new Label("subTitle", new PropertyModel<String>(topicModel, "name")) { @Override public boolean isVisible() { return isOntologyPage; } }); // Add fields panel createFields(form); // Function boxes createFunctionBoxes(form, "functionBoxes"); // initialize parent components initParentComponents(); }
Example 14
Source File: AnyTypeClassDetailsPanel.java From syncope with Apache License 2.0 | 4 votes |
public AnyTypeClassDetailsPanel(final String id, final AnyTypeClassTO anyTypeClassTO) { super(id); this.anyTypeClassTO = anyTypeClassTO; buildAvailableSchemas(anyTypeClassTO.getKey()); final Form<AnyTypeClassTO> antTypeClassForm = new Form<>("form"); antTypeClassForm.setModel(new CompoundPropertyModel<>(anyTypeClassTO)); antTypeClassForm.setOutputMarkupId(true); add(antTypeClassForm); final AjaxTextFieldPanel key = new AjaxTextFieldPanel( Constants.KEY_FIELD_NAME, getString(Constants.KEY_FIELD_NAME), new PropertyModel<>(this.anyTypeClassTO, Constants.KEY_FIELD_NAME)); key.addRequiredLabel(); key.setEnabled(anyTypeClassTO.getKey() == null || this.anyTypeClassTO.getKey().isEmpty()); antTypeClassForm.add(key); final WebMarkupContainer container = new WebMarkupContainer("container"); container.setOutputMarkupId(true); antTypeClassForm.add(container); AjaxPalettePanel<String> plainSchema = new AjaxPalettePanel.Builder<String>(). setAllowOrder(true). setAllowMoveAll(true). build("plainSchemas", new PropertyModel<>(this.anyTypeClassTO, "plainSchemas"), new ListModel<>(availablePlainSchemas)); plainSchema.hideLabel(); plainSchema.setOutputMarkupId(true); container.add(plainSchema); AjaxPalettePanel<String> derSchema = new AjaxPalettePanel.Builder<String>(). setAllowOrder(true). setAllowMoveAll(true). build("derSchemas", new PropertyModel<>(this.anyTypeClassTO, "derSchemas"), new ListModel<>(availableDerSchemas)); derSchema.hideLabel(); derSchema.setOutputMarkupId(true); container.add(derSchema); AjaxPalettePanel<String> virSchema = new AjaxPalettePanel.Builder<String>(). setAllowOrder(true). setAllowMoveAll(true). build("virSchemas", new PropertyModel<>(this.anyTypeClassTO, "virSchemas"), new ListModel<>(availableVirSchemas)); virSchema.hideLabel(); virSchema.setOutputMarkupId(true); container.add(virSchema); }
Example 15
Source File: ViewPictures.java From sakai with Educational Community License v2.0 | 4 votes |
private void createGalleryForm(final String userUuid) { Label galleryHeading = new Label("galleryHeading", new StringResourceModel( "heading.pictures.view.pictures", null, new Object[] { sakaiProxy.getUserDisplayName(userUuid) })); add(galleryHeading); Form galleryForm = new Form("galleryForm") { private static final long serialVersionUID = 1L; }; galleryForm.setOutputMarkupId(true); populateGallery(galleryForm, userUuid); add(galleryForm); }
Example 16
Source File: GalleryImageEdit.java From sakai with Educational Community License v2.0 | 4 votes |
public GalleryImageEdit(String id, final String userId, final GalleryImage image, final long galleryPageIndex) { super(id); log.debug("GalleryImageEdit()"); // feedback label for user alert in event remove/set actions fail final Label formFeedback = new Label("formFeedback"); formFeedback.setOutputMarkupPlaceholderTag(true); add(formFeedback); Form imageEditForm = new Form("galleryImageEditForm"); imageEditForm.setOutputMarkupId(true); add(imageEditForm); imageOptionsContainer = new WebMarkupContainer("galleryImageOptionsContainer"); imageOptionsContainer.setOutputMarkupId(true); imageOptionsContainer.setOutputMarkupPlaceholderTag(true); imageOptionsContainer.add(new Label("removePictureLabel", new ResourceModel("pictures.removepicture"))); AjaxFallbackButton removePictureButton = createRemovePictureButton(imageEditForm); imageOptionsContainer.add(removePictureButton); Label setProfileImageLabel = new Label("setProfileImageLabel", new ResourceModel("pictures.setprofileimage")); imageOptionsContainer.add(setProfileImageLabel); AjaxFallbackButton setProfileImageButton = createSetProfileImageButton(imageEditForm); if ((true == sakaiProxy.isOfficialImageEnabledGlobally() && false == sakaiProxy.isUsingOfficialImageButAlternateSelectionEnabled()) || preferencesLogic.getPreferencesRecordForUser(userId).isUseOfficialImage()) { setProfileImageLabel.setVisible(false); setProfileImageButton.setVisible(false); } imageOptionsContainer.add(setProfileImageButton); imageEditForm.add(imageOptionsContainer); removeConfirmContainer = new WebMarkupContainer("galleryRemoveImageConfirmContainer"); removeConfirmContainer.setOutputMarkupId(true); removeConfirmContainer.setOutputMarkupPlaceholderTag(true); Label removeConfirmLabel = new Label("removePictureConfirmLabel", new ResourceModel("pictures.removepicture.confirm")); removeConfirmContainer.add(removeConfirmLabel); AjaxFallbackButton removeConfirmButton = createRemoveConfirmButton( userId, image, (int) galleryPageIndex, formFeedback, imageEditForm); //removeConfirmButton.add(new FocusOnLoadBehaviour()); removeConfirmContainer.add(removeConfirmButton); AjaxFallbackButton removeCancelButton = createRemoveCancelButton(imageEditForm); removeConfirmContainer.add(removeCancelButton); removeConfirmContainer.setVisible(false); imageEditForm.add(removeConfirmContainer); setProfileImageConfirmContainer = new WebMarkupContainer("gallerySetProfileImageConfirmContainer"); setProfileImageConfirmContainer.setOutputMarkupId(true); setProfileImageConfirmContainer.setOutputMarkupPlaceholderTag(true); Label setProfileImageConfirmLabel = new Label("setProfileImageConfirmLabel", new ResourceModel("pictures.setprofileimage.confirm")); setProfileImageConfirmContainer.add(setProfileImageConfirmLabel); AjaxFallbackButton setProfileImageConfirmButton = createSetProfileImageConfirmButton( userId, image, (int) galleryPageIndex, formFeedback, imageEditForm); //setProfileImageConfirmButton.add(new FocusOnLoadBehaviour()); setProfileImageConfirmContainer.add(setProfileImageConfirmButton); AjaxFallbackButton setProfileImageCancelButton = createSetProfileImageCancelButton(imageEditForm); setProfileImageConfirmContainer.add(setProfileImageCancelButton); setProfileImageConfirmContainer.setVisible(false); imageEditForm.add(setProfileImageConfirmContainer); add(new GalleryImageRenderer("galleryImageMainRenderer", image .getMainResource())); }
Example 17
Source File: MyBusinessEdit.java From sakai with Educational Community License v2.0 | 4 votes |
public MyBusinessEdit(final String id, final UserProfile userProfile, List<CompanyProfile> companyProfilesToAdd, List<CompanyProfile> companyProfilesToRemove, TabDisplay tabDisplay) { super(id); log.debug("MyBusinessEdit()"); this.companyProfilesToAdd = companyProfilesToAdd; this.companyProfilesToRemove = companyProfilesToRemove; // heading add(new Label("heading", new ResourceModel("heading.business.edit"))); // setup form Form form = new Form("form", new Model(userProfile)); form.setOutputMarkupId(true); // form submit feedback final Label formFeedback = new Label("formFeedback"); formFeedback.setOutputMarkupPlaceholderTag(true); form.add(formFeedback); // add warning message if superUser and not editing own profile Label editWarning = new Label("editWarning"); editWarning.setVisible(false); if (sakaiProxy.isSuperUserAndProxiedToUser( userProfile.getUserUuid())) { editWarning.setDefaultModel(new StringResourceModel( "text.edit.other.warning", null, new Object[] { userProfile .getDisplayName() })); editWarning.setEscapeModelStrings(false); editWarning.setVisible(true); } form.add(editWarning); // business biography WebMarkupContainer businessBiographyContainer = new WebMarkupContainer( "businessBiographyContainer"); businessBiographyContainer.add(new Label("businessBiographyLabel", new ResourceModel("profile.business.bio"))); TextArea businessBiography = new TextArea( "businessBiography", new PropertyModel<String>(userProfile, "businessBiography")); businessBiography.setMarkupId("businessbioinput"); businessBiography.setOutputMarkupId(true); //businessBiography.setEditorConfig(CKEditorConfig.createCkConfig()); businessBiographyContainer.add(businessBiography); form.add(businessBiographyContainer); // company profiles WebMarkupContainer companyProfileEditsContainer = createCompanyProfileEditsContainer(userProfile, tabDisplay); form.add(companyProfileEditsContainer); AjaxFallbackButton addCompanyProfileButton = createAddCompanyProfileButton( id, userProfile, form, formFeedback); form.add(addCompanyProfileButton); AjaxFallbackButton removeCompanyProfileButton = createRemoveCompanyProfileButton( id, userProfile, form); form.add(removeCompanyProfileButton); AjaxFallbackButton submitButton = createSaveChangesButton(id, userProfile, form, formFeedback); //submitButton.add(new CKEditorTextArea.CKEditorAjaxSubmitModifier()); form.add(submitButton); AjaxFallbackButton cancelButton = createCancelChangesButton(id, userProfile, form); form.add(cancelButton); add(form); }
Example 18
Source File: CurationSidebar.java From inception with Apache License 2.0 | 4 votes |
public CurationSidebar(String aId, IModel<AnnotatorState> aModel, AnnotationActionHandler aActionHandler, CasProvider aCasProvider, AnnotationPage aAnnotationPage) { super(aId, aModel, aActionHandler, aCasProvider, aAnnotationPage); annoPage = aAnnotationPage; mainContainer = new WebMarkupContainer("mainContainer"); mainContainer.setOutputMarkupId(true); add(mainContainer); // set up user-checklist usersForm = createUserSelection(); usersForm.setOutputMarkupId(true); mainContainer.add(usersForm); // set up settings form for curation target Form<Void> settingsForm = createSettingsForm("settingsForm"); settingsForm.setOutputMarkupId(true); settingsForm.setVisible(false); mainContainer.add(settingsForm); // confirmation dialog when using automatic merging (might change user's annos) IModel<String> documentNameModel = PropertyModel.of(annoPage.getModel(), "document.name"); add(mergeConfirm = new MergeDialog("mergeConfirmDialog", new StringResourceModel("mergeConfirmTitle", this), new StringResourceModel("mergeConfirmText", this) .setModel(annoPage.getModel()).setParameters(documentNameModel), documentNameModel)); mainContainer.add(mergeConfirm); // Add empty space message noDocsLabel = new Label("noDocumentsLabel", new ResourceModel("noDocuments")); mainContainer.add(noDocsLabel); // if curation user changed we have to reload the document AnnotatorState state = aModel.getObject(); String currentUser = userRepository.getCurrentUser().getUsername(); long projectid = state.getProject().getId(); User curationUser = curationService.retrieveCurationUser(currentUser, projectid); if (currentUser != null && !currentUser.equals(curationUser.getUsername())) { state.setUser(curationUser); Optional<AjaxRequestTarget> target = RequestCycle.get().find(AjaxRequestTarget.class); annoPage.actionLoadDocument(target.orElseGet(null)); } // user started curating, extension can show suggestions state.setMetaData(CurationMetadata.CURATION_USER_PROJECT, true); }