Package org.apache.wicket.markup.html

Examples of org.apache.wicket.markup.html.IHeaderContributor


            // login name ======================================================
            final TextField loginName = new TextField("user.loginName");
            loginName.setRequired(true);
            loginName.add(new ErrorHighlighter());
            loginName.setOutputMarkupId(true);
            add(new HeaderContributor(new IHeaderContributor() {
                public void renderHead(IHeaderResponse response) {
                    response.renderOnLoadJavascript("document.getElementById('" + loginName.getMarkupId() + "').focus()");
                }
            }));
            // validation: does user already exist with same loginName?
View Full Code Here


            final TextField summaryField = new TextField("summary");
            summaryField.setRequired(true);
            summaryField.add(new ErrorHighlighter());
            summaryField.setOutputMarkupId(true);
            add(summaryField);
            add(new HeaderContributor(new IHeaderContributor() {
                public void renderHead(IHeaderResponse response) {
                    response.renderOnLoadJavascript("document.getElementById('" +
                            summaryField.getMarkupId() + "').focus()");
                }
            }));
View Full Code Here

        final String markupId = dialog.getMarkupId();
        // using the contributor and the onDomReady Wicket helper handles the rare case that
        // the dialog is visible and the user refreshes the backing page (possible as dialog is not modal!)
        // so in that special case, this javascript is called at page load
        // but in the usual Ajax request case, this behaves just like AjaxRequestTarget.appendJavascript()
        add(new HeaderContributor(new IHeaderContributor() {
            public void renderHead(IHeaderResponse response) {
                response.renderOnDomReadyJavascript("var " + markupId + " = new YAHOO.widget.ResizeDialog('" + markupId + "', "
                + " { constraintoviewport : true }); "
                + markupId + ".render(); " + markupId + ".show();");
            }
View Full Code Here

        dialog = new WebMarkupContainer("dialog");
        dialog.setOutputMarkupId(true);      
        add(dialog);                       
        dialog.add(new Label("heading", heading));       
        dialog.add(content);
        add(new HeaderContributor(new IHeaderContributor() {
            public void renderHead(IHeaderResponse response) {
                String markupId = dialog.getMarkupId();
                response.renderJavascript("var " + markupId + ";", null);
                response.renderOnDomReadyJavascript(markupId + " = new YAHOO.widget.Panel('" + markupId + "',"
                + " " + YuiUtils.getJson(config) + "); " + markupId + ".render()");               
View Full Code Here

            add(passwordField);
           
            /*
             * Intelligently set focus on the appropriate textbox.
             */
            add(new HeaderContributor(new IHeaderContributor() {
                public void renderHead(IHeaderResponse response) {
                    String markupId;
                    if(loginNameField.getConvertedInput() == null) {
                        markupId = loginNameField.getMarkupId();
                    } else {
View Full Code Here

            });
            add(searchOnChoice);
            final TextField searchTextField = new TextField("searchText");
            searchTextField.setOutputMarkupId(true);
            add(searchTextField);
            add(new HeaderContributor(new IHeaderContributor() {
                public void renderHead(IHeaderResponse response) {
                    response.renderOnLoadJavascript("document.getElementById('" + searchTextField.getMarkupId() + "').focus()");
                }
            }));           
        }
View Full Code Here

            final TextField name = new TextField("space.name");
            name.setRequired(true);
            name.add(new ErrorHighlighter());
            name.setOutputMarkupId(true);
            add(name);
            add(new HeaderContributor(new IHeaderContributor() {
                public void renderHead(IHeaderResponse response) {
                    response.renderOnLoadJavascript("document.getElementById('" + name.getMarkupId() + "').focus()");
                }
            }));           
            // prefix Code =====================================================
View Full Code Here

            label.setRequired(true);
            label.setOutputMarkupId(true);
            label.add(new ErrorHighlighter());           
            add(label);
            // intelligently set focus on right input field
            add(new HeaderContributor(new IHeaderContributor() {
                public void renderHead(IHeaderResponse response) {
                    if(field.getLabel() == null) {
                        response.renderOnLoadJavascript("document.getElementById('" + label.getMarkupId() + "').focus()");
                    } else if(optionField != null) {
                        response.renderOnLoadJavascript("document.getElementById('" + optionField.getMarkupId() + "').focus()");
View Full Code Here

    return HttpUtils.getGitblitURL(req);
  }

  public static HeaderContributor syndicationDiscoveryLink(final String feedTitle,
      final String url) {
    return new HeaderContributor(new IHeaderContributor() {
      private static final long serialVersionUID = 1L;

      @Override
      public void renderHead(IHeaderResponse response) {
        String contentType = "application/rss+xml";
View Full Code Here

  @Override
  protected void setupPage(String repositoryName, String pageName) {

    // CSS header overrides
    add(new HeaderContributor(new IHeaderContributor() {
      private static final long serialVersionUID = 1L;

      @Override
      public void renderHead(IHeaderResponse response) {
        StringBuilder buffer = new StringBuilder();
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.IHeaderContributor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.