Link to home
Start Free TrialLog in
Avatar of m_am
m_am

asked on

Upload File in Jdeveloper

Hi ..

I have a jsp page that contains a form to edit and insert records, i want to have an upload utility in my form using jbo:FileUploadForm tag. How can i have a form within a form with a single submit button ..

I'll appreciate the help ..

Regards ..

PS: I'm not much aware of any of the Upload file tags in jdeveloper, including the one i'm using in my page, so i'd appreciate it if anyone could explain in detail or else give me a link that will have a similar example explained in details .. :D

================================================================
jsp code
======

<%@ taglib uri="http://xmlns.oracle.com/uix/ui" prefix="uix" %>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/fileaccess.tld" prefix="fileaccess" %>
<%@ page language="java" import="oracle.jbo.*, oracle.jbo.html.*" %>
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%-- This JSP component build an edit form for a single record and
     generates an update submit event.
     It is called by the DataEdit tag --%>
<%
 
  String dsName = "OnlineCustomerServicesModule.documstr_VO_mstr";
 
%>

<html:errors/>

<%-- Build a form with an editable field for each of the attributes of the row --%>

<html:form action='updteditatchdocs.do'  enctype='<%=request.getParameter("encType")%>' method="POST">

<%--<jbo:ViewObject id='vo' name='<%=dsName%>'/> --%>
   <table border="0">
<%--   <logic:iterate id="def" name="vo" property="attributeDefs" scope="page"> --%>
   <jbo:AttributeIterate id="def" datasource="<%=dsName%>">
      <tr>
         <%  if (!(def.getColumnName().equals("COLVALUE"))) {%>

         <th align="right" title="<jbo:ShowHint hintname='TOOLTIP'></jbo:ShowHint>">
            <jbo:ShowHint hintname="LABEL"></jbo:ShowHint>
<%--            <bean:write name="def" property="name" filter="true"/> --%>
         </th> <% } %>
         <td align="left" title="<jbo:ShowHint hintname='TOOLTIP'></jbo:ShowHint>">
<%--            <html:text property="<%=((AttributeDef)def).getName()%>"/> --%>
            <% if (def.getColumnName().equals("DOCUTYPE")) {%>
            <jbo:InputSelect datasource="OnlineCustomerServicesModule.documstr_VO_mstr"  dataitem="Docutype"  displaydatasource="OnlineCustomerServicesModule.attchfams_VO_mstr"  displaydataitem="Colvalue"  displayvaluedataitem="Colkey"  shownone="1" ></jbo:InputSelect>
            <% }
               else if (def.getColumnName().equals("DOCUFTYP")) { %>
             
             <jbo:InputSelect datasource="OnlineCustomerServicesModule.documstr_VO_mstr"  dataitem="Docuftyp"  displaydatasource="OnlineCustomerServicesModule.filetypefams_VO_mstr"  displaydataitem="Colvalue"  displayvaluedataitem="Colkey"  shownone="1" ></jbo:InputSelect>

               <% } else if (def.getColumnName().equals("COLVALUE")) {%>

               <% } else { %>
           <jbo:FileUploadForm action="handleUpload.jsp">   
            Photo<INPUT TYPE="FILE" NAME="Photo"><br> 
            <INPUT TYPE="SUBMIT" TEXT="SUBMIT">
            </jbo:FileUploadForm>

             <jbo:InputRender datasource="<%=dsName%>"  /><br>
                       
            <%
            }
            // Mark all the mandatory attributes with '*'  
            if (def.isMandatory())
            {
           %>*<%
            } %>
           
         </td>
      </tr>
   </jbo:AttributeIterate>  
   
<%--   </logic:iterate> --%>
   </table>
<html:hidden property="jboEvent" />
<html:hidden property="jboEventVo" />
<html:hidden property="jboRowKey" />
<html:hidden property="amId" />
<input type=hidden name="AlarmpanelId" value='<%=request.getParameter("AlarmpanelId")%>'>
<input type=hidden name="Docurqst" value='<%=request.getParameter("AlarmpanelId")%>'>
<html:submit>
   <bean:message key="DataEdit.update"/>
</html:submit>
<html:reset>
   <bean:message key="DataEdit.reset"/>
</html:reset>
&nbsp;
<html:cancel>
   <bean:message key="DataEdit.cancel"/>
</html:cancel>

</html:form>

================================================================
ASKER CERTIFIED SOLUTION
Avatar of kennethxu
kennethxu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial