Solved

Upload File in Jdeveloper

Posted on 2004-03-28
3
1,432 Views
Last Modified: 2010-08-05
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>

================================================================
0
Comment
Question by:m_am
3 Comments
 
LVL 14

Accepted Solution

by:
kennethxu earned 100 total points
ID: 10705505
I'm not familiar with jbo. but since you are already using struts, you can use struts file upload. there is a sample web app come with the struts called struts-upload.war, check out the source code there.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now