Forums de discussion

PortletFaces Bridge 2.0, JSF 2, and File Upload

Paul R, modifié il y a 12 années.

PortletFaces Bridge 2.0, JSF 2, and File Upload

New Member Envoyer: 1 Date d'inscription: 22/07/09 Publications récentes
I think the major confusion on using the ui widget bridge:inputFile is that the property "binding" is not in the TLD. So, if you are using a TLD-aware IDE, such as NetBeans, it will show a syntax error on that tag.

Also this below:

<factory>
<faces-context-factory>org.edorasframework.portletfaces.bridge.sun.FacesContextFactoryImpl</faces-context-factory>
</factory>

Is not required in your faces-config.xml file. It worked for me without that. When I did add that to the faces-config.xml, I got a SEVERE: Listener start error while trying to deploy the portlet.

Using:

Majorra 2.0.6 (jsf-api and jsf-impl)
Portlet Bridge 2.0.0

I was able to get bridge:inputFile working with no problem. Remember too, the property "binding" must point to an HtmlInputFile inside of a managed bean and the commandButton or commandLink used to submit the form must point to an ActionListener not just an action.

I hope this helps someone. It took me like 5 days to get this thing working. As a follow up I should probably post a small code example.
thumbnail
Neil Griffin, modifié il y a 12 années.

RE: PortletFaces Bridge 2.0, JSF 2, and File Upload

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Thanks for letting us know about the binding attribute missing from the TLD. I created an issue here to track that to closure: http://issues.liferay.com/browse/FACES-252

Regarding the faces-context-factory element, what made you think that was necessary? It doesn't appear in the Example JSF 2 portlet that demonstrates file upload: http://www.liferay.com/community/liferay-projects/liferay-faces/demos#jsf2-portlet

See: https://github.com/liferay/liferay-faces/blob/master/demos/bridge/jsf2-portlet/src/main/webapp/WEB-INF/faces-config.xml