Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364409 - Need to allow link to be clickable, but not change page
Summary: Need to allow link to be clickable, but not change page
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: lu lu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 14:03 EST by Will Smythe CLA
Modified: 2017-02-23 14:19 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Will Smythe CLA 2011-11-21 14:03:31 EST
It's very common in modern RIAs to use links for navigation within an application. This does not mean the link navigates to a different URL, but instead launches a dialog, shows a new UI, etc within the app. 

Currently, the only way to make this work in RUI is to set the href to "#" and use an onClick event handler. The problem with # is that it potentially messes up the URL if hash tags are being used for history. onClick is not sufficient because this means the user must click (with their mouse) the link vs. using their keyboard.

There needs to be a way to run an event handling function for a link without being forced to set a href. For example:

link Hyperlink { text = "Open results", onLinkSelected ::= runme };

...

function runme(e Event in)

end

===========

Note: onLinkSelected may not be the best name, but something like it. If it's set, the value of the "href" field will have no impact (i.e. it will be ignored).
Comment 1 Tony Chen CLA 2011-12-28 02:02:38 EST
I did some little experiment, it seems onClick event can be triggered by keyboard as well. 

If the onClick event (in JavaScript) returns false, the Hyperlink did not actually navigate. The problem is that EGL delegates for EventHandler does not support return types.