Java Code Examples for org.apache.wicket.Component#setOutputMarkupId()

The following examples show how to use org.apache.wicket.Component#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: BeanPropertyEditor.java    From onedev with MIT License 5 votes vote down vote up
private Component newBeanEditor(Serializable propertyValue) {
	Component beanEditor;
	if (propertyValue != null)
		beanEditor = BeanContext.edit(BEAN_EDITOR_ID, propertyValue, excludedProperties, true);
	else 
		beanEditor = new WebMarkupContainer(BEAN_EDITOR_ID).setVisible(false);
	beanEditor.setOutputMarkupId(true);
	beanEditor.setOutputMarkupPlaceholderTag(true);
	return beanEditor;
}
 
Example 2
Source File: MyBusinessDisplay.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
private void addEditButton(final String id, final UserProfile userProfile) {
	AjaxFallbackLink editButton = new AjaxFallbackLink("editButton",
			new ResourceModel("button.edit")) {

		private static final long serialVersionUID = 1L;

		public void onClick(AjaxRequestTarget target) {
			Component newPanel = new MyBusinessEdit(id, userProfile);
			newPanel.setOutputMarkupId(true);
			MyBusinessDisplay.this.replaceWith(newPanel);
			if (target != null) {
				target.add(newPanel);
				// resize iframe
				target.appendJavaScript("setMainFrameHeight(window.name);");
			}

		}

	};
	editButton.add(new Label("editButtonLabel", new ResourceModel(
			"button.edit")));
	editButton.setOutputMarkupId(true);

	if (userProfile.isLocked() && !sakaiProxy.isSuperUser()) {
		editButton.setVisible(false);
	}

	add(editButton);
}
 
Example 3
Source File: MyNamePronunciationDisplay.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public MyNamePronunciationDisplay(final String id, final UserProfile userProfile) {
    super(id);

    log.debug("MyNamePronunciationDisplay()");

    final Component thisPanel = this;
    this.userProfile = userProfile;

    //heading
    add(new Label("heading", new ResourceModel("heading.name.pronunciation")));

    addPhoneticPronunciation();
    addNameRecord();

    AjaxFallbackLink editButton = new AjaxFallbackLink("editButton", new ResourceModel("button.edit")) {
        public void onClick(AjaxRequestTarget target) {
            Component newPanel = new MyNamePronunciationEdit(id, userProfile);
            newPanel.setOutputMarkupId(true);
            thisPanel.replaceWith(newPanel);
            if(target != null) {
                target.add(newPanel);
                target.appendJavaScript("setMainFrameHeight(window.name);");
            }
        }
    };
    editButton.add(new Label("editButtonLabel", new ResourceModel("button.edit")));
    editButton.setOutputMarkupId(true);
    if(userProfile.isLocked() && !sakaiProxy.isSuperUser()) {
        editButton.setVisible(false);
    }
    add(editButton);

    //no fields message
    Label noFieldsMessage = new Label("noFieldsMessage", new ResourceModel("text.no.fields"));
    add(noFieldsMessage);
    if(visibleFieldCount > 0) {
        noFieldsMessage.setVisible(false);
    }
}
 
Example 4
Source File: AbstractBirtReportPanel.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
public AbstractBirtReportPanel(String id,IBirtReportConfig config) throws EngineException{
	super(id);
	this.config = config;
	paramDefinitions = new ArrayList<BirtReportParameterDefinition>();
	hiddenParamDefinitions = new ArrayList<BirtReportParameterDefinition>();
	reportHash = makeReportHash();
	updateReportCache();
	
	Component reportComponent = new Label(REPORT_COMPONENT_NAME,""); 
	reportComponent.setEscapeModelStrings(false);
	reportComponent.setOutputMarkupId(true);
	add(reportComponent);
	
}
 
Example 5
Source File: BootstrapDateTimePickerBehaviour.java    From pm-wicket-utils with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onConfigure(Component component) 
{
	super.onConfigure(component);
	
	component.setOutputMarkupId(true);
}
 
Example 6
Source File: MyBusinessDisplay.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
private void addEditButton(final String id, final UserProfile userProfile) {
	AjaxFallbackLink editButton = new AjaxFallbackLink("editButton",
			new ResourceModel("button.edit")) {

		private static final long serialVersionUID = 1L;

		public void onClick(AjaxRequestTarget target) {
			Component newPanel = new MyBusinessEdit(id, userProfile);
			newPanel.setOutputMarkupId(true);
			MyBusinessDisplay.this.replaceWith(newPanel);
			if (target != null) {
				target.add(newPanel);
				// resize iframe
				target.appendJavaScript("setMainFrameHeight(window.name);");
			}

		}

	};
	editButton.add(new Label("editButtonLabel", new ResourceModel(
			"button.edit")));
	editButton.setOutputMarkupId(true);

	if (userProfile.isLocked() && !sakaiProxy.isSuperUser()) {
		editButton.setVisible(false);
	}

	add(editButton);
}
 
Example 7
Source File: DraggableBehavior.java    From ontopia with Apache License 2.0 5 votes vote down vote up
@Override
protected void onBind() {
  super.onBind();
  Component c = getComponent();
  c.setOutputMarkupId(true);
  c.add(new AttributeAppender("class", new Model<String>("dg_" + id), " "));    
}
 
Example 8
Source File: DroppableBehavior.java    From ontopia with Apache License 2.0 5 votes vote down vote up
@Override
protected void onBind() {
  super.onBind();
  Component c = getComponent();
  c.setOutputMarkupId(true);
  c.add(new AttributeAppender("class", new Model<String>("do_" + id), " "));    
}
 
Example 9
Source File: UpdateOnActionPerformedEventBehavior.java    From Orienteer with Apache License 2.0 4 votes vote down vote up
@Override
public void bind(Component component) {
	super.bind(component);
	component.setOutputMarkupId(true);
}
 
Example 10
Source File: StatementEditor.java    From inception with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new fragement for editing a statement.<br>
 * The editor has two slightly different behaviors, depending on the value of
 * {@code isNewStatement}:
 * <ul>
 * <li>{@code !isNewStatement}: Save button commits changes, cancel button discards unsaved
 * changes, delete button removes the statement from the KB.</li>
 * <li>{@code isNewStatement}: Save button commits changes (creates a new statement in the
 * KB), cancel button removes the statement from the UI, delete button is not visible.</li>
 * </ul>
 * 
 * @param aId
 *            markup ID
 * @param aStatement
 *            statement model
 * @param isNewStatement
 *            whether the statement being edited is new, meaning it has no corresponding
 *            statement in the KB backend
 */
public EditMode(String aId, IModel<KBStatement> aStatement, boolean isNewStatement) {
    super(aId, "editMode", StatementEditor.this, aStatement);

    Form<KBStatement> form = new Form<>("form", CompoundPropertyModel.of(aStatement));

    // text area for the statement value should receive focus
    Component valueTextArea = new TextArea<String>("value");
    valueTextArea.setOutputMarkupId(true);
    initialFocusComponent = valueTextArea;
    form.add(valueTextArea);

    // FIXME This field should only be visible if the selected datatype is
    // langString

    TextField<String> textField = new TextField<>("language");
    textField.setOutputMarkupId(true);
    form.add(textField);

    // FIXME Selection of the data type should only be possible if it is not
    // restricted to a single type in the property definition - take into account
    // inheritance?
    //form.add(new TextField<>("datatype"));

    // We do not allow the user to change the property

    // FIXME should offer different editors depending on the data type
    // in particular when the datatype is a concept type, then
    // it should be possible to select an instance of that concept using some
    // auto-completing dropdown box

    form.add(new LambdaAjaxButton<>("save", StatementEditor.this::actionSave));
    form.add(new LambdaAjaxLink("cancel", t -> {
        if (isNewStatement) {
            StatementEditor.this.actionCancelNewStatement(t);
        } else {
            StatementEditor.this.actionCancelExistingStatement(t);
        }
    }));
    form.add(new LambdaAjaxLink("delete", StatementEditor.this::actionDelete)
            .setVisibilityAllowed(!isNewStatement));
    add(form);
}
 
Example 11
Source File: DatePicker.java    From pm-wicket-utils with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void bind(Component component) {
	component.setOutputMarkupId(true);
	getDatePattern();
}
 
Example 12
Source File: DisableSubmitOnEnterBehaviour.java    From pm-wicket-utils with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void onConfigure(Component component) {
	super.onConfigure(component);
	component.setOutputMarkupId(true);
}
 
Example 13
Source File: DefaultFocusBehaviour.java    From pm-wicket-utils with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void bind(Component component) {
	super.bind(component);
	component.setOutputMarkupId(true);
}
 
Example 14
Source File: QRCodeDivAppenderBehavior.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void bind(Component component)
{
  super.bind(component);
  component.setOutputMarkupId(true);
}
 
Example 15
Source File: DatePickerBehavior.java    From ontopia with Apache License 2.0 4 votes vote down vote up
@Override
protected void onBind() {
  super.onBind();
  Component c = getComponent();
  c.setOutputMarkupId(true);
}
 
Example 16
Source File: FocusOnLoadBehaviour.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
@Override
public void bind(Component component) {
    this.component = component;
    component.setOutputMarkupId(true);
}
 
Example 17
Source File: MyStudentDisplay.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public MyStudentDisplay(final String id, final UserProfile userProfile) {
	
	super(id);
	
	//heading
	add(new Label("heading", new ResourceModel("heading.student")));
	
	String course = userProfile.getCourse();
	String subjects = userProfile.getSubjects();
	
	int visibleFieldCount = 0;
	
	//course
	WebMarkupContainer courseContainer = new WebMarkupContainer("courseContainer");
	courseContainer.add(new Label("courseLabel", new ResourceModel("profile.course")));
	courseContainer.add(new Label("course", course));
	add(courseContainer);
	if(StringUtils.isBlank(course)) {
		courseContainer.setVisible(false);
	} else {
		visibleFieldCount++;
	}
	
	//subjects
	WebMarkupContainer subjectsContainer = new WebMarkupContainer("subjectsContainer");
	subjectsContainer.add(new Label("subjectsLabel", new ResourceModel("profile.subjects")));
	subjectsContainer.add(new Label("subjects", subjects));
	add(subjectsContainer);
	if(StringUtils.isBlank(subjects)) {
		subjectsContainer.setVisible(false);
	} else {
		visibleFieldCount++;
	}

	//edit button
	AjaxFallbackLink editButton = new AjaxFallbackLink("editButton", new ResourceModel("button.edit")) {
		
		private static final long serialVersionUID = 1L;

		public void onClick(AjaxRequestTarget target) {
			Component newPanel = new MyStudentEdit(id, userProfile);
			newPanel.setOutputMarkupId(true);
			MyStudentDisplay.this.replaceWith(newPanel);
			if(target != null) {
				target.add(newPanel);
				//resize iframe
				target.appendJavaScript("setMainFrameHeight(window.name);");
			}
			
		}
					
	};
	editButton.add(new Label("editButtonLabel", new ResourceModel("button.edit")));
	editButton.setOutputMarkupId(true);
	
	if(userProfile.isLocked() && !sakaiProxy.isSuperUser()) {
		editButton.setVisible(false);
	}
	
	add(editButton);
	
	//no fields message
	Label noFieldsMessage = new Label("noFieldsMessage", new ResourceModel("text.no.fields"));
	add(noFieldsMessage);
	if(visibleFieldCount > 0) {
		noFieldsMessage.setVisible(false);
	}
}
 
Example 18
Source File: GbModalWindow.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
@Override
public ModalWindow setContent(final Component component) {
	component.setOutputMarkupId(true);

	return super.setContent(component);
}
 
Example 19
Source File: DragBehavior.java    From onedev with MIT License 4 votes vote down vote up
@Override
public void bind(Component component) {
	super.bind(component);
	component.setOutputMarkupId(true);
}
 
Example 20
Source File: FocusOnLoadBehaviour.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
@Override
public void bind(Component component) {
    this.component = component;
    component.setOutputMarkupId(true);
}