Package org.openfaces.component.input.fileattachments

Examples of org.openfaces.component.input.fileattachments.FileAttachment


    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        AbstractFileAttachmentAction abstractFileAttachmentAction = (AbstractFileAttachmentAction) component;
        Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
        final FileAttachment fileAttachment = (FileAttachment) requestMap.get(FileAttachmentsRenderer.REQ_FILE_ATTACHMENT_KEY);
        abstractFileAttachmentAction.setFileAttachment(fileAttachment);
        final FileAttachments fileAttachmentsComponent = (FileAttachments) requestMap.get(FileAttachmentsRenderer.REQ_FILE_ATTACHMENTS_COMP_KEY);
        abstractFileAttachmentAction.setFileAttachmentsComponent(fileAttachmentsComponent);
        encodeComponent(context, abstractFileAttachmentAction);
        encodeScriptAndStyles(context, abstractFileAttachmentAction);
View Full Code Here


            if (jsonParam.has(A_P_ID_OF_ATTACHMENT)) {
                String id = (String) jsonParam.get(A_P_ID_OF_ATTACHMENT);
                MethodExpression fileRemovedListener = fileAttachments.getFileRemovedListener();

                if (fileRemovedListener != null) {
                    final FileAttachment attachment = getAttachmentFromListWithId(fileAttachments.getValue(), id);
                    fileRemovedListener.invoke(
                            context.getELContext(), new Object[]{
                            new FileRemovedEvent(fileAttachments, attachment)});
                }
                Rendering.addJsonParam(jsonObj, "isCalled", true);
View Full Code Here

            public Object invoke(ELContext elContext, Object[] objects) {
                UploadCompletionEvent completionEvent = (UploadCompletionEvent) objects[0];
                final List<FileUploadItem> files = completionEvent.getFiles();
                for (FileUploadItem fileUploadItem : files) {
                    final FileAttachedEvent fileAttachedEvent = new FileAttachedEvent(fileAttachments,
                            new FileAttachment(fileUploadItem.getFile().getName(), fileUploadItem.getFileName(), fileUploadItem.getFile().length()));

                    fileAttachments.getFileAttachedListener().invoke(elContext, new Object[]{fileAttachedEvent});
                }
                return null//void
            }
View Full Code Here

TOP

Related Classes of org.openfaces.component.input.fileattachments.FileAttachment

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.