package com.celements.structEditor.fields;

import org.xwiki.component.annotation.Component;

import com.google.common.base.Optional;

@Component(FormFieldPageType.FORM_FIELD_PAGETYPE_NAME)
public class FormFieldPageType extends AbstractStructFieldPageType {

  public static final String FORM_FIELD_PAGETYPE_NAME = "FormField";

  static final String VIEW_TEMPLATE_NAME = "FormFieldView";

  @Override
  public String getName() {
    return FORM_FIELD_PAGETYPE_NAME;
  }

  @Override
  protected String getViewTemplateName() {
    return VIEW_TEMPLATE_NAME;
  }

  @Override
  public Optional<String> defaultTagName() {
    return Optional.of("form");
  }

}

@@ -86,16 +86,223 @@
 ponent;%0A
+import org.xwiki.component.annotation.Requirement;%0Aimport org.xwiki.model.reference.DocumentReference;%0A%0Aimport com.celements.cells.attribute.AttributeBuilder;%0Aimport com.celements.model.context.ModelContext;
 %0Aimport 
@@ -591,16 +591,61 @@
 View%22;%0A%0A
+  @Requirement%0A  ModelContext modelContext;%0A%0A
   @Overr
@@ -903,10 +903,226 @@
 );%0A  %7D%0A%0A
+  @Override%0A  public void getAttributes(AttributeBuilder attrBuilder, DocumentReference cellDocRef) %7B%0A    attrBuilder.addNonEmptyAttribute(%22method%22, %22post%22);%0A    attrBuilder.addNonEmptyAttribute(%22action%22, %22?%22);%0A  %7D%0A%0A
 %7D%0A

add FormFieldPageType