Calendar & File Upload Components - Threadinar6

Hi All,
This is the sixth in the "Threadinar" series , please see Threadinar5 at
http://swforum.sun.com/jive/thread.jspa?threadID=99473 for details
In this Threadinar we will focus on the
"Calendar" and "File Upload" Components
Let us begin our discussion with the Calendar Component.
Calendar Component
You can drag the Calendar component "calendar component icon" from the Palette's Basic category to a page open in the Visual Designer to create an entry field with an integrated calendar pop-up to help the user pick dates for the field.
You can also drop the calendar on a container component, like a table cell or group box.
After dragging the component to the Visual Designer, you can work with the following useful properties of the Calendar Component:-
General
* id. Type: String
The name of the Calendar component in the page bean and the JSP file.
Appearance
* columns. Type: int
The number of character columns used to render the component. The default value is 20.
* dateFormatPattern. Type: String
The format of the date to be entered by the user. It is not usually necessary to set this property because a pattern is chosen automatically based on the locale.
If you prefer to specify a date format, click the ellipsis button (...) to the right of the property and select a predefined date format from the property editor's list. You can also add your own formats. If you add a format, the values you can enter are limited to some combination of yyyy for the year, MM for the month, and dd for the day separated by separator characters. Typical separator characters are / (slash), . (period), and - (dash). For example, the following date formats are acceptable:
o MM/dd/yyyy
o yyyy.MM.dd
o MM-dd-yyyy
* dateFormatPatternHelp. Type: text
Text that appears below the date entry field and shows the format pattern that the date entry field accepts. If you have not set the dateFormatPattern property, the help text is chosen automatically for you. If you have set the dateFormatPattern property, you should bind the dateFormatPatternHelp property to a localized string that matches the setting for each locale you want to support.
* label. Type: String
A label that appears next to the text entry field, typically describing what the user is supposed to enter.
o Note: The label property is not as flexible as the Label component. You can use the Label component if you want more control over the label's appearance, such as positioning of the label relative to the component.
* labelLevel. Type: int
A number that affects the appearance of the label. 1 (Strong) is larger and bold. 2 (Medium), the default, is smaller and bold. 3 (Weak) is smaller and normal (not bold). This property takes effect only if the label property is set.
* style. Type: String
Cascading Style Sheet rules (CSS level 2) to be applied to the component. For example:
position: absolute; left: 288px; top: 312px
You can enter values directly or click the ellipsis (...) button to use the Style Editor.
o Note: This property overrides any settings in the theme or the project CSS file for this component. If a style specified in this property does not appear to take effect, it is because an area of the component is obscured by a child component that has different style settings.
For a list of CSS2 style attributes, see the web page at
http://www.w3.org/TR/REC-CSS2/propidx.html
* styleClass. Type: String
A space-separated list of CSS2 style classes to be applied when the component is rendered. The style classes must be defined in the project's style sheet or in the theme's CSS file. If you click the ellipsis button (...), you see a list of all styles you can add to this property. For information on adding CSS classes and rules to the project's cascading style sheet, see CSS Editor.
o Note: See the note above under the style property description for an explanation of why a class added to this property might appear to have no effect on the component.
o Note: If you add a CSS style class from the current theme to your project CSS file and you redefine the style class, the change affects all components that use this style class. However, you can add your own style classes to the project CSS file that redefine the default style classes, and then when you add them to this property, the changes affect only this instance of this component.
For the defaulttheme.jar CSS style classes for this component, see Calendar Component CSS Classes.
Data
* maxDate. Type: java.util.Date
The last date that the user can select. The default value is four years from the date set in the minDate property, for a total span of five years.
* minDate. Type: java.util.Date
The earliest date that the user can select. The default value is the value of the selectedDate property, which defaults to the current date if that property is not set.
* required. Type: boolean
If selected, the user must enter a value for the calendar before the page can be submitted. If you add a Message component to the page and link its for property to this component, an error message will be displayed if the user tries to submit the page without entering a value.
* selectedDate. Type: Date
A java.util.Date object representing the calendar date selected by the user. If you right-click the component and choose Bind to Data, you can bind this property to a data provider or object that can process the user entered value on the server.
When the component displays initially, if this property is not set, its value defaults to the current date. If you provide values for minDate and maxDate, you can also provide a value for this property that initially displays a date in that range.
* validator. Type: MethodBinding
Indicates the JavaServer Faces validator that is called when the value is submitted. A validator ensures that the correct value is entered by a user. Choose a validator from the drop-down list. If you choose (null), no validator is called. If you choose a validator, also select the required property to ensure that the validator is used. For descriptions of JavaServer Faces validators, see the list of topics at List of Validators.
o Note: If you define your own validate method, for example, by right-clicking the component and choosing Edit Event Handler > validate, any value you might have set in this property is overridden.
File Upload Component
You can drag the File Upload component "file upload component icon" from the Palette's Basic category to the Visual Designer to create an entry field and a browse button that opens a file chooser dialog on the local system, enabling the user either to select a file or to type a file name into the entry field. When the page is submitted, a copy of the file's contents is sent to the web application.
The component is similar to an HTML <input type="file"> element.
* Note: This component is neither supported by nor available in portlet projects due to security reasons.
* Note: The size of the component in the Visual Designer might not match the size of the component when it is rendered in a web browser, making the component appear to line up correctly in the Visual Designer, but not when the page is rendered in the user's web browser. Also, the rendering of this component can differ depending on the web browser. Be sure to test the component in the web browsers that you expect your users to use. For example, if you add a width setting to the style property that is smaller than the setting in the columns property, Internet Explorer observes only the width setting, while the Mozilla browser ignores it and sets the width according to the number of characters in the columns property.
The File upload component uses a filter, a com.sun.rave.web.ui.util.UploadFilter object that is configured for you in the web application's deployment descriptor. The UploadFilter uses the Apache commons fileupload package. You might need to change these settings in the following two cases:
* The server holds the uploaded file in memory unless it exceeds 4096 bytes; otherwise, the server holds the file contents in a temporary file. You can change this threshold by modifying the sizeThreshold parameter for the UploadFilter filter entry in the web application's web.xml file.
* By default, the File Upload component can handle files up to one megabyte in size. You can change the maximum file size by modifying the maxSize parameter for the UploadFilter filter entry in the application's web.xml file.
o
A negative value for the maxSize parameter indicates that there is no file size limit. Setting the parameter to a negative value is not recommended for security reasons. For example, if you allow unlimited file sizes, a malicious user could mount a denial of service attack on your site by using extremely large files
* To change the settings for the UploadFilter object in the web.xml file:
1. In the Files window, expand project-name > web > WEB-INF.
2. Double-click the web.xml node to open the file in the XML editor.
3. Click the Filters toolbar button.
4. In the UploadFilter section under Initialization Parameters, you can change the values for the maxSize and sizeThreshold parameters.
The contents of the uploaded file, together with some information about it, are stored in an instance of com.sun.rave.web.ui.model.UploadedFile. By using this object, you can get the content of the file as a String or write the contents to disk, as well as get properties such as the name and the size of the file. In the interest of conserving memory, the contents and file data are only available during the HTTP request in which the file was uploaded. To access the contents of the uploaded file, bind the uploadedFile property to a bean property of type com.sun.rave.web.ui.model.UploadedFile. Have the setter or an action method process the file.
The UploadedFile interface has methods for getting the name and size of the file, determining the file's MIME type (such as text/plain or image/jpeg), getting the file's contents as bytes or as a String, and writing the contents to disk. To learn more, in the Java editor, right-click on UploadedFile in a declaration statement and choose Show JavaDoc from the pop-up menu.
* To set the component's properties, select the component and edit its properties in the File Upload Properties Window.
* Right-click the component and choose one of the following pop-up menu items:
o Edit validate Event Handler. Opens the Java Editor with the cursor positioned in the component's validate method so you can insert code to validate the value of the component.
o Set Initial Focus. Gives this component focus when the user opens the page.
o Auto-submit on Change. Causes the form to be automatically submitted if the value of the component changes. Sets the component's JavaScript onclick property to common_timeoutSubmitForm(this.form, 'component-id');. At runtime, this code causes the form to be automatically submitted if the user changes the component value. Once the form is submitted, conversion and validation occur on the server and any value change listener methods execute, and then the page is redisplayed.
A component configured to Auto-submit on Change can use virtual forms to limit the input fields that are processed when the form is submitted. If the auto-submit component is defined to submit a virtual form, only the participants in that virtual form will be processed when the auto-submit occurs.
o Bind to Data. Bind the component's text property to an object or to a data provider. For more information, see Bind to Data Dialog Box.
o Property Bindings. Bind any of the component's properties to an object or data provider, such as the uploadedFile property to a bean property of type com.sun.rave.web.ui.model.UploadedFile.
o Configure Virtual Forms. Enables you to add the component to a virtual form.
For more details on using the "File Upload Component" Please see this tutorial
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/file_upload.html
Please share your comments, experiences, additional information, questions, feedback, etc. on these components.
------------------------------------------------------------------------------- --------------------

Of interest relating to file upload component to users : "Saving Uploaded Files Uploaded by the File Upload Component " Check the blog:
http://blogs.sun.com/roller/page/divas

Similar Messages

  • JSF Calendar/ File Upload

    Can any one of you suggest me any tutorial about Calendar function? How to add the calendar component into Studio Creator? Highly appreciate your help.
    Also, I need help on File upload.

    Thanks for the information. But I have a question on Calendar component . I want the Calendar component to be open when user wants to enter a date. Otherwie it looks akward in a page to keep the component visible all the time. How do I do that? What I am thinking is, i want to make this small and upon clicking it will open the calendar and select date. Thanks for your help in advance.
    About Fileupload
    Do I have to copy any jar file from MyFaces. I am using SUN Studio Creator. Do I have to import anything?

  • Date Picker & File Upload components

    Hi all,
    I would like to have a Date Picker in a column in the table view (htmlb for java). Kindly let me know how I can do it.
    Similiarly can I make use of File Upload (htmlb for java )component inside the table view. I want to have a column which would allow a file to uploaded associated with that row.
    Rgds,
    Subu

    Of interest relating to file upload component to users : "Saving Uploaded Files Uploaded by the File Upload Component " Check the blog:
    http://blogs.sun.com/roller/page/divas

  • File upload not working on Mac OSX

    I've tried several of the Flex file upload components, in all
    cases they don't work correctly when used on a Mac. I've tested
    both flash player 9 and the latest 10 release. The file uploads to
    the server, but the progress bar doesn't update and the upload
    complete event never fires. To the end user, it looks like the app
    isn't doing anything at all!
    Any advice on how to get this working? If you know of any
    file upload components that are already tested and working on the
    Mac version of flash - that would be a great help as well!
    Thanks!

    If you Google it you will find that this is a known issue, it surprised me since I spent days looking at my code.
    I found possible solutions here, but none worked for me it seems that it worked for many other people.
    http://www.abdulqabiz.com/blog/archives/2006/06/09/workaround-filereference-oncomplete-is- not-fired-on-mac-os/
    Hope Mac and Adobe will have lunch one day and figure it out.
    Ben

  • Progress Bars in File Upload Behavours

    Progress Bars in File Upload Behavours would be great.

    I think we need to be realistic ;)
    KTML4 - isn't going to happen, it was dropped, other 3rd party products are surfacing,
    sadly, we'll not see that again.
    Calendar was a separate Interakt application (not really a toolkit item)
    like the ADDT form control date/calendar picker - so I doubt that will happen
    That said - it would still get my vote for a comeback.
    Ajax tool - need to specify EXACTLY what tool and how it would expand on the ADDT and how it would relate to SPRY and other Components now being made available for DWCS4 ie YUI etc
    atb
    Paul

  • Threading problem during File Upload with Apache faces upload tag

    First I am going to tell you "My Understanding of how JSF Apache Upload works, Correct me if i am wrong".
    1) Restores View (to show Input box and Browse button to facilitate users to select a file for upload)
    2) Translates Request Parameters to Component Values (Creates equivalent components to update them with request values).
    3) Validates Input(Checks to see whether the User has input the correct file)
    4) Updates Backing Bean or Model to reflect the values.
    5) Renders response to user.
    I am uploading huge files of sizes 400MB and above with the help of JSF apache extensions tag
    <h:form id="uploadForm" enctype="multipart/form-data">
    <x:inputFileUpload style="height:20px;" id="upload" value="#{backingbean.fileContents}" storage="file" size="50" />
    </h:form>
    In the backing bean
    private UploadedFile fileContents;
         public UploadedFile getFileContents() {
              return fileContents;
         public void setFileContents(UploadedFile fileContents) {
              System.out.println("File being uploaded...");
              this.fileContents = fileContents;
    Since, the file size is so huge, I am using temp folder to use for the apache tag instead of memory.
    In web.xml i am using like this
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>600m</param-value>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>10m</param-value>
    </init-param>
         <init-param>
    <param-name>uploadRepositoryPath</param-name>
    <param-value>/uploadfolder/</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    The upload process is working perfectly fine.
    Now coming to the problem:
    Suppose one user is logging into the application & uploading say 400MB of files.
    Until these files are linked to the model objects as my understanding of step 2, if second user tries to open the application he gets stuck with the loading page.
    The page gets loaded only after the request files are linked to the component values(Step 2 above) and updates the backing bean's values.
    I don't see any error in the logs. User is getting stuck. The user is getting stuck only when uploading the files. The other operations like searching are not blocking any other activities performed by the user.
    Server used: IBM Application Server V6.0. CPU is normal, memory usage is normal.

    Dear friend,
    i am also trying to upload using the common file upload.
    when try to run the file error is coming
    can give some suggestion.
    can i use if concurrent user file upload at a time

  • File Upload / Download - Advice Required

    Hi all,
    This is really just a general question, looking for advice.
    I have downloaded and successfully used the File Upload PJC for Forms 6i - thanks Oracle.
    We are looking to use this to download and upload files from or to the client machine, and I am (relatively) confident of reversing the Java components to allow this to happen.
    However, we are actually looking to transfer the files from the client machine, to the 9iAS Tier and then to the UNIX (AIX) tier where the database (8.1.7.4) resides - and vice versa.
    I have considered a couple of different approaches :
    1. Run the Java Server component in the Database JVM to enable the writing/reading of files on the UNIX filesystem.
    2. Use TEXT_IO on the 9iAS tier, and UTL_FILE on the Database Tier, to move files between the two tiers.
    3. Write the files to / from the Database, and then from/to there into the UNIX filesystem.
    Does anyone have any expereince of attempting to implement a similar solution, or information on Oracle documentation explaining any of the above.
    Plus, I'm sure I must be missing a trick !
    Any other ideas ??
    Regards
    Marc Ludwig

    We have build a similar solution,
    for the download:
    we use the pl/sql gateway to send the file to the client with the following function:
    wpg_docload.download_File(lob_loc);
    you could build a pl/sql procedure that accepts an id and selects the blob locater and
    triggers this function. the procedure can be called by setting the configuration in your DAD correctly.
    that way its easier then rebuilding the whole fileupload utility.
    in the webforms you can have a code that opens a new window with an url you give.
    the url will point to the pl/sql function and you can pass the id of the record you want to get the blob from.
    for the upload to your database:
    well, we chose to loose the zip functionality and modify the pl/sql library that comes with it.
    instead of using the uploadserver class, you could build a pl/sql function in the database that
    accepts the varchar32 strings (which are base64encoded chunks of your file) and appends them to a blob.
    the function that could do that would look like:
    PROCEDURE APPEND_DATA(P_ID IN NUMBER, P_DATA IN VARCHAR2) IS
    bin_data blob;
    append_data blob;
    raw_data raw(16384);
    BEGIN
    dbms_lob.CREATETEMPORARY(append_data,true);
    dbms_lob.OPEN(append_data,DBMS_LOB.LOB_READWRITE);
    select binary_data into bin_data from ibs_physical_doc where id=P_ID for update;
    raw_data:= utl_encode.BASE64_DECODE(utl_raw.CAST_TO_RAW(p_data));
    dbms_lob.write(append_data, utl_raw.LENGTH(raw_data),1,raw_data);
    dbms_lob.APPEND(bin_data,append_data);
    dbms_lob.CLOSE(append_data);
    COMMIT;
    END;
    you can increase the chunksize a bit more.
    you still have a problem btw that you probably cant upload more then 4-8 mb before you get an out of memory error on the client.
    you could solve that by rewriting the client java file to send the file piece by piece on request by the server instead of all the pieces after eachother, and first read a piece of the file and then encode that piece and then send it instead of reading the whole file, encoding it and sending the chunks.
    Another option is to use the standard upload possibilties with web pl/sql, and open a new browser window to that window from forms. A drawback of that is that it is not integrated in the web forms program and that you cant see when the upload is finished (no callback). and that you are bound to the default table layout.
    one final thing, if you are going to use this, you might want to take a look at using JInitiator 1.3.1.9 if you arent using it already this automaticly sets the signature in the clients database if he accepts it. there is a bug in it, look for it somewhere in this forum. if you are using the sample that comes with forms 6i you will have to replace the fileuploadprogressbar with the one that comes with the forms 9i sample and recompile everything and i think you will have to use JDK1.3.1_03 for that. that means that you will have to modify the make batch file. the command for compiling is different, the classpath is an option when you call javac, also you will have to sign it with jarsigner.exe (in the jdk) instead of the one in the example.
    Hope this info is helpfull, if you like to have more specific code, mail me at [email protected]

  • Upload file without using file upload UI Element

    Hi all.
    I need upload a .txt file without using file upload UI Element because filename is not insert by user. The filename is generated by program. I try to use 'GUI_UPLOAD' and 'WS_UPLOAD' but don't work.
    Many thanks in advance.

    As you correctly pointed out we cannot use the gui_upload and gui_download fm's in webdynpro because they require sap gui and WD Components generally run in a HTML or Portal environment.
    The only option available is File Upload Element

  • File Upload Problem in JSF

    Hi all,
    I have a problem in file upload. I have a file upload third party component which uploads the file with the filter action depending on the url. My requirement is to trace the uploaded filename for addressing it with the database record. So I need the filename in my backing bean to store it in the database. Ho can i get the filename from view page to backing bean. Any Ideas and help please.
    Many thanx,
    vijaycanaan

    Mr BalusC,
    Yes Iam talking about a custom made upload component. The fileupload tutorials u send are good but my requirement is not meeting them. Among my requirements one is mutilple file uploads in the single view page. This is possible at present with my custom upload componet. Only if the problem gets solved. Any way once again please think on my problem and give your solution on it.
    Here is my problem:
    The problem is I have to access the components from view page which this kind of requirement possible in jsp by request parsing which results the key value pairs of the form components. This same thing/way I should get in backing bean from JSF view page.
    The solution I want may like as follows.
    Note this code is incorrect and wrong but for to understand my requirement.
    someobject.getComponentIdValue("clientID"); which returns a string value as d:\images\Tutle.jpg
    The clientID is upload file component' Id . In the request it may be the key associated with value as file complete path. By this kind of way my upload filter is able to get the orignal file. Ok i need this in my  backing bean to get the orignal filename to insert into the database. Please for this give the solution or reply.many thanx,
    vijaycanaan.

  • File Upload Problem in Mozila

    Hi;
    My code is workin in IE but problem in Mozila Fireforx:
    <%@page import="org.apache.commons.fileupload.DiskFileUpload"%>
    <%@page import="org.apache.commons.fileupload.FileItem"%>
    <%@page import="java.util.List"%>
    <%@page import="java.util.Iterator"%>
    <%@page import="java.io.File"%>
    <%@page import="java.io.FileNotFoundException"%>
    <%@page import="java.io.BufferedReader"%>
    <%@page import="java.io.FileReader"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Upload Process</title>
    </head>
    <body>
    <%
    String record=null;
    try{
    System.out.println("Content_type:"+request.getContentType());
    DiskFileUpload fu = new DiskFileUpload();
    fu.setSizeMax(100000000);
    List fileItem = fu.parseRequest(request);
    Iterator iter = fileItem.iterator();
    FileItem fi = (FileItem)iter.next();
    if(!fi.isFormField()){
    File file = new File(fi.getName());
    out.println("NAME:"+fi.getName());
    File nFile = new File(application.getRealPath("/"),file.getName());
    // BufferedReader br =new BufferedReader(new FileReader(nFile));
    out.println("Name:"+nFile.getName());
    out.println("ABPath:"+nFile.getAbsolutePath());
    }else{
    System.out.println("Field ="+fi.getFieldName());
    } catch(Exception ex){
    ex.printStackTrace();
    %>
    </body>
    </html>
    Problem is for AbsolutePath it looking file under project directory.
    :D:\Dir name\build\web\.....
    PLEASE HELP
    Thanks in Advance
    Mamun

    Mr BalusC,
    Yes Iam talking about a custom made upload component. The fileupload tutorials u send are good but my requirement is not meeting them. Among my requirements one is mutilple file uploads in the single view page. This is possible at present with my custom upload componet. Only if the problem gets solved. Any way once again please think on my problem and give your solution on it.
    Here is my problem:
    The problem is I have to access the components from view page which this kind of requirement possible in jsp by request parsing which results the key value pairs of the form components. This same thing/way I should get in backing bean from JSF view page.
    The solution I want may like as follows.
    Note this code is incorrect and wrong but for to understand my requirement.
    someobject.getComponentIdValue("clientID"); which returns a string value as d:\images\Tutle.jpg
    The clientID is upload file component' Id . In the request it may be the key associated with value as file complete path. By this kind of way my upload filter is able to get the orignal file. Ok i need this in my  backing bean to get the orignal filename to insert into the database. Please for this give the solution or reply.many thanx,
    vijaycanaan.

  • How to solve Fusion ADF file upload and download?

    Now we are building web application with Fusion ADF (JDeveloper 11.1.2.0.0). We want to downloading and uploading from tables.Is there any special tool in Fusion ADF or should I going with traditional java coding. Thanks

    Actually ADF Provide Components for file upload and download
    Download :
    <af:fileDownloadActionListener/>
    See tagDoc: http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_fileDownloadActionListener.html
    Upload
    <af:inputFile/>
    See tagDoc: http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_inputFile.html
    Edited by: -CHS on Jul 6, 2011 9:52 AM

  • Is File Upload supported on IE9

    Hi All,
    My Jdev Version 11.1.1.5.
    In my application, I have a feature/functionality of file upload(using af:inputFile). When I run my application in IE8, it runs perfectly fine.
    But when I run the same application in IE9, it does not run. When I try to upload a file, it just refreshes the page without uploading it.
    Is file upload supported in IE9. Because I found this forum thread though a bit old, which says file upload is not supported in IE9.
    BUG File upload broken in IE9
    Not sure if this issue is resolved. If not, is there any documentation for the same. Because we need to convince the same to client :)
    Thanks,
    Umesh

    ADF 11.1.1.5 does support IE9, it is the first version to do so (see browser certification: http://www.oracle.com/technetwork/developer-tools/jdev/index-091111.html#Browsers)
    However, there were some problems with IE9 and af:inputFile in 11.1.1.5, see support note "In IE9, Input Components Lose Their Values When Using an af:inputFile on the Same Form [ID 1420818.1]". You can either upgrade to 11.1.1.6 or apply the patch mentioned in the note.
    Hope this helps!
    - Joonas

  • File upload component and text area issue

    Hi guys,
    I have static text, text area and button on the same page. Text area binded to session bean value and all works fine (I can input text into text area and press button to save changes).
    After adding file upload component to the same page I have got a problem - now after page refreshing the non english characters inside text gets trashed.
    Other non english characters - inside static text components remains the same - the problem relates only to text area.
    It looks like file upload component code has an encoding related bug. Is that a known issue?
    And may be somebody have a workaround?
    Thanks.

    Hi Rom@n,
    I did some checking and this issue is currently logged as: 6442528. It is scheduled to be available in the next patch release. I'm sorry I don't have a time frame for the patch since it is still waiting for other fixes.
    Sorry for the inconvience.
    Lark
    Creator Team

  • Declarative Component : UploadedFile Isssue for multiple file Upload case.

    Hi,
    I have made one declarative component for the multiple file upload case; where i have add button that dynamically adds af:inputFile component to the popup dialog and similarly delete button to dynamically delete the selected inputFile component. Everything work fine such as:
    1. add button adds the inputfile component properly and delete does the same.
    2. upload of Multiple files also works fine. ( I keep the uploadedFile in the java.util.Map which is the pageFlowScope and once, Dialog box ok/cancel is clicked, i clear everything back).
    IT WORKS GREAT WHEN:
    User hit 5 times add button if they want to upload 5 images. and do upload for all the 5 inputFile components . (Add or Delete button should not be clicked after any upload , but before you can.)..
    THE ONLY PROBLEM IS WHEN:
    1. user uploaded; say 2 images but not yet clicked in the ok/cancel button yet... they are still in the upload dialog ..and hit ADD button again.
    2. After that user uploads say another file/image and now UploadedFile's getInputStream() returns null, length becomes 0 for all the other uploadedFile except this newly uploaded file.
    Now, here is the thing, i wrote my own customUplodedFile class which is just a wrapper and it return getInputStream() from this class and length from this class and it is working.... But i am not sure why does the uploadedFile loses it's value...
    import org.apache.myfaces.trinidad.model.UploadedFile;
    public interface ICustomUploadedFile
      extends Serializable, UploadedFile
      public String getFilename();
      public String getContentType();
      public long getLength();
      public Object getOpaqueData();
      public InputStream getInputStream();
      public void dispose();
    ====================
    public class CustomUploadedFile
      implements ICustomUploadedFile, Serializable
      private transient UploadedFile mUploadedFile;
      private transient InputStream mInputStream;
      private long mLength;
      public CustomUploadedFile()
      public CustomUploadedFile(UploadedFile pUploadedFile)
        this.mUploadedFile = pUploadedFile;
        this.mLength = pUploadedFile.getLength();
        try
          this.mInputStream = pUploadedFile.getInputStream();
        catch (IOException e)
          e.printStackTrace();
      public String getFilename()
        return mUploadedFile.getFilename();
      public String getContentType()
        return mUploadedFile.getContentType();
      public long getLength()
        return mLength;
      public Object getOpaqueData()
        return mUploadedFile.getOpaqueData();
      public InputStream getInputStream()
        return mInputStream;
      public void dispose()
        mUploadedFile.dispose();
    } Now, my questions are:
    1. Is there a way i could follow to not to lose the UploadedFiles's inputStream and length by not using my wrapper class but in a standard way/best way.
    2. I am not happy although it works because it is not making sense to me at all.....Why does the wrapper working though when i have transient variables; like UploadedFiles... and it's transient variables are lost why not mine.
    I am totally confused at this stage.. Need your help.
    Thanks

    any one??

  • Problem in dynamically generating the file upload field

    Hello all
    I am using netbeans 5.5 and visualwebpack for my jsf project.
    i have a problem in dynamically generating the file upload field and using it.
    I have a panel say "panelA" which holds file upload fields.
    Depending upon the count value i generate the file upload field using following code snippet:
    Upload upload1 = new Upload();
    upload1.setId("upload1");
    getPanelA.getChildren().add(upload1);
    The page successfully shows up the file upload fields. While the user clicks the submit button, i have used following logic to perform upload:
    List components = getPanelA().getChildren();
    for(int i = 0; i<components.size(); i++){
    if(components.get(i) instanceof Upload){
    UploadedFile uploadedFile = ((Upload)components.get(i)).getUploadedFile();
    I am getting this UploadedFile object null.
    How can i solve this problem.

    Anyway,
    I solved the problem.
    Actually i was using label property of the upload field due to which i got null pointer exception.
    I removed the label property of the upload field and things worked as i wanted.

Maybe you are looking for

  • How can I get Quicktime to open my WMA file- it says a required codec is not available

    How can I get Quicktime to open my WMA file- it says" a required codec is not available"?

  • How do I go back to previous iTunes version?

    How might I revert to to iTunes 11 while keeping other attributes? New version seems very visually intensive and compromises my search abilities thru 80k+ library.  With this size library, compieled over a decade, Im not going to pay to store it on i

  • OEM10g install: ORACLE NET CONFIGURATION ASSISTANT HANGS

    After the execution of "allroot.sh", the configuration assistant window comes up and then "Oracle Net Configuration Assistant" shows "in progress..." indefinitely. I can not proceed further. When I stop it, the OUI exits. I raised a TAR 3 times but d

  • The Manifest Designer could not import the certificate

    What I'm trying to accomplish here is to have the .appx file signed during build time so that the following command would work or even better I should not need it anymore set path=%path%;"C:\Program Files (x86)\Windows Kits\8.1\bin\x64" SignTool.exe

  • Automatic Mapping Process

    Guys, is there any way to make the automatic mapping process in OWB ? So, we needn't have to start the mapping process manually but otherwise it would start when the source schema have a new data (in my case : a new data in a view). Thanks in advance