Skip to Main Content

Java Development Tools

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!

How to create a button which open up a file dialog onclick

2965492Jul 13 2015 — edited Sep 1 2015

Hi all,

Can someone help me?
I have an issue. I try to create a button "Import File" - which when user click, a file dialog will show up to choose file from client PC.

<af:popup autoCancel="disabled" childCreation="deferred" ...">

  <af:dialog id="dlgEdit" ...>

<f:facet name="buttonBar">

  <af:commandButton text="Import File" immediate="true" partialSubmit="true" >

              ...

  </af:commandButton>

</f:facet>

</af:dialog>
</af:popup>

I've tried to put an <af:inputFile> into the <af:commandButton> but it didn't work.

I've tried to use Javascript to handle the clientListener of the commandButton but it didn't work, too.

I have try many ways, but nothing right.

Please help!

Thank a lot.

HaiND

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2015
Added on Jul 13 2015
4 comments
1,710 views