Solved

Upload File in Jdeveloper

Posted on 2004-03-28
3
1,447 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
This article describes how to reset your Windows 10 password when you've forgotten it.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

827 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