File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes GWT and the fly likes GWT and creation of own widgets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "GWT and creation of own widgets" Watch "GWT and creation of own widgets" New topic

GWT and creation of own widgets

Ulrich Vormbrock
Ranch Hand

Joined: Apr 15, 2010
Posts: 73

I'm actually trying to write an own widget, enabling to realize a kind of "tabbed panel" based on HTML list (<ul> and <li>).
Besides, no enclosing <div> should be generated - opposed to the most GWT widgets.

The background is that I want to integrate my widget into a css framework: as soon as an enclosing <div> comes into play, the whole widget is not displayed correctly.

I've just tried to write an own Widget class, looking like this:

The problem is that the widget from outside (for example HTML) has an enclosing <div>, thus destroying my design.
The add-Method (line 31, from ComplexPanel class) only takes a Widget as first argument, not an Element - so it seems to be unpossible to get rid of the <div>, doesn't it?

Or maybe there is a more elegant way to generate own widgets, bypassing the enclosing <div> tags?

In any case, my final output should look like this:

Any ideas?

SCJP 6 (88%), SCWCD (89%)
Rudradutt Joshi
Ranch Hand

Joined: Dec 06, 2008
Posts: 45

Are you planning to use javascript to modify the div you are creating?
I agree. Here's the link:
subject: GWT and creation of own widgets
It's not a secret anymore!