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 开发者_JAVA技巧dialog box there.Please suggest me the solution for this problem.
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
.
I concur with Hilbrand, but recommend anchor tags in such cases.
<g:Anchor name="whatever">Click me</g:anchor>
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.
精彩评论