Wednesday 29 August 2007

Using headers in GWT FlexTable

I'm a moron. I've been dicking around with headers in GWT FlexTable for a while. I simply added rows and used a different styleset for the headers. Then I had to subtract and add for each table operation....

The solution is (of course) to insert table headers with the DOM-class in GWT.


/**
* Initializes the table with header rows. The headers are defined by the headerModel
* This adds the header rows directly to the table, using the DOM-class. The current FlexTable implemenetation
* doesn't have headers. This uses the normal html ... syntax
*/
private void initTable() {

Element thead = DOM.createTHead();

DOM.insertChild(table.getElement(), thead, 0);

for (int row = 0; row <>

Element tr = DOM.createTR();
DOM.appendChild(thead, tr);
for (int col = 0; col <>

Element th = DOM.createTH();
DOM.appendChild(tr, th);

// NB!!!! camelback on attributes for IE or despair
DOM.setElementAttribute(th, "colSpan", String.valueOf(headerModel.getHeaderSpan(row, col)));
DOM.setElementAttribute(th, "align", "left");
DOM.setElementAttribute(th, "border", "1");

//set header text
DOM.setInnerText(th, headerModel.getHeaderText(row, col));
}
}

}

Now the number of rows, clear etc works fine. FlexTable uses "correct". The camel back IE "feature" took me a while though.

41 comments:

Anonymous said...

I usually do not leave a lot of responses, but i did some searching and wound up here "Using headers in GWT FlexTable".
And I do have a couple of questions for you if you do not mind.
Could it be simply me or does it look like a few of the responses appear as if they are coming from brain dead people?
:-P And, if you are posting at other online sites, I would like to keep up with everything new you have to post.
Would you make a list of every one of your shared sites like your Facebook page, twitter
feed, or linkedin profile?

My website - christian louboutin outlet

Anonymous said...

At this time I am going to do my breakfast, after having my breakfast coming yet again to read
additional news.

Also visit my homepage: laboutin

Anonymous said...


Our updates Recent articles:

Anonymous said...

Great post. I was checking constantly this blog and I am impressed!

Very useful information particularly the remaining phase :) I
deal with such information a lot. I was seeking this certain information for a long time.

Thanks and good luck.

My web site; 激安オークリー

Anonymous said...

Hi it's me, I am also visiting this site regularly, this web page is genuinely good and the visitors are in fact sharing fastidious thoughts.

Feel free to visit my site; レイバン ゴーグル

Anonymous said...

I read this article fully about the difference of latest and previous
technologies, it's amazing article.

Also visit my website ... http://www.raybanxx.com

Anonymous said...

Normally I don't read article on blogs, but I wish to say that this write-up very forced me to check out and do so! Your writing taste has been surprised me. Thanks, quite nice post.

my weblog - オークリーメガネ

Anonymous said...

I don't leave many remarks, however after reading some of the remarks here "Using headers in GWT FlexTable". I actually do have a couple of questions for you if it's allright.

Could it be just me or does it look as if like
some of the responses look like they are coming from
brain dead people? :-P And, if you are posting on additional
online social sites, I'd like to follow you. Could you make a list of every one of all your social community sites like your twitter feed, Facebook page or linkedin profile?

Feel free to visit my blog post ... オークリー サングラス

Anonymous said...

Quality posts is the crucial to attract the viewers to visit the
web site, that's what this web page is providing.

Also visit my page :: プラダ アウトレット

Anonymous said...

If some one desires expert view about blogging afterward i recommend him/her
to visit this website, Keep up the pleasant job.

Here is my page ... プラダ バッグ

Anonymous said...

For hottest information you have to pay a quick visit internet and
on internet I found this web site as a best site for hottest updates.


Here is my website 時計コピー

Anonymous said...

I am not sure where you are getting your information, but great topic.
I needs to spend some time learning more or understanding more.
Thanks for excellent info I was looking for this information for
my mission.

My webpage :: オークリー ゴーグル

Anonymous said...

Heya i'm for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and aid others like you aided me.

Also visit my web blog :: ロレックスコピー

Anonymous said...

What i do not realize is in reality how you're not actually a lot more well-liked than you may be right now. You are so intelligent. You recognize thus considerably with regards to this matter, made me in my view imagine it from so many numerous angles. Its like women and men aren't involved
except it's something to accomplish with Girl gaga! Your personal stuffs nice. At all times handle it up!

Also visit my website http://hakansunnliden.blogspot.com/

Anonymous said...

Greate article. Keep writing such kind of information on your site.
Im really impressed by it.
Hello there, You've done a great job. I will definitely digg it and individually recommend to my friends. I'm sure they'll be benefited from this website.

Feel free to surf to my blog post - オークリーメガネ

Anonymous said...

Thanks for sharing your thoughts about ロレックススーパーコピー.

Regards

Take a look at my web site: ロレックスレプリカ

Anonymous said...

If you desire to improve your knowledge only keep visiting this web page and be updated with the most recent information posted here.


my blog: www.rolexsale-shop.com

Anonymous said...

Hello there I am so glad I found your site, I really found you by mistake, while I was researching on Yahoo for something else, Anyways I
am here now and would just like to say thanks for
a marvelous post and a all round thrilling blog (I also love the theme/design), I don’t have time to
look over it all at the moment but I have book-marked it and also
added in your RSS feeds, so when I have time I will be back to read more, Please
do keep up the great b.

My page: オークリー アウトレット

Anonymous said...

Simply want to say your article is as astonishing.

The clarity in your post is simply excellent and i
could assume you're an expert on this subject. Fine with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please carry on the rewarding work.

Also visit my blog ... http://www.oakleyfreeshipping.com/

Anonymous said...

Hey I know this is off topic but I was wondering if
you knew of any widgets I could add to my blog that
automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

Feel free to surf to my web-site: サングラス オークリー

Anonymous said...

Heya i am for the primary time here. I found this board and I to find It truly helpful
& it helped me out a lot. I'm hoping to offer something again and aid others like you helped me.

My weblog - レイバン ゴーグル

Anonymous said...

Hey! I know this is kinda off topic nevertheless I'd figured I'd ask.

Would you be interested in exchanging links or maybe guest authoring a
blog article or vice-versa? My blog discusses a lot of the same topics as yours and I feel we could greatly benefit from each other.
If you happen to be interested feel free to shoot me an email.
I look forward to hearing from you! Wonderful blog by the way!


Here is my blog post fake ray ban sunglasses
my site - fake ray bans

Anonymous said...

If some one desires to be updated with latest technologies
therefore he must be pay a quick visit this site and be up to date
everyday.

My web site Nike Air Max 90

Anonymous said...

A fascinating discussion is worth comment. I think that you need to write
more about this issue, it may not be a taboo subject but usually folks
don't speak about such issues. To the next! Cheers!!

Take a look at my homepage :: cheap mac makeup

Anonymous said...

Wow, fantastic weblog structure! How long have you ever been blogging for?
you made running a blog glance easy. The entire look of your site is magnificent,
as smartly as the content!

Look into my web-site - roundtableprojectmanagement.blogspot.com

Anonymous said...

Informative article, totally what I needed.

My web page - レイバンメガネ

Anonymous said...

Aw, this was a very good post. Taking a few minutes and actual effort to produce a great
article… but what can I say… I put things off a whole lot and never manage to get nearly
anything done.

Also visit my weblog :: レイバン

Anonymous said...

Turn your mobile phone into an extraordinary gadget with LED Black - Berry apps.
The contacts are arranged in alphabetical order making it hassle-free
going over the contact list. However, my husband
had a little trouble tightening the screw on the solar
panel, so it tended to slip to less than an optimal angle.


Here is my homepage; LED Tischeleuchten

Anonymous said...

Good blog post. I definitely appreciate this site. Stick with it!


Have a look at my website :: fake oakleys

Anonymous said...

Generally I do not read post on blogs, however I wish to say that
this write-up very pressured me to take a look at and do so!
Your writing style has been surprised me. Thank you, quite nice article.


My website :: Fake Ray Bans Wayfarer

Anonymous said...

Aw, this was an incredibly nice post. Finding the
time and actual effort to make a really good article… but what can
I say… I put things off a lot and don't seem to get anything done.

Check out my webpage ... cheap mac cosmetics

Anonymous said...

Thanks a bunch for sharing this with all folks
you actually recognize what you're talking approximately! Bookmarked. Kindly additionally consult with my site =). We may have a link alternate contract between us

My page ... Jeremy Scott Adidas

Anonymous said...

Hi there! Someone in my Myspace group shared this website with us so I came to look it over.
I'm definitely enjoying the information. I'm book-marking and will be tweeting this to my followers!
Excellent blog and outstanding design.

Here is my page Cheap Ray Bans

Anonymous said...

For hottest news you have to pay a visit internet and on internet I found this web site as a finest web page for hottest updates.


Here is my blog post: Polo Ralph Lauren Factory Store

Anonymous said...

It is truly a nice and helpful piece of info. I am
glad that you simply shared this helpful info with us.
Please keep us informed like this. Thank you for sharing.


Take a look at my webpage :: cheap ralph lauren polo

Anonymous said...

It's appropriate time to make a few plans for the longer term and it's time to be happy.

I have learn this submit and if I could I wish
to counsel you few attention-grabbing issues or suggestions.
Perhaps you could write subsequent articles referring to this
article. I want to read even more issues about it!


my weblog cheap ralph lauren polo

Anonymous said...

I really love your site.. Very nice colors & theme.
Did you build this web site yourself? Please reply back as I'm looking to create my very own blog and would like to know where you got this from or just what the theme is called. Thank you!

Here is my blog post ... supra vaiders

Anonymous said...

Hey! Do you know if they make any plugins to assist with
SEO? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good results.
If you know of any please share. Many thanks!

My weblog :: レイバンメガネ

Anonymous said...

You really make it appear so easy along with
your presentation however I in finding this matter to be actually something which I feel
I would by no means understand. It kind of feels too complex and very
large for me. I'm having a look forward on your next put up, I'll try to get the grasp of it!


Look at my web blog :: teen xxx porn

Anonymous said...

What i do not understood is in reality how you're now not really a lot more well-favored than you may be right now. You are very intelligent. You realize thus significantly relating to this topic, produced me personally believe it from numerous varied angles. Its like men and women aren't
interested except it's something to accomplish with Woman gaga! Your personal stuffs excellent. All the time care for it up!

Here is my web-site; first time anal videos

Staffan said...

It looks like the code is cut off so perhaps you should try to make sure the full length of the rows is included.

It may also be an idea to try to clear out all the spam comments.