code: public void actionUpdateElements() throws JspException {
  
          try {
              List<CmsDialogElement> elementList = computeElements();
              CmsFile file = getCms().readFile(getParamTempfile(), CmsResourceFilter.IGNORE_EXPIRATION);
              CmsXmlPage page = CmsXmlPageFactory.unmarshal(getCms(), file);
              boolean foundMandatory = false;
              m_changeElement = "";
              Iterator<CmsDialogElement> i = elementList.iterator();
              while (i.hasNext()) {
                  // get the current list element
                  CmsDialogElement element = i.next();
                  if (element.isMandantory()
                      || element.getName().equals(getParamElementname())
                      || Boolean.valueOf(
                          getJsp().getRequest().getParameter(PREFIX_PARAM_BODY + element.getName())).booleanValue()) {
                      if (!element.isExisting()) {
                          // create element in order to enable it properly
                          page.addValue(element.getName(), getElementLocale());
                      }
                      page.setEnabled(element.getName(), getElementLocale(), true);
                      if (element.isMandantory() && !foundMandatory) {
                          m_changeElement = element.getName();
                          foundMandatory = true;
                      }
                  } else {
                      if (element.isExisting()) {
                          // remove element if it is already existing
                          page.removeValue(element.getName(), getElementLocale());
                      }
                  }
              }
              // write the temporary file
              file.setContents(page.marshal());
              getCms().writeFile(file);
              // set the javascript functions which should be executed
              if (page.isEnabled(getParamElementname(), getElementLocale())) {
                  m_changeElement = getParamElementname();
              } else if (!foundMandatory) {
                  if (elementList.size() > 0) {
                      m_changeElement = elementList.get(0).getName();
                  }
              }
          } catch (Throwable e) {
              // show error dialog
              setParamMessage(Messages.get().getBundle(getLocale()).key(Messages.ERR_UPDATE_ELEMENTS_0));
              includeErrorpage(this, e);
          }
      }
docs: Updates the enabled/diabled status of all elements of the current page.<p>
  
  @throws JspException if there is an error including the error page