row-attribute not working any more after changing to server-side processing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

row-attribute not working any more after changing to server-side processing

Kaspatoo
This post was updated on .
* some general information such as:
=> the version of Dandelion-Datatables you're using
    Dandelioncore/ JSP 1.1.1
=> the template engine you're using (JSP or Thymeleaf)
   JSP
=> the app server (Tomcat, JBoss, Weblogic, ...) and the Servlet API version you're using (visible in the web.xml for example)
     JBoss EAP 7
com.github.dandelion.core.web.DandelionServlet
=> the web browser you're using (Chrome, Firefox, IE, ...)
  IE + FF
=> whether you are using Spring/Spring MVC or another framework
  Spring, no MVW, Json-Plugin

* more specific things such as:
=> the kind of data source you're using (DOM, AJAX or AJAX + server-side processing)
   - server side processing
=> a code snippet that shows your usage of Dandelion-Datatables
=> a link to the data generated by the DataTables debugger



Hello,

I changed my datatable to server side processing. From this point on the row attribute seem to not working any more.

This is my definition of the datatable within the JSP:


<datatables:table id="users" url="/user_User_Json_List_Dandelion.action" serverSide="true" row="user">
            <datatables:column titleKey="user.user.list.username" sortable="false" property="benutzername" />
            <datatables:column titleKey="user.user.list.prename" sortable="false" property="person.vorname" />
            <datatables:column titleKey="user.user.list.surname" sortable="false" property="person.nachname" />
            <datatables:column titleKey="user.user.list.email" sortable="false" property="person.email" />
            <datatables:column cssCellClass="img" sortable="false" cssCellStyle="width: 40px">
                bla<c:if test="${user.gesperrt}">
                    <img src="<%=request.getContextPath()%>/static/images/locked.gif" title="<s:text name="%{getText('user.user.list.locked')}"/>"
                        alt="<s:text name="%{getText('user.user.list.locked')}"/>" />
                </c:if>
                <c:if test="${!user.aktiv}">
                    <img src="<%=request.getContextPath()%>/static/images/delete.gif" title="<s:text name="%{getText('user.user.list.delete')}"/>"
                        alt="<s:text name="%{getText('user.user.list.delete')}"/>" />
                </c:if>
            </datatables:column>
            <datatables:column cssCellClass="img" sortable="false" cssCellStyle="width: 20px">
                <c:if test="${!user.systemBenutzer}">
                    <s:url var="edit" action="user_User_Edit_Pre">
                        <s:param name="benutzerId">${user.benutzerId}</s:param>
                    </s:url>
                    <s:a href="%{edit}" title="%{getText('user.user.edit.header')}">
                        <img src="<%=request.getContextPath()%>/static/images/edit.gif" title="<s:text name="%{getText('user.user.edit.header')}"/>"
                            alt="<s:text name="%{getText('user.user.edit.header')}"/>" />
                    </s:a>
                </c:if>
            </datatables:column>
            <datatables:column cssCellClass="img" sortable="false" cssCellStyle="width: 20px">
                <s:url var="listRights" action="user_Auth_List_Pre">
                    <s:param name="benutzerId">${user.benutzerId}</s:param>                   
                </s:url>
                <s:a href="%{listRights}" title="%{getText('user.user.list.listRights')}">
                    <img src="<%=request.getContextPath()%>/static/images/user_details.gif" title="<s:text name="%{getText('user.user.list.listRights')}"/>"
                        alt="<s:text name="%{getText('user.user.list.listRights')}"/>" />
                </s:a>
            </datatables:column>
        </datatables:table>



all calls like e.g. '<c:if test="${user.gesperrt}">' do not work, theres no user-variable available since I turned server side processing on.

My Json Result from the Json WebService does look like:


{"data":[{"aktiv":true,"benutzerId":"8a2fde263d8b94000144020a7e066fa5","benutzername":"adm_boegel","gesperrt":false,"systemBenutzer":false},{.....




So whats going wrong here?
How else can I access the data?

Thanks for any help.


Edit:


just for testing I changed one of the columns to:

<datatables:column cssCellClass="img" sortable="false" cssCellStyle="width: 40px">
                    hello
            </datatables:column>

'hello' is never printed out in none of the about 2500 lines.



Edit2:

whenever setting to server side I only can access data via
<datatables:column property="...">

when not using server side I also can use row attribute and things like
${user.gesperrt}

Maybe its a bug?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: row-attribute not working any more after changing to server-side processing

Kaspatoo
as described in a previous chapter in the doc

8.3. Customizing column contents

One only can use of column tags using the property-property and my use the renderFunction-property to call java script which then may processes some logics.
But in my observation these java script calls returning some html (like an img-tag) is slowing down the rendering.

I hope in the end server side processing will although make some benefits in speed.


My dandelion datatables column then looks like:


            <datatables:column property="aktiv" renderFunction="produceUserLockedIcon"/>

and my java script looks like:


    <script type="text/javascript"> function produceUserLockedIcon(data, type, full) { return "testString: " + '<a href="blaa">blaa</a>' + '<img src="<%=request.getContextPath()%>/static/images/locked.gif"\>'; } </script>
Loading...