The problem for me is pretty straight forward. Onclick of an anchor tag , I execute a javascript using a4j:jsFunction
and the action of this function should stream an XML file from server. The problem is , the stream sent on richfaces response doesnt give a saveAs dialog but instead renders the xml on the browser. After reading many articles I understood that Ajax response cannot give a saveAs Dialog.
xhtml snippet:
<h:form>
<a4j:jsFunction name="updateCart" reRender="idFavouritePanel">
<a4j:actionparam name="jsonObject" assignTo="#{archiveOrderBean.jsonObject}"/>
</a4j:jsFunction>
<a4j:jsFunction name="download" reRender="partTableId" action="#{archiveOrderBean.loadSelectedOrder}">
<a4j:actionparam name="strId" assignTo="#{archiveOrderBean.strId}" />
</a4j:jsFunction>
</h:form>
and the response from bean
| response.setContentType("application/xml"); |
any help in this regard will be really helpful.