Results 1 to 13 of 13
  1. #1
    prabhurangan is offline Member
    Join Date
    May 2008
    Posts
    69
    Rep Power
    0

    Question [SOLVED] Display tag paging help..............?

    Hi Members,

    Im using display tag for my struts application, to show the pagination. But it is working perfect; I have set my page size as 15 rows per page and if the list im getting is less than '15 items' the paging text is shown as 'One item found. 1'
    But i need to hide this display. If my list is greater than '15' then it can display the paging text. As i do not need the paging to be displayed if the list is leeser than the total page size.

    If you are not able to understand me, i can explain more in detail.

    Looking forward for your reply.

    Regards,
    Prabhu.

  2. #2
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    in your jsp

    Java Code:
    <div class="pagelinks" align="right" id="insertHereTop"></div>
    
    <div class="pagelinks" align="right" id="insertHereBottom"></div>
    Java Code:
    insertNavigation ( 'insertHereTop', 'insertHereBottom' );
    Java Code:
    function insertNavigation( topElementID, BottomElementID ) {
    	
    	if ( document.getElementById('pagingBanner') ){
    		document.getElementById(topElementID).innerHTML=document.getElementById('pagingBanner').innerHTML;	
    		document.getElementById(BottomElementID).innerHTML=document.getElementById('pagingBanner').innerHTML;		
    	}	
    }

    is this what you wanted ?
    i am the future

  3. #3
    prabhurangan is offline Member
    Join Date
    May 2008
    Posts
    69
    Rep Power
    0

    Default

    Hi Rjual,
    Here is my sample code, and in this if i get the list size less than the 'pageSize' then i should not show any paging text, it should be hidden.

    I could not get you what you were saying the previous post.

    <tr class=menuItemRowItm>
    <td>

    <% boolean flag = true; %>
    <display:table name= "requestScope.getList" id="tttt" defaultorder= "ascending" requestURI= "some.action?fromDate=<%=fromDate%>&endDate=<%=end Date%>" pagesize="15" style= "width:100%; align: center;" >
    <% String style = ( ( flag == false )? "table_row_background" : "table_row_alternate_background" ); %>
    <display:column class="<%= style %>" style= "width=14%; PADDING-left: 3px; text-align: left;" property= "endedAt" format="{0,date,yyyy-MM-dd hh:mm:ss}" title= "Date Time" sortable= "true" />
    <display:column class="<%= style %>" style= "width:24%; PADDING-left: 3px; text-align : left;" property= "xxx" title= "Group" sortable= "true" />
    <display:column class="<%= style %>" style= "width:9%; PADDING-left: 3px; text-align : left;" property= "wwww" title= "Sub-Group" sortable= "true" />
    <display:column class="<%= style %>" style= "width:10%; PADDING-left: 3px; text-align : left;" property= "ffff" title= "Test Case" sortable= "true" />
    <display:column class="<%= style %>" style= "width:9%; PADDING-left: 3px; text-align : left;" property= "gggg" title= "Result" sortable= "true" />
    <display:column class="<%= style %>" style= "width:34%; PADDING-left: 3px; text-align : left;" property= "rrrr" title= "Remarks" sortable= "true" />
    <display:setProperty name="basic.empty.showtable" value="true" />
    <% flag = !flag; %>

    </display:table>
    </td>
    </tr>

  4. #4
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    in your displaytag.properties file
    set style of all div to

    style="display:none;"

    For eg...

    paging.banner.full=<div class="pagelinks" style="display:none;" ....


    after that use my code.
    i am the future

  5. #5
    prabhurangan is offline Member
    Join Date
    May 2008
    Posts
    69
    Rep Power
    0

    Default

    Hi im using displaytag-1.1.1.jar and displaytag.tld, then if i have to do as you said na, i have to get the source code of displaytag-1.1.1.jar and then i have to do what you have mentioned above.

    Am i right rjual.

    Please be patient if my questions are just silly.

    Regards,
    Prabhu.

  6. #6
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    if i have to do as you said na,
    nahi yaar :D

    create a file displaytag.properties keep it in your classes folder.

    write this in the file:

    Java Code:
    basic.msg.empty_list=<div class="eCareFormData"  align="left">&nbsp;Nothing found to display</div>
    
    paging.banner.full=<div class="pagelinks" style="display:none;" id="pagingBanner" align="right"><a href={1}><img src="shr/img/paging_ext_left_arrow.gif" border="0"></a> <a href={2}><img src="shr/img/paging_left_arrow.gif" border="0"></a> {5}of{6} <a href={3}><img src="shr/img/paging_right_arrow.gif"  border="0"></a> <a href={4}><img src="shr/img/paging_ext_right_arrow.gif"  border="0"></a></div>
    paging.banner.first=<div id="pagingBanner" style="display:none;" class="pagelinks" align="right"><a href={1}><img src="shr/img/paging_ext_left_arrow.gif" border="0"></a> <a href={2}><img src="shr/img/paging_left_arrow.gif" border="0"></a> {5}of{6} <a href={3}><img src="shr/img/paging_right_arrow.gif"  border="0"></a> <a href={4}><img src="shr/img/paging_ext_right_arrow.gif"  border="0"></a></div>
    paging.banner.last=<div style="display:none;" id="pagingBanner" class="pagelinks" align="right"><a href={1}><img src="shr/img/paging_ext_left_arrow.gif" border="0"></a> <a href={2}><img src="shr/img/paging_left_arrow.gif" border="0"></a> {5}of{6} <a href={3}><img src="shr/img/paging_right_arrow.gif"  border="0"></a> <a href={4}><img src="shr/img/paging_ext_right_arrow.gif"  border="0"></a></div>
    export.banner=<div class="pagelinks" style="display:none;" id="pagingBanner"  align="right">{0}</div>
    i am the future

  7. #7
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    also add these too

    paging.banner.all_items_found=
    paging.banner.some_items_found=
    paging.banner.one_item_found=
    paging.banner.onepage=
    i am the future

  8. #8
    prabhurangan is offline Member
    Join Date
    May 2008
    Posts
    69
    Rep Power
    0

    Default

    Hi Rjual,
    Do you have a displaytag.jar, in which you have customized the displaytag.properties file and re-made jar, so that it would be helpful to me. Or if you have sample project in which u have used ur logic to use display tag, any of the above... im little bit confused....

    Looking forward for your reply.

    Regards,
    Prabhu.

  9. #9
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    customized the displaytag.properties file and re-made jar,
    don't even try to do this, if you are thinking to do something like this.


    simply keep your displaytag jar in lib .
    and create the displaytag.properties in your own src directory.
    [ display tag documentation says so ]


    displaytag will search for displaytag.properties in your src directory, if found it will use this one, otherwise it will use its own property file.

    if you have sample project in which u have used

    Sorry to say, i don't have sample project,
    i am the future

  10. #10
    prabhurangan is offline Member
    Join Date
    May 2008
    Posts
    69
    Rep Power
    0

    Default

    Hi rijual,
    From where should i call your code, that javascript function; now i have created displaytag.properties file with the code added given by you and from where should i call that javascript function.

    Regards,
    Prabhu.

  11. #11
    prabhurangan is offline Member
    Join Date
    May 2008
    Posts
    69
    Rep Power
    0

    Default

    Oh thank you very much Rjual, Let me try it and let you know.

    Regards,
    Prabhu.

  12. #12
    prabhurangan is offline Member
    Join Date
    May 2008
    Posts
    69
    Rep Power
    0

    Default

    Thank you so much Rijual, I was just going on some where, your post just saved me my days..........

    Thank you... I have got the solutions.....
    Meet you on further post.

    Regards,
    Prabhu.

  13. #13
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    If the proplem is solved then close the thread as solved.

    if you think i helped you then click on [ located below ] as well. ;)
    i am the future

Similar Threads

  1. Display XML in JTable
    By boy22 in forum XML
    Replies: 2
    Last Post: 12-07-2008, 06:03 PM
  2. How to display image ?
    By Birkoff in forum AWT / Swing
    Replies: 7
    Last Post: 06-09-2008, 07:58 AM
  3. To display as a list
    By yuvi461 in forum New To Java
    Replies: 2
    Last Post: 01-09-2008, 12:06 PM
  4. Display program
    By nhlfan in forum New To Java
    Replies: 2
    Last Post: 11-22-2007, 12:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •