This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes How To avoid flickering effect to table WITH <s:div updateFreq=" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How To avoid flickering effect to table WITH <s:div updateFreq="2000"/>" Watch "How To avoid flickering effect to table WITH <s:div updateFreq="2000"/>" New topic
Author

How To avoid flickering effect to table WITH <s:div updateFreq="2000"/>

Ram Mandavkar
Greenhorn

Joined: Mar 23, 2009
Posts: 16
I am new in Struts 2.0

I tried to use struts 2.0 tag <s:div ( ajax ) to refresh Table contains
I can able fetch data from server after each 2 sec But its gives me flickering effect to table

So any one can tell me how to avoid this flickering effect on table

please go through code

Input:
<s:url id="ajaxTest" value="/TEST/DataRefreshAction.action" />
<s:div id="once" theme="ajax" href="%{ajaxTest}" updateFreq="2000">


Output:
<%@ taglib prefix="s" uri="/struts-tags" %>

<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<html>
<link href="../jsp/style1.css" rel="stylesheet" type="text/css">
<link href="../jsp/Pages.css" rel="stylesheet" type="text/css"/>
<head>
<title>Transactions</title>
</head>
<body topmargin="0" leftmargin="0" bgcolor="#FFFFFF" >
<table class="repTableLayout">
<s:iterator value="transdata">
<tr>
<td width="8%" class="frontValid11"></td>
<s:iterator value="top" >
<td width="15%" class="frontValid11">
<s:property />
</td>
</s:iterator>
</tr>
</s:iterator>
</table>
</body>
</html>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

This is much more likely to be a browser issue (as opposed to Struts)--it's the browser that's doing the redraw.
Ram Mandavkar
Greenhorn

Joined: Mar 23, 2009
Posts: 16
David Newton wrote:This is much more likely to be a browser issue (as opposed to Struts)--it's the browser that's doing the redraw.


Hi David,

Thanks For replay

But is there any way to avoid this.
or can you suggest me any another way with which i can able to avoid this Flickering.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I think you misunderstood my response--I meant that this isn't a Struts-specific issue: it's a browser issue, so should be addressed in a browser-related forum. Setting absolute sizes might help in reducing some of the flicker.

It's also unlikely that having a <head> etc. section will produce legal HTML--you can't embed an entire HTML page inside a <div> in the "parent" HTML page.
Ram Mandavkar
Greenhorn

Joined: Mar 23, 2009
Posts: 16
David Newton wrote:I think you misunderstood my response--I meant that this isn't a Struts-specific issue: it's a browser issue, so should be addressed in a browser-related forum. Setting absolute sizes might help in reducing some of the flicker.

It's also unlikely that having a <head> etc. section will produce legal HTML--you can't embed an entire HTML page inside a <div> in the "parent" HTML page.



Thanks
now i understand.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To avoid flickering effect to table WITH <s:div updateFreq="2000"/>
 
Similar Threads
spaces while populating using s:iterator
Help in Debugging
Help with tabbed Panel
tiles and <sx:autocompleter>
Equivalent of logic iterate in Struts 2