I'm trying to use ace:fileEntry
to upload a picture, as I read this component requires a submit from h:commandButton
in order to start downloading. My problem is that when I switched my ice:commandButton
with h:
, my managed bean (which is in Conversation Scope) gets created again (@PostConstruct
called) and the method in h:commandButton
and also the fileEntryListener
aren't called anymore.
And as another problem that might be causing this is that when I first enter my page the managed bean gets created and I call conversation begin, but when I do a second request (from a commandLink
) the managed bean is created again, and a new conversation is started, after that you can play how long do you want the managed bean doesn't get created again.
Back to my initial question, if I have ice:commandButton
the managed bean ins't created again, if it's with h:
it gets created again.
And to add a little bit more fun in it, if I remove the rendered attribute (which resolves to true) from ace:fileEntry
the fileEntryListener
is called, but the action from h:commandButton
isn't called no matter what.
I tried to add explicit ids to the components, tried to change ice:form
with h:form
.. nothing.
Please Help.
Ps: why ICEfaces 2 can't work with all ice components, why does it requires h:commandButton
, instead of ice:commandButton
, why the new JSF 2.0 stuff with f:selectItems
backed by a regular list isn't working with ice:selectOneMenu
, works just with h:selectOneMenu
? What's up with ICEfaces ? And why CDI doesn't work as expected, with Seam 2 also I had problems with conversations called twice .. ps2: if I don't navigate to another view ?cid=1
isn't present in the URL.
Now, with ace:fileEntry and h:commandButton, the reason why the ice:commandButton can not be used is because that is an AJAX component, and browsers will not upload files in an AJAX submit. Even with HTML5 it is not automatic, and new File and XmlHttpRequest APIs must be used. In an HTML4 browser, only a full page, full form, submit will upload the file contents, and only h:commandButton operates that way. For more details, you can see this explained near the top of the page at:
http://wiki.icefaces.org/display/ICE/FileEntry
With our ice: components, which are extended variants of the h: components, such as ice:selectOneMenu, they are lacking some new JSF 2 features because we have been focusing on our newer Advanced Component Environment, due to customer demand for rich client-side components. As well, the focus was on maintaining backwards compatibility with the ice: components, to ease customer migration from ICEfaces 1.8.x to ICEfaces 2.x, and less so to be altering those components' behaviours. But we are still actively maintaining and improving the ice: components, and will be adding the new features soon. Feel free to create any enhancement requests in our Jira system, and to vote on any existing entries, as this does guide our development priorities.