Initializes the form belonging to this session.<p>

@param formElement the form element
544706
@NoExport
    public void initFormElement(Element formElement) {

        m_formWrapper = new CmsUgcWrapper(formElement, getSessionId());
        m_formWrapper.setFormSession(this);
    }
554121
public void set(Element element) {
        if (element == null) {
            throw new NullPointerException("element == null");
        }

        CstString pairName = new CstString(element.getName());
        Constant pairValue = Element.toConstant(element.getValue());
        NameValuePair nameValuePair = new NameValuePair(pairName, pairValue);
        elements.put(element.getName(), nameValuePair);
    }
927764
protected void init() throws JspException {

        // initialize OpenCms access objects
        m_controller = CmsFlexController.getController(pageContext.getRequest());
        m_cms = m_controller.getCmsObject();

        try {
            // get the resource name from the selected container
            m_element = OpenCms.getADEManager().getCurrentElement(pageContext.getRequest());
            m_element.initResource(m_cms);
            if (m_cms.getRequestContext().getCurrentProject().isOnlineProject()
                && !m_element.isReleasedAndNotExpired()) {
                throw new CmsException(
                    Messages.get().container(
                        Messages.ERR_RESOURCE_IS_NOT_RELEASE_OR_EXPIRED_1,
                        m_element.getResource().getRootPath()));
            }
            if (m_locale == null) {
                // no locale set, use locale from users request context
                m_locale = m_cms.getRequestContext().getLocale();
            }

            // load content and store it
            CmsJspContentAccessBean bean;
            if ((m_element.isInMemoryOnly() || m_element.isTemporaryContent())
                && (m_element.getResource() instanceof CmsFile)) {
                I_CmsXmlDocument xmlContent = CmsXmlContentFactory.unmarshal(
                    m_cms,
                    m_element.getResource(),
                    pageContext.getRequest());
                bean = new CmsJspContentAccessBean(m_cms, m_locale, xmlContent);
            } else {
                bean = new CmsJspContentAccessBean(m_cms, m_locale, m_element.getResource());
            }
            storeAttribute(getVar(), bean);

            if (m_value != null) {
                // if the optional "val" parameter has been set, store the value map of the content in the page context scope
                storeAttribute(getVal(), bean.getValue());
            }

            if (m_rdfa != null) {
                // if the optional "rdfa" parameter has been set, store the rdfa map of the content in the page context scope
                storeAttribute(getRdfa(), bean.getRdfa());
            }

        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            m_controller.setThrowable(e, m_cms.getRequestContext().getUri());
            throw new JspException(e);
        }
    }
600053
function initializeForm() {
    form = new Form( 'form.or:eq(0)', {
        modelStr: modelStr
    }, {
        arcGis: {
            basemaps: [ 'streets', 'topo', 'satellite', 'osm' ],
            webMapId: 'f2e9b762544945f390ca4ac3671cfa72',
            hasZ: true
        },
        'clearIrrelevantImmediately': true
    } );
    // for debugging
    window.form = form;
    //initialize form and check for load errors
    loadErrors = form.init();
    if ( loadErrors.length > 0 ) {
        window.alert( 'loadErrors: ' + loadErrors.join( ', ' ) );
    }
}
1340829
protected function InitForm()
    {
        $this->checkbox = $this->LoadElement();
        $this->AddRequiredField();
        $this->AddNameField();
        $this->AddLabelField();
        $this->AddCheckedField();
        $this->AddCheckedValueField();
        $this->AddDisableFrontendValidationField();
        $this->AddCssIDField();
        $this->AddCssClassField();
        $this->AddTemplateField();
        $this->AddSubmit();
    }
769578
protected void setInputElementValue(Node element, FormInput input) {

		LOGGER.debug("INPUTFIELD: {} ({})", input.getIdentification(), input.getType());
		if (element == null || input.getInputValues().isEmpty()) {
			return;
		}
		try {

			switch (input.getType()) {
				case TEXT:
				case TEXTAREA:
				case PASSWORD:
					handleText(input);
					break;
				case HIDDEN:
					handleHidden(input);
					break;
				case CHECKBOX:
					handleCheckBoxes(input);
					break;
				case RADIO:
					handleRadioSwitches(input);
					break;
				case SELECT:
					handleSelectBoxes(input);
			}

		} catch (ElementNotVisibleException e) {
			LOGGER.warn("Element not visible, input not completed.");
		} catch (BrowserConnectionException e) {
			throw e;
		} catch (RuntimeException e) {
			LOGGER.error("Could not input element values", e);
		}
	}
662277
public void showElementInfo(final CmsContainerPageElementPanel element) {

        CmsUUID structureId;
        if (element.isModelGroup() && !element.getModelGroupId().isNullUUID()) {
            structureId = element.getModelGroupId();
        } else {
            structureId = element.getStructureId();
        }
        I_CmsDropContainer dropContainer = element.getParentTarget();
        Map<String, String> contextParams = new HashMap<>();
        if (dropContainer instanceof CmsContainerPageContainer) {
            CmsContainerPageContainer cnt = (CmsContainerPageContainer)dropContainer;
            String containerId = cnt.getContainerId();
            String elemId = element.getId();
            contextParams.put(CmsGwtConstants.ATTR_ELEMENT_ID, elemId);
            contextParams.put(CmsGwtConstants.ATTR_CONTAINER_ID, containerId);
            String pageRootPath = CmsStringUtil.joinPaths(
                CmsCoreProvider.get().getSiteRoot(),
                CmsCoreProvider.get().getUri());
            contextParams.put(CmsGwtConstants.ATTR_PAGE_ROOT_PATH, pageRootPath);
        }
        CmsResourceInfoDialog.load(structureId, true, null, contextParams, new CloseHandler<PopupPanel>() {

            public void onClose(CloseEvent<PopupPanel> event) {

                reloadElements(element.getId());
            }
        });
    }
670018
public void actionToggleElement() throws JspException {

        // set editor values from request
        try {
            setEditorValues(getElementLocale());
        } catch (CmsXmlException e) {
            // an error occurred while trying to set the values, stop action
            showErrorPage(e);
            return;
        }

        // get the necessary parameters to add/remove the element
        int index = 0;
        try {
            index = Integer.parseInt(getParamElementIndex());
        } catch (Exception e) {
            // ignore, should not happen
        }

        if (getAction() == ACTION_ELEMENT_REMOVE) {
            // remove the value , first get the value to remove
            I_CmsXmlContentValue value = m_content.getValue(getParamElementName(), getElementLocale(), index);
            m_content.removeValue(getParamElementName(), getElementLocale(), index);
            // check if the value was a choice option and the last one
            if (value.isChoiceOption()
                && (m_content.getSubValues(
                    CmsXmlUtils.removeLastXpathElement(getParamElementName()),
                    getElementLocale()).size() == 0)) {
                // also remove the parent choice type value
                String xpath = CmsXmlUtils.removeLastXpathElement(getParamElementName());
                m_content.removeValue(xpath, getElementLocale(), CmsXmlUtils.getXpathIndexInt(xpath) - 1);
            }
        } else {
            // add the new value after the clicked element
            if (m_content.hasValue(getParamElementName(), getElementLocale())) {
                // when other values are present, increase index to use right position
                index += 1;
            }
            String elementPath = getParamElementName();
            if (CmsStringUtil.isNotEmpty(getParamChoiceElement())) {
                // we have to add a choice element, first check if the element to add itself is part of a choice or not
                boolean choiceType = Boolean.valueOf(getParamChoiceType()).booleanValue();
                I_CmsXmlSchemaType elemType = m_content.getContentDefinition().getSchemaType(elementPath);
                if (!choiceType || (elemType.isChoiceOption() && elemType.isChoiceType())) {
                    // this is a choice option or a nested choice type to add, remove last element name from xpath
                    elementPath = CmsXmlUtils.removeLastXpathElement(elementPath);
                } else {
                    // this is a choice type to add, first create type element
                    m_content.addValue(getCms(), elementPath, getElementLocale(), index);
                    elementPath = CmsXmlUtils.createXpathElement(elementPath, index + 1);
                    // all eventual following elements to create have to be at first position
                    index = 0;
                }
                // check if there are nested choice elements to add
                if (CmsXmlUtils.isDeepXpath(getParamChoiceElement())) {
                    // create all missing elements except the last one
                    String pathToChoice = CmsXmlUtils.removeLastXpathElement(getParamChoiceElement());
                    String newPath = elementPath;
                    while (CmsStringUtil.isNotEmpty(pathToChoice)) {
                        String createElement = CmsXmlUtils.getFirstXpathElement(pathToChoice);
                        newPath = CmsXmlUtils.concatXpath(newPath, createElement);
                        pathToChoice = CmsXmlUtils.isDeepXpath(pathToChoice)
                        ? CmsXmlUtils.removeFirstXpathElement(pathToChoice)
                        : null;
                        I_CmsXmlContentValue newVal = m_content.addValue(getCms(), newPath, getElementLocale(), index);
                        newPath = newVal.getPath();
                        // all eventual following elements to create have to be at first position
                        index = 0;
                    }
                    // create the path to the last choice element
                    elementPath = CmsXmlUtils.concatXpath(
                        newPath,
                        CmsXmlUtils.getLastXpathElement(getParamChoiceElement()));
                } else {
                    // create the path to the choice element
                    elementPath += "/" + getParamChoiceElement();
                }
            }
            // add the value
            m_content.addValue(getCms(), elementPath, getElementLocale(), index);
        }

        if (getValidationHandler().hasWarnings(getElementLocale())) {
            // there were warnings for the edited content, reset validation handler to avoid display issues
            resetErrorHandler();
        }

        try {
            // write the modified content to the temporary file
            writeContent();
        } catch (CmsException e) {
            // an error occurred while trying to save
            showErrorPage(e);
        }

    }
129932
final function onFormInitialized() {
		parent::onFormInitialized();
		$this->addClass('df-number');
		df_fe_init($this, __CLASS__);
		$this->setAfterElementHtml($this[self::LABEL_RIGHT]);
	}
716960
protected function InitForm()
    {
        $this->select  = $this->LoadElement();
        
        $this->AddNameField();
        $this->AddValueField();
        $this->AddLabelField();
        $this->AddOptionsField();
        
        $this->AddDisableFrontendValidationField();
        $this->AddRequiredField();
        $this->AddTemplateField();
        $this->AddCssClassField();
        $this->AddCssIDField();
        $this->AddSubmit();
    }
129672
private void initialize() {
        this.setText(Constant.messages.getString("sites.resend.popup"));

        this.addActionListener(new java.awt.event.ActionListener() { 

        	@Override
        	public void actionPerformed(java.awt.event.ActionEvent evt) {    

                if (treeSite != null) {
        		    SiteNode node = (SiteNode) treeSite.getLastSelectedPathComponent();

            	    ManualRequestEditorDialog dialog = extension.getResendDialog();
            	    HistoryReference ref = node.getHistoryReference();
            	    HttpMessage msg = null;
            	    try {
                        msg = ref.getHttpMessage().cloneRequest();
                        dialog.setMessage(msg);
                        dialog.setVisible(true);
                    } catch (HttpMalformedHeaderException | DatabaseException e) {
                        logger.error(e.getMessage(), e);
                    }
                }
        	}
        });

			
	}
671688
private FormLayout initForm() {

        FormLayout form = new FormLayout();
        form.setWidth("100%");

        IndexedContainer sites = CmsVaadinUtils.getAvailableSitesContainer(m_context.getCms(), CAPTION_PROPERTY);
        m_siteComboBox = prepareComboBox(sites, org.opencms.workplace.Messages.GUI_LABEL_SITE_0);
        m_siteComboBox.select(m_context.getCms().getRequestContext().getSiteRoot());
        form.addComponent(m_siteComboBox);
        ValueChangeListener changeListener = new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                submit();
            }
        };
        m_siteComboBox.addValueChangeListener(changeListener);
        IndexedContainer projects = CmsVaadinUtils.getProjectsContainer(m_context.getCms(), CAPTION_PROPERTY);
        m_projectComboBox = prepareComboBox(projects, org.opencms.workplace.Messages.GUI_LABEL_PROJECT_0);
        CmsUUID currentProjectId = m_context.getCms().getRequestContext().getCurrentProject().getUuid();
        if (projects.containsId(currentProjectId)) {
            m_projectComboBox.select(currentProjectId);
        } else {
            try {
                CmsUUID ouProject = OpenCms.getOrgUnitManager().readOrganizationalUnit(
                    m_context.getCms(),
                    m_context.getCms().getRequestContext().getOuFqn()).getProjectId();
                if (projects.containsId(ouProject)) {
                    m_projectComboBox.select(ouProject);
                }
            } catch (CmsException e) {
                LOG.error("Error while reading current OU.", e);
            }
        }

        form.addComponent(m_projectComboBox);
        m_projectComboBox.addValueChangeListener(changeListener);
        return form;
    }
193340
protected function InitForm()
    {
        $this->htmlCode = $this->LoadElement();
        $name = 'Code';
        $this->AddField(new Textarea($name, $this->htmlCode->GetCode()));
        $this->SetRequired($name);
        $this->AddCssClassField();
        $this->AddCssIDField();
        $this->AddSubmit();
    }
340721
public void addElement(Element element) {
		synchronized(lock) {
			checkNotFrozen();
			element.setPage(this);
			// elements
			if(elements == null) elements = new ArrayList<>();
			elements.add(element);
			// elementsById
			addToElementsById(element, false);
		}
	}
1372657
public void createNewElement(
        final CmsContainerPageElementPanel element,
        final AsyncCallback<CmsContainerElement> callback) {

        CmsRpcAction<CmsContainerElement> action = new CmsRpcAction<CmsContainerElement>() {

            @Override
            public void execute() {

                getContainerpageService().createNewElement(
                    CmsCoreProvider.get().getStructureId(),
                    element.getId(),
                    element.getNewType(),
                    null,
                    getLocale(),
                    this);

            }

            @Override
            protected void onResponse(CmsContainerElement result) {

                callback.onSuccess(result);
            }
        };
        action.execute();
    }
164801
protected void initComponent()
	{
		addOrReplace(form = newForm("form", getModel()));
		form.addOrReplace(signupPanel = newSignupPanel("signupPanel", getModel()));

		form.addOrReplace(submitButton = newButton("signupButton"));
		submitButton.add(
			buttonLabel = newButtonLabel("buttonLabel", "global.button.sign.up.label", "Sign up"));
		form.add(submitButton);

		form.add(new EqualPasswordInputValidator(
			signupPanel.getSigninPanel().getPassword().getPasswordTextField(),
			signupPanel.getRepeatPassword().getPasswordTextField()));
	}
1168692
private FormLayout initForm() {

        FormLayout form = new FormLayout();
        form.setWidth("100%");

        IndexedContainer sites = CmsVaadinUtils.getAvailableSitesContainer(m_context.getCms(), CAPTION_PROPERTY);
        m_siteComboBox = prepareComboBox(sites, org.opencms.workplace.Messages.GUI_LABEL_SITE_0);
        m_siteComboBox.select(m_context.getCms().getRequestContext().getSiteRoot());
        form.addComponent(m_siteComboBox);
        ValueChangeListener changeListener = new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                submit();
            }
        };
        m_siteComboBox.addValueChangeListener(changeListener);
        return form;
    }