开发者

GWT hyperlink problem

开发者 https://www.devze.com 2023-02-03 08:54 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消