Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Creating columns dynamically

eno g. - oracleDec 5 2012 — edited Nov 11 2016
Hello,

I'm trying to write an app which contains a table to display data from a file. I want to figure out the number of columns from the data in the file as it may vary. However, it seems like I might have a problem with creating the setter/getter methods for column properties as I wouldn't know before hand how many columns and what they're called so I make use of PropertyValueFactory convenience class as it uses a set string for a parameter.

Any suggestions?

Thanks in advance
This post has been answered by James_D on Dec 5 2012
Jump to Answer

Comments

Answer

Hi Runrig,
If you want to upload multiple files using the native 'Inline Dropzone' or 'Block Dropzone' Display As option of the native File Browse item, then just ensure the 'Allow Multiple Files' attribute is switched to 'On'. As the associated item-level help explains, Multiple file names will be stored as a colon delimited list in the page item. So just ensure your upload process logic is handling the the processing of the colon delimited list. Take a look at the APEX_STRING.SPLIT function to process the page item value, and then loop through the result of that function to save each file name uploaded. Try installing the Sample File Upload and Download app via App Gallery. Edit the Project page, 13, and update the page item P13_FILE File Browse item to have the following settings:
Display As = Inline Dropzone
Allow Multiple Files = switched on
Then update the 'Upload File' page process to handle the multiple values now e.g.

declare
    l_files  apex_t_varchar2;
begin
    l_files := apex_string.split(:P13_FILE,':');
    for i in 1..l_files.count loop
        for c1 in (select *
                           from apex_application_temp_files
                         where name = l_files(i))
        loop
        ...
        -- Add your insert statement here
        ....
        end loop;
    end loop;
end;

If you then try uploading multiple files, you can inspect the 'Project Attachments' show/hide region at the bottom of the Project page, to see the list of uploaded files.
I hope this helps.
Regards,
Hilary

Marked as Answer by Runrig · Nov 6 2020
Runrig

Thanks. This is perfect.

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 2 2013
Added on Dec 5 2012
2 comments
27,701 views