Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlInputFile


    @Override
    public void renderView() {
        HtmlCustomOutputLabel output = new HtmlCustomOutputLabel(properties);

        if (file == null) {
            HtmlInputFile input = new HtmlInputFile();
            if (getDataUuid() != null) {
                input.setId(getDataUuid());
            }
            if (isDisabled()) {
                input.setDisabled(true);
            }
            addLabeledComponent(output, input);
        } else {
            HtmlOutputLink downloadLink = new HtmlOutputLink();
            downloadLink.setValue("javascript: downloadFile('" + getDataUuid().substring(HtmlFormBuilderItem.DATA_UUID_PREFIX.length(), getDataUuid().length()) + "');");
View Full Code Here


    public void renderView() {
        HtmlOutputText output = new HtmlOutputText();
        output.setValue(Messages.getStringJSF("download.label.default"));

        if (properties.getFile() == null || properties.getFile().getFilesize() == 0) {
            HtmlInputFile input = new HtmlInputFile();
            input.setId("download" + getItemUuid());
            addLabeledComponent(output, input);
            HtmlCommandButton submit = new HtmlCommandButton();
            submit.setValue(Messages.getStringJSF("download.submit"));
            getChildren().add(submit);
        } else {
View Full Code Here

    public void renderView() {
        HtmlOutputText output = new HtmlOutputText();
        output.setValue(Messages.getStringJSF("image.label.default"));

        if (properties.getFile() == null || properties.getFile().getFilesize() == 0) {
            HtmlInputFile input = new HtmlInputFile();
            input.setId("image" + getItemUuid());
            addLabeledComponent(output, input);
            HtmlCommandButton submit = new HtmlCommandButton();
            submit.setValue(Messages.getStringJSF("image.submit"));
            getChildren().add(submit);
        } else {
View Full Code Here

        Assert.assertNotNull(input13);

        HtmlInputText input14 = (HtmlInputText) form.findComponent("input14");
        Assert.assertNotNull(input14);
       
        HtmlInputFile input15 = (HtmlInputFile) form.findComponent("input15");
        Assert.assertNotNull(input15);
       
        HtmlInputHidden input16 = (HtmlInputHidden) form.findComponent("input16");
        Assert.assertNotNull(input16);
       
View Full Code Here

        Assert.assertNotNull(input13);

        HtmlInputText input14 = (HtmlInputText) form.findComponent("input14");
        Assert.assertNotNull(input14);
       
        HtmlInputFile input15 = (HtmlInputFile) form.findComponent("input15");
        Assert.assertNotNull(input15);
       
        HtmlInputHidden input16 = (HtmlInputHidden) form.findComponent("input16");
        Assert.assertNotNull(input16);
       
View Full Code Here

  }

  @Override
  public void decode(FacesContext facesContext, UIComponent uiComponent) {

    HtmlInputFile htmlInputFile = (HtmlInputFile) uiComponent;

    Map<String, List<UploadedFile>> uploadedFileMap = getUploadedFileMap(facesContext);

    if (uploadedFileMap != null) {

      String clientId = uiComponent.getClientId(facesContext);
      List<UploadedFile> uploadedFiles = uploadedFileMap.get(clientId);

      if ((uploadedFiles != null) && (uploadedFiles.size() > 0)) {

        Part part = new HtmlInputFilePartImpl(uploadedFiles.get(0), clientId);
        htmlInputFile.setTransient(true);
        htmlInputFile.setSubmittedValue(part);
      }
    }

    RendererUtil.decodeClientBehaviors(facesContext, uiComponent);
  }
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlInputFile

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.