Solved

Upload File in Jdeveloper

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

622 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