Recommended alternative for fr:datatable in Orbeon XForms version >= 4.5 -
fr:datatable deprecated in orbeon xforms 4.0 , removed of version 4.5 (as per release notes). rely heavily on construct creating sortable tables , because of more enhanced event catching it's easy full xml element useful stuff rather 1 single value.
what recommended alternative fr:data table? example use:
<fr:datatable width="100%" scrollable="vertical" height="300px"> <xhtml:thead> <xhtml:tr> <xhtml:th fr:sortable="true" fr:sortkey="number(tokenize(@id,'\.')[last()])" fr:sorttype="number" fr:resizeable="true"> <xforms:output ref="$resources/id"/> </xhtml:th> <xhtml:th fr:sortable="true" fr:resizeable="true"> <xforms:output ref="$resources/issue"/> </xhtml:th> <xhtml:th fr:sortable="true" fr:sortkey="@currentstatuscode" fr:resizeable="true"> <xforms:output ref="$resources/status"/> </xhtml:th> <xhtml:th fr:sortable="true" fr:sortkey="@priority" fr:resizeable="true"> <xforms:output ref="$resources/priority"/> </xhtml:th> <xhtml:th fr:sortable="true" fr:sortkey="@type" fr:resizeable="true"> <xforms:output ref="$resources/type"/> </xhtml:th> <xhtml:th fr:sortable="true" fr:resizeable="true"> <xforms:output ref="$resources/date"/> </xhtml:th> <xhtml:th fr:sortable="true" fr:sorted="ascending" fr:resizeable="true"> <xforms:output ref="$resources/assigned-to"/> </xhtml:th> <xhtml:th fr:sortable="true" fr:sortkey="(assignment|tracking)[1]/string(@labels)" fr:resizeable="true"> <xforms:output ref="$resources/label"/> </xhtml:th> </xhtml:tr> </xhtml:thead> <xhtml:tbody> <xhtml:tr repeat-nodeset="instance('issues-instance')/issue[if (string-length(instance('selected-issue-id'))>0) (tokenize(@id,'\.')[last()]=instance('selected-issue-id')) else (@currentstatuscode=tokenize(instance('selected-status-codes'),' ') , @type=tokenize(instance('selected-issue-types'),' ') , (instance('selected-issue-priorities')='' or @priority=tokenize(instance('selected-issue-priorities'),' ')) , (instance('selected-issue-labels')='' or tokenize(@currentlabels,'\s')=tokenize(instance('selected-issue-labels'),'\s')) , (instance('selected-issue-assignee')='' or (instance('selected-issue-assignee')='#unassigned#' , string-length(@lastassignment)=0) or @lastassignment=instance('selected-issue-assignee')) , @id=instance('issue-search-results')/issue/@id)]" id="open-issue-table"> <xxforms:variable name="type" select="@type"/> <xhtml:td> <xforms:output ref="tokenize(@id,'\.')[last()]"/> </xhtml:td> <xhtml:td> <xforms:output ref="@displayname"/> </xhtml:td> <xhtml:td> <xxforms:variable name="currentstatuscode" select="@currentstatuscode"/> <xforms:output ref="instance('decor-types')/issuestatuscodelifecycle/enumeration[@value=$currentstatuscode]/label[@language=$resources/@xml:lang]"/> </xhtml:td> <xhtml:td> <xxforms:variable name="priority" select="@priority"/> <xforms:output ref="instance('decor-types')/issuepriority/enumeration[@value=$priority]/label[@language=$resources/@xml:lang]"/> </xhtml:td> <xhtml:td> <xxforms:variable name="itype" select="@type"/> <xforms:output ref="instance('decor-types')/issuetype/enumeration[@value=$itype]/label[@language=$resources/@xml:lang]"/> </xhtml:td> <xhtml:td> <xforms:output ref="@lastdate" xxforms:format="format-datetime(.,'[y]-[m01]-[d01]', (), (), ())"/> </xhtml:td> <xhtml:td> <xforms:output ref="@lastassignment"/> </xhtml:td> <xhtml:td> <!--xforms:output ref="tracking/@labels[1]"/--> <xforms:repeat nodeset="tokenize(@currentlabels, '\s')" class="not-selectable"> <xxforms:variable name="selectedlabelcode" select="."/> <xxforms:variable name="selectedlabelcolor" select="instance('project-instance')/labels/label[@code=$selectedlabelcode]/@color"/> <xxforms:variable name="selectedlabelname" select="instance('project-instance')/labels/label[@code=$selectedlabelcode]/@name"/> <xhtml:div class="labelouterbox" title="{$selectedlabelname}"> <xhtml:div style="background-color:{$selectedlabelcolor}; padding-left: 7px; float: left;"> </xhtml:div> <xhtml:div style="background-color: white;float: left;"> <xforms:output ref="concat(' ',$selectedlabelcode,' ')"/> </xhtml:div> </xhtml:div> </xforms:repeat> </xhtml:td> </xhtml:tr> </xhtml:tbody> <xforms:action ev:event="fr-selection-changed"> <xforms:setvalue ref="instance('selected-issue')/selected" value="event('selected')/@id"/> <xforms:send submission="get-issue-details-submission"/> </xforms:action> </fr:datatable>
there no real equivalent fr:datatable
. think that, in order of realisticness:
- if datatable works you, keep using it. if code doesn't ship orbeon forms, needed put datatable directory 4.4. can recreate build, if want avoid that, put files in own
jar
file, , put file underweb-inf/lib
. (if doing latter think you'll need compile coffeescript file.js
yourself, since done build.) - if can live features in
fr:grid
, use component instead. component used form builder handle tables, including repeated grids. it's missing lots of features compared datatable (paging, sorting, resizable columns…), of orbeon thinking of adding in near future. - use third party component you're happy with, , implement own "binding xforms" using xbl. obviously, can pretty involved, if you're not familiar xbl.
Comments
Post a Comment