wbstr / vaadin-multifileupload

12 stars 23 forks source link

button caption as html #65

Open nuraprak opened 6 years ago

nuraprak commented 6 years ago

tried three different ways (individually and combined) to set the caption of the upload component with html text with the following method

setCaptionAsHtml(true);

tried

multiFileUpload.setCaptionAsHtml(true);

multiFileUpload.getSmartUpload().setCaptionAsHtml(true);

@Override
public void attach(final AttachEvent event) {

        final String htmlCaption = "hello <br> world";

        final UploadComponent upload = multiFileUpload.getSmartUpload().getUpload();

        if (upload instanceof MultiUpload) {
            ((MultiUpload) upload).setCaptionAsHtml(true);
        } else if (upload instanceof Upload) {
            ((Upload) upload).setCaptionAsHtml(true);
        }

        upload.markAsDirtyRecursive();

    }

is there a different way to achieve this?