Skip to Content
0
Jan 19, 2005 at 09:22 AM

fileUpload does not work in MVC application

31 Views

I created an MVC application with controllers and views for the different frames (header.do/header.htm, menu.do/menu.htm, toolbar.do/toolbar.htm, statusdo./status.htm, detail.do/detail.htm). The main-controller is front.do, the main-view is front.htm

The detail-view is realized as a "sub-MVC-application" because it is rather complex (subfront.do/subfront.htm).

This sub-MVC uses some controllers and views for the detail-frame.

My problem is that fileUpload does not work in this sub-sub-view. I cannot get the attributes like filename.

In a page with flowlogic it works fine. I also tried to put the code for the fileUpload in a page fragment and include it in the page with flowlogic which also works fine.

But when I include this page fragment in the view it does not work either. The code in the layout-section of the page fragment looks as follows

<%@page language="ABAP" %>

<%@extension name="htmlb" prefix="htmlb" %>

<%@extension name="bsp" prefix="bsp" %>

<htmlb:gridLayout columnSize="2" rowSize="1" cellSpacing="5" cellPadding="5" width="100%">

<htmlb:gridLayoutCell columnIndex="1" rowIndex="1">

<htmlb:fileUpload id="fuDokument"/>

<htmlb:button id="submitButton" text="Upload" onClick="HandleUpload"/>

</htmlb:gridLayoutCell>

<htmlb:gridLayoutCell columnIndex="2" rowIndex="1">

<%

DATA: ref_htmlb_fileupload TYPE REF TO CL_HTMLB_FILEUPLOAD.

ref_htmlb_fileupload ?= CL_HTMLB_MANAGER=>GET_DATA( request = request id = 'fuDokument' name = 'fileUpload' ).

IF ref_htmlb_fileupload->file_name IS INITIAL. ref_htmlb_fileupload->file_name = '&nbsp;'. ENDIF.

IF ref_htmlb_fileupload->file_content_type IS INITIAL. ref_htmlb_fileupload->file_content_type = '&nbsp;'. ENDIF.

%>

<htmlb:textView text="Uploaded:"/>

<htmlb:textView text="<%=ref_htmlb_fileupload->file_name %>"/>

<htmlb:textView text="Content-Type:"/>

<htmlb:textView text="<%=ref_htmlb_fileupload->file_content_type %>"/>

<htmlb:textView text="Length:"/>

<htmlb:textView text="<%=ref_htmlb_fileupload->file_length %>"/>

</htmlb:gridLayoutCell>

</htmlb:gridLayout>

Any help would be highly appreciated

Markus