0

I'm working on a JSF application, which displays requested information provided by a web service. Since a web service deals with XML data and XHTML is also XML, I've create a XML stylesheet, which transforms the data of the web service into a HTML table.

Now I want, that parts of the table become a JSF commandLink which could be clicked to provide further navigation on the data.

I've read XSLT, JSTL e JSF and How to create dynamic JSF form fields but the answers don't suit my needs, since the table is very dynamic (more or less rows, depending on data).

Is it possible to enrich the XML stylesheet with JSF h:commandLink tags, so that they get renderd before the view is passed through the servlet?


Update: Ok, I think that How to create dynamic JSF form fields provides an answer, but I don't know how to do it. At the moment, my transformed table is displayed with an h:outputtext tag, but when I enrich it with JSF tags, they won't get rendered.


Update2: I tried to do the tranformation in the mentioned servlet filter. But the response in the filter ist already rendered. Is it possible to let the filter kick in before the render response phase?

Community
  • 1
  • 1
Turbokiwi
  • 1,288
  • 10
  • 15
  • You should not print JSF code as part of HTML output. The webbrowser doesn't understand JSF code. You should print/build JSF components as part of the JSF view. – BalusC May 23 '13 at 11:26
  • That's my intention. Of course the h:commandLink tag should not end up in the browser. But I want to have a "link" inside my table, which calls an action on my backing bean. In a static h:dataTable I would put a h:commandLink and everything will be rendered fine, but my source xml document is horribly nested and the easiest way to "transform" it into a table is XSLT (no need for nullchecks). Now I'm stuck at the point, where I have to do the transformation, so that the table can have JSF-tags, which should be rendered by JSF into plain HTML. – Turbokiwi May 23 '13 at 11:36
  • possible duplicate of [Export to Excel using JSF 2 and XSLT](http://stackoverflow.com/questions/18320513/export-to-excel-using-jsf-2-and-xslt) – Paul Sweatte May 25 '15 at 15:49

0 Answers0