geetha
geetha

Reputation: 1

GWT hyperlink problem

i am using GWT Hyperlink for Click handling.I used rpc for showing the records in a dialog box by clicking on that link.but it is moving to home page immediately and showing the dialog box there.Please suggest me the solution for this problem.

Upvotes: 0

Views: 484

Answers (3)

Hilbrand Bouwkamp
Hilbrand Bouwkamp

Reputation: 13519

Hyperlink should be used in combination with History (http://code.google.com/intl/nl-NL/webtoolkit/doc/latest/DevGuideCodingBasicsHistory.html) changes and not for click handling alone. When using Hyperlink the History token is updated, which will probably trigger the History change which will direct to the homepage, Next the click is handled which shows the dialog

EDIT: Just as David mentions it's better to use the Anchor widget. Because Anchor is a native html element A, it's usability is better over using a span or div.

Upvotes: 3

DonX
DonX

Reputation: 16369

For this case I would suggest you to use CustomButton instead of HypherLink. For that custom button give some styles to look like a hypherlink. If you use label you cannot focus using keyboard.

Use hypherlink only if you are planning to give history support.

Upvotes: 0

David
David

Reputation: 5214

I concur with Hilbrand, but recommend anchor tags in such cases.

<g:Anchor name="whatever">Click me</g:anchor>

Upvotes: 2

Related Questions