GWT - Celltable image flickering on Chrome - google-chrome

We have a custom implementation of CellTable in which there is a custom column to render label and image. As part of hovering on a table row, we call table.redrawRow(rowNum) to render some context menu.
However, doing that, cause the text and image column to re-render the image (make a server call to fetch the image). This causes a flickering effect. This only happens in Chrome (version I am using - Chrome27)
The table row looks like this:
<tr __gwt_row="0" __gwt_subrow="0" class="GAH0TQLMKD">
<td class="GAH0TQLKKD GAH0TQLNKD GAH0TQLOKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-65" tabindex="0">
<div style="border-collapse: separate; border-spacing:0">
<div style="display:table-cell;vertical-align:middle">
<img src="icon.png" alt="" style="vertical-align:middle; border: 0;width:16px;height:16px; ">
</div>
<div class="GAH0TQLMJD" style="display:table-cell"><b>Contiki</b></div>
</div>
</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-66">Travels</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-67">Blah</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-68">Blah</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-69">2013-07-10</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-70">5</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-71">07/10/2013 01:53 AM</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD GAH0TQLILD GAH0TQLDAD" align="right">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-72">
<div class="GAH0TQLFAD">
<div style="width:64px; height:17px"></div>
</div>
</div>
</td>
</tr>
I don't see flickering on Firefox or IE9.
Note: My Cache-Control headers are set to no-cache.
Any thoughts? Ideas?

If you ask the browser not to cache the image, and you ask it to draw the image, it'll re-download it.
So either change your caching strategy for the image, and/or your strategy for updating the table (using a redrawRow during a hover to display something new seems suboptimal; the cells should rather listen to the mouse events and update their DOM dynamically)

Related

Stop eclipse formatter from removing certain useful parts of HTML code

<tr ng-repeat="rows in CalendarBean.weekList">
<td ng-repeat="cellList in rows">
<div id="{{cellList.fullDate}}" ng-click="onDateSelect(cellList.fullDate)"
class=" {{cellList.timeClass}} {{cellList.leaveFlag}}+{{cellList.holidayFlag}}"
style="border:{{cellList.borderColor}}; background-color: {{cellList.ColorCode}}"
align='center'>
<div class="row">
<span style="color: {{cellList.dateNumberColor}}" class="class1">
{{cellList.date}}
</span>
</div>
</div>
</td>
</tr>
I have this code.
background-color: {{cellList.ColorCode}}
this part and some closing second braces are getting removed while I am formatting my code in eclipse Luna. Any suggestion how to stop this?

same xpath for two td elements in div

i am trying to click on 2nd item(Not Know) in the Td element. I was able to click on the 1st item(known Issue) by using its xpath. How ever i am not able to do the same thing with the 2nd option. i am getting following error
Unable to locate an element with the xpath expression
//*[#id='group_tree']/div/div/div/div[1]/div/div[1]/table/tbody/tr/td[[contains(text(), 'Not Known')]
because of the following error:
below is my code:
driver.findElement(By
.xpath("//*[#id='group_tree']/div/div/div/div[1]/div/div[1]/table/tbody/tr/td[[contains(text(), 'Not Known')]"));
and my HTML is
<div style="display: block;">
<div>
<table cellspacing="0px" cellpadding="0px"
style="background-color: transparent;">
<tbody>
<tr>
<td><img class="tree" src="images/s.gifx" alt=""
style="margin-left: 16px;"></td>
<td class="tree_spacer"><img alt="" src="images/nav_bult.gifx"></td>
<td title="" class="tree_item_text"><a
name="37fd8721a9729140d11a2c59127b17a6">Known issue</a><span></span></td>
</tr>
</tbody>
</table>
<div></div>
</div>
<div>
<table cellspacing="0px" cellpadding="0px"
style="background-color: transparent;">
<tbody>
<tr>
<td><img class="tree" src="images/s.gifx" alt=""
style="margin-left: 16px;"></td>
<td class="tree_spacer"><img alt="" src="images/nav_bult.gifx"></td>
<td title="" class="tree_item_text"><a
name="ea1e8721a9729140d11a2c59127b17fb">Not known</a><span></span></td>
</tr>
</tbody>
</table>
<div></div>
</div>
</div>
i tried finding the element by name, by xpath and contains but everything is throwng error
Please Help
Before doing anything first check if your html is valid, I verified that your html misses matching </img> tags for the existing <img> tags.
Now, I assume you want the td elements with Known issue and Not known as text for a elements.
The following xpaths will give you those :
//td[#class='tree_item_text' and ./a/text()='Known issue']
//td[#class='tree_item_text' and ./a/text()='Not known']

Format Image to Press Up Against Table (HTML)

I'm trying to get the social media sprites in this HTML table at https://www.alexcurriemedia.com/video/ to press up flush with the image above it. Cannot figure out a way to do this.
Can't add another table above it because the upper image is a wordpress shortcode that doesn't seem to work within the table.
Here is the code:
<table><center>[wds id="3"]
<td nowrap><a href="http://www.facebook.com/alexcurriemedia" target="_blank">
<div class='sprite Facebook1' width="100"></div></a></td>
<td nowrap><a href="http://www.twitter.com/alexcurriemedia" target="_blank">
<div class='sprite Twitter1'></div></a></td>
<td nowrap><a href="http://www.flickr.com/alexcurrie" target="_blank">
<div class='sprite Flickr1'></div></a></td>
<td nowrap><a href="http://www.alexcurriemedia.tumblr.com" target="_blank">
<div class='sprite Tumblr1'></div></a></td>
<td nowrap><a href="http://www.instagram.com/alex.currie" target="_blank">
<div class='sprite Instagram1'></div></a></td><td></td>
</center></table>
Thanks so much!!
The stray <p> tags that you see are likely a result of Wordpress automatically inserting them through the text editor. You should not place a <div> inside of an <a> tag if at all possible. While technically valid, I've seen it cause problems with things such as Wordpress's text editor. If you look at the source code in your browser, you will notice that the link is actually being rendered twice, like so:
<td nowrap="">
<a href="http://www.twitter.com/alexcurriemedia" target="_blank"><p></p>
<div class="sprite Twitter1"></div>
</a>
<p>
</p>
</td>
The following code should work better:
<table>
<tbody><tr>
<td nowrap>
</td>
<td nowrap>
<a class="sprite Twitter1" href="http://www.twitter.com/alexcurriemedia" target="_blank"></a>
</td>
<td nowrap>
<a class="sprite Flickr1" href="http://www.flickr.com/alexcurrie" target="_blank"></a>
</td>
<td nowrap>
<a class="sprite Tumblr1" href="http://www.alexcurriemedia.tumblr.com" target="_blank"></a>
</td>
<td nowrap>
<a class="sprite Instagram1" href="http://www.instagram.com/alex.currie" target="_blank"></a>
</td>
</tr>
</tbody>
</table>
Once you change that, simply add the following to your CSS:
.sprite {
display: block;
}
This will cause the content in each <td> to align at the top, rather than in the center as they are doing currently.
If you still have trouble with the <p> tags being automatically inserted, you may look into this function.
End result:

Using Bootstrap's panel removes bootstrap table's border

I've been recently introduced to bootstrap and I'm trying to make a table but for some reason, if I put my table inside a panel, the borders on the top,left,right,bottom suddenly disappears and I'm not sure what's causing this.
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<br>
<table class='table table-striped table-bordered'>
<tr>
<td width='12%'>
<b>Message Title:</b>
</td>
<td>
Title
</td>
</tr>
<tr>
<td>
<b>Message Body:</b>
</td>
<td>
Body
<br /><br />
<h6><b>Created By:</b> John | <b>Created On:</b> February 13, 2015 3:45pm </h6>
</td>
</tr>
</table>
<hr>
<table class='table table-striped table-bordered'>
<tr>
<td width='12%'>
<b>Message Title:</b>
</td>
<td>
Title
</td>
</tr>
<tr>
<td>
<b>Message Body:</b>
</td>
<td>
Body
<br /><br />
<h6><b>Created By:</b> John | <b>Created On:</b> February 15, 2015 1:23pm </h6>
</td>
</tr>
</table>
<hr>
</div>
</div>
</div>
</div>
I would put a picture but it says I need 10 reputation points but I do hope you get my problem. If I remove the panel, the tables' borders suddenly appear.
You can use that style.
<div class="panel panel-default">
<div class="panel-heading">
Panel heading without title
</div>
<div class="panel-body">
Table content
</div>
</div>
From the bootstrap docs regarding panels:
Add any non-bordered .table within a panel for a seamless design. If there is a .panel-body, we add an extra border to the top of the table for separation.
You can use tables within panels, but not within panel-body or panel-heading as they will be displayed with separated borders, what is mostly not intended.
I've provided some working bootply examples to show default usage.
EDIT:
Also, panels are not designed to hold multiple tables, but for your use case you may simply want to add additional table rows instead of additional tables.
See the results in the additional bootply sample.

CSS Render problems?

I am currently trying to add some Design to an selfprogrammed board. Somehow I am experiencing odd buggs with the CSS rendering:
Every Row of that board is a .BoardRow Class to be formated in CSS. So, I am using:
.BoardRow td {
border: 2px dotted #4E6011;
background-image:-webkit-linear-gradient(bottom, #FFFFFF 33%, #EFEFEF 90%); /* Chrome, Safari */
}
this to add some nice looking borders around each row. Somehow always the top row is failing to work as intended. When zooming in with CTRL + Mouse in Google Chrome the top border always changes as shown in the picture. What can i do about this?
EDIT: Here is the full generated HTML Code:
<div id="Top">
<div id="Navi"> <a class="Link" href="index.php?s=home">Startseite</a> <a class="Link" href="index.php?s=physicians">Ärzteliste</a> <a class="Link" href="index.php?s=pmr">Polymyalgia Rheumatica</a> <a class="Link" href="index.php?s=logout">Abmelden</a> <a class="Link" href="index.php?s=course">Krankheitsverlauf</a> <a class="Link" href="index.php?s=board">Forum</a> </div>
</div>
<div id="Main">
<table id="Board">
Seite (1 von 1)
<tr>
<td class="BoardHeadline">Thema</td>
<td class="BoardHeadline">Beiträge</td>
<td class="BoardHeadline">Angesehen</td>
</tr>
<tr class="BoardRow">
<td class="BoardName">asdfasdfas von (Unbekannter Benutzer)<br />
geschrieben am 25:03:2013 um 15:43 </td>
<td class="BoardCounter">3</td>
<td class="BoardCounter">20</td>
</tr>
<tr class="BoardRow">
<td class="BoardName">Titelasdgkljahskjdghkjasg von (Unbekannter Benutzer)<br />
geschrieben am 25:03:2013 um 16:14 </td>
<td class="BoardCounter">1</td>
<td class="BoardCounter">4</td>
</tr>
<tr class="BoardRow">
<td class="BoardName">asdjglkajsljkdg von (Unbekannter Benutzer)<br />
geschrieben heute um 12:58 </td>
<td class="BoardCounter">3</td>
<td class="BoardCounter">12</td>
</tr>
</table>
<br />
Neues Thema eröffnen </div>
<div id="UserPanel"> Benutzerprofil </div>
and here is the CSS:
CSS
Please note that i am not an HTML or CSS expert. ;)
I am using Google Chrome 19 (old portable version on my usb stick) but this is also occuring on the local installed IE 8.
the problem is, the two dotted border are conflicting, try to use a border : colapse