I have a viewPanel where the view name to render is stored in a sessionScope variable.
<xp:viewPanel rows="30" id="view1"
cellpadding="0" cellspacing="0" var="viewEntry">
Everything works good.
The view has some sortable columns, but, in the viewColumnHeader the element the "Sortable" flag is disabled.
Even if I enable it in the source (sortable="true") I cannot sort the column.
The only way to do that Is assigning a specific view to the viewPanel control. So the sortable flag is enabled, I can check it and sort entries on the browser. But my need is to get a dynamic viewPanel (I man that the "viewName" could be different based on user's choice).
Is there a way to get this working?
I only thought about creating column headers outside the view: a simple table with links in each cell that set some variables in the sessionScope: view column and sorting asc/desc, then on page load moving this table inside the view (before the <tbody>). In the "data" properties of the viewPanel I will get sortable column and order from the scoped variables, this could do the job.
But, since pagination refreshes the view content partially it would only work at first load, right?
By the way I'm sure there's a better way to do that. Surely repeat control (but I have to build the table manually), I hope there would be a better way.
Thank you in advance.