Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364409

Summary: Need to allow link to be clickable, but not change page
Product: z_Archived Reporter: Will Smythe <smythew>
Component: EDTAssignee: lu lu <lulu>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: chenzhh, mayunf
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.