Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Upload File in Jdeveloper

Posted on 2004-03-28
3
Medium Priority
?
1,474 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
kennethxu earned 400 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Read on to get a few ideas on how to promote your next corporate event.
Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

719 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