html - Make xf:output a clickable link -
i have xquery instance defined:
<xf:instance id="table" xmlns=""> <results> <result> <interfacename></interfacename> <reportdate></reportdate> <testresult></testresult> <filelink></filelink> <filename></filename> </result> </results> </xf:instance>
later 'replace' instance submission , retrieving information xquery:
<xf:submission id="showtable" method="post" replace="instance" ref="instance('table')" instance="table"> <xf:resource value="concat('/exist/rest/db/xquery/returntable.xq?interface=',instance('defaultinstance')//interfacename,'&','date=',instance('defaultinstance')//calendardate)"/> </xf:submission>
returned 'table' instance looks like:
<results> <result> <interfacename>test1</interfacename> <reportdate>2016-06-01</reportdate> <testresult>failure</testresult> <filelink>http://localhost:8080/exist/rest/db/junitreports/report2.xml</filelink> <filename>/db/junitreports/report2.xml</filename> </result> <result> <interfacename>test2</interfacename> <reportdate>2016-06-01</reportdate> <testresult>success</testresult> <filelink>http://localhost:8080/exist/rest/db/junitreports/report1.xml</filelink> <filename>/db/junitreports/report1.xml</filename> </result> </results>
then trying build table referencing values in returned instance:
<tbody xf:repeat-nodeset="instance('table')//result"> <tr> <td> <xf:output ref="interfacename"></xf:output> </td> <td> <xf:output ref="reportdate"></xf:output> </td> <td> <xf:output ref="testresult"></xf:output> </td> <td> <li> <!-- <a href="{concat(request:get-scheme(), "://", request:get-server-name(),":", '8080', '/exist/rest', filelink )}">link</a> --> <xf:output ref="filelink"></xf:output> </li> </td> </tr> </tbody>
the issue last column should become clickable link , did not find way it.
i tried make filelink element in 'table' instance url specifying type:
<xf:bind nodeset="instance('table')//result/filelink" type="anyuri"></xf:bind>
but makes value in first row of table link. in next records column remains plane text.
i rather use simple href (you can see commented out there), not know how obtain value filelink element?
this not work because filename not concatenated string (i think not found):
<a href="{concat(request:get-scheme(), "://", request:get-server-name(),":", '8080', '/exist/rest', filename)}">link</a>
and not work (which obvious, still tried)
<a href="filelink">link</a>
in both possible solution not know: how can refer filelink element in pure html working href if decide use (preferable me solution)? how can make not first occurrence of field clickable link, next if use xf:output , xf:bind instead of href?
thank you.
this solved issue:
<td> <xf:trigger appearance="minimal"> <xf:label>file link</xf:label> <xf:action ev:event="domactivate"> <xf:load show="new"> <xf:resource value="filelink"/> </xf:load> </xf:action> </xf:trigger> </td>
Comments
Post a Comment