All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<List<FileUpload>,FormComponent<List<FileUpload>>>, IMetadataContext<Serializable,Component>, IFormModelUpdateListener, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class BootstrapFileInputField extends FileUploadField
Integration with Bootstrap FileInput
See Also:
  • Field Details

    • JQUERY_IDENTIFIER_UPLOAD_BUTTON_CLASS

      public static final String JQUERY_IDENTIFIER_UPLOAD_BUTTON_CLASS
      Make sure that this class is inside the uploadClass config, otherwise the ajax behavior will not work!
      See Also:
  • Constructor Details

    • BootstrapFileInputField

      public BootstrapFileInputField(String id)
      Constructor
      Parameters:
      id - The component id
    • BootstrapFileInputField

      public BootstrapFileInputField(String id, IModel<List<FileUpload>> model)
      Constructor
      Parameters:
      id - The component id
      model - The model that will store the uploaded files
    • BootstrapFileInputField

      public BootstrapFileInputField(String id, IModel<List<FileUpload>> model, FileInputConfig config)
      Constructor
      Parameters:
      id - The component id
      model - The model that will store the uploaded files
      config - The configuration for this file input
  • Method Details

    • getConfig

      public FileInputConfig getConfig()
    • onConfigure

      protected void onConfigure()
      Overrides:
      onConfigure in class Component
    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Overrides:
      onComponentTag in class FileUploadField
    • newAjaxFormSubmitBehavior

      protected AjaxFormSubmitBehavior newAjaxFormSubmitBehavior(String event)
      Creates the special Ajax behavior that is used to upload the file(s) with Ajax by using the Upload button
      Parameters:
      event - The name of the JavaScript event that will trigger the Ajax upload
      Returns:
      The Ajax behavior for the file upload
    • onError

      protected void onError(AjaxRequestTarget target)
      A callback method that is called when there is an error during an Ajax file upload
      Parameters:
      target - The Ajax request handler
    • onSubmit

      protected void onSubmit(AjaxRequestTarget target)
      A callback method that is called on successful file upload triggered by the usage of the Upload button.
      Parameters:
      target - The Ajax request handler
    • onAfterSubmit

      protected void onAfterSubmit(AjaxRequestTarget target)
      A callback method that is called after successful file upload triggered by the usage of the Upload button.
      Parameters:
      target - the AjaxRequestTarget
    • renderHead

      public void renderHead(IHeaderResponse response)
      Specified by:
      renderHead in interface IHeaderContributor
      Overrides:
      renderHead in class Component