[Laszlo-user] Hyperlink with onclick?

P T Withington ptw at pobox.com
Sun Sep 28 09:11:39 PDT 2008


Well, David says it's not 'hyper' (it doesn't take you to another  
document), I say it's not 'link' (it's not a link to anything).  It  
creates an area of text that will send an event when clicked.  I  
appreciate this is nifty new functionality, I'm just asking that we  
step back a minute and think about the best UI and how to name and  
document it, so we don't regret it down the road.

The message that started this thread was trying to say (something like):

<a href="javascript:...">...</a>

The other way of saying this in html would be something like:

<span onclick="...">...</span>

Both of those take out the intermediate step that the current  
interface has, where you have to assign an ID to the active text and  
then you have to dispatch from the text click event based on ID to the  
action you want.  I wonder if we want this ID mechanism exposed, or if  
we want a higher-level interface?

On 2008-09-27, at 22:04EDT, Henry Minsky wrote:

> For lack of a better name, I went with the name that Flex assigned  
> to the
> event,  their event is called TextEvent.LINK, so I called ours  
> "ontextlink".
>
>
>
> On Sat, Sep 27, 2008 at 9:41 PM, David Temkin <temkin at laszlosystems.com 
> >wrote:
>
>> It's confusing, I think, to call these hyperlinks since they are  
>> custom
>> actions. There are better ways to do conventional hyperlinks.
>> "MakeClickableText"? or something.
>>
>>
>> On Sep 27, 2008, at 12:02 PM, P T Withington wrote:
>>
>> I wonder if you should call it makeHyperlink and onhyperlink instead?
>>>
>>> On 2008-09-27, at 13:35EDT, Henry Minsky wrote:
>>>
>>> The use case I'm trying to support is making hyperlinks in your text
>>>> fields
>>>> that perform custom actions local to the current application.Such  
>>>> as
>>>> clicking on something in the debugger window and having it perform
>>>> Debug.inspect() of the object.
>>>>
>>>>
>>>>
>>>> On Sat, Sep 27, 2008 at 1:29 PM, David Temkin <temkin at laszlosystems.com
>>>>> wrote:
>>>>
>>>> Wait a sec.... Isn't the <a> tag, with the normal usage of the href
>>>>> attribute, supported within text fields -- even in Flash?
>>>>> Now, href doesn't work within the <view> tag, and <a> doesn't work
>>>>> anywhere
>>>>> but inside of <text>, but that's another story.
>>>>>
>>>>> Not that what you've done isn't useful -- but I don't think it's  
>>>>> needed
>>>>> in
>>>>> the normal case (click to link to another page).
>>>>>
>>>>> On Sep 27, 2008, at 6:26 AM, Henry Minsky wrote:
>>>>>
>>>>> Hello,
>>>>> The function to respond to a hyperlink is currently platform- 
>>>>> dependent,
>>>>> although just a few days ago
>>>>> I added a cross-platform mechanism to the LFC. That is available  
>>>>> only if
>>>>> you run a nightly build at the moment.
>>>>>
>>>>> If you look at the implementation, the actual mechanism for  
>>>>> Flash 8
>>>>> applications is to use the syntax <a  
>>>>> href="asfunction:funcname,arg">,
>>>>> whereas for DHTML is it to use "javascript:somescript" for target.
>>>>>
>>>>> The new API is to call LzText.makeTextLink, which returns a  
>>>>> string of
>>>>> the
>>>>> form "<a href=...>displayed value</a>" which you can append to the
>>>>> content
>>>>> of your LzText field. When clicked, it sends a "ontextlink"  
>>>>> event back
>>>>> to
>>>>> the LzText object, with the value you choose.
>>>>>
>>>>> /**
>>>>> * Return a string which can be used to insert a hyperlink in a  
>>>>> text
>>>>> field.
>>>>> * @param String str: The text displayed in the hyperlink.
>>>>> * @param String value: The value returned when the link is  
>>>>> clicked.
>>>>> * @access public
>>>>> The text returned by makeTextLink can be appended to the text of a
>>>>> text field. It will make an HTML-style anchor, and will have a
>>>>> displayed representation of the string STR. When clicked, the  
>>>>> link will
>>>>> send an ontextlink event to the text view, with a value of VALUE.
>>>>> */
>>>>> public function makeTextLink(str, value) {
>>>>> return this.sprite.makeTextLink(str,value);
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Sep 26, 2008 at 11:29 PM, cyril alias lyric <
>>>>> lyric680-web at yahoo.de
>>>>>
>>>>>> wrote:
>>>>>>
>>>>>
>>>>> Hello,
>>>>>>
>>>>>> how to define an hyperlink that throws an
>>>>>> onclick-event?
>>>>>>
>>>>>> I'd like to have the same behaviour as for buttons:
>>>>>> <button onclick="doSomething();" />
>>>>>>
>>>>>> If possible, what is the correct syntax.
>>>>>> I tried
>>>>>> <a href="" onclick="doSomething();">Link</a>
>>>>>> without success.
>>>>>>
>>>>>> Cheers,
>>>>>> lyric
>>>>>>
>>>>>>
>>>>>>
>>>>>> __________________________________________________
>>>>>> Do You Yahoo!?
>>>>>> Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden
>>>>>> Schutz
>>>>>> gegen Massenmails.
>>>>>> http://mail.yahoo.com
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Henry Minsky
>>>>> Software Architect
>>>>> hminsky at laszlosystems.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> Henry Minsky
>>>> Software Architect
>>>> hminsky at laszlosystems.com
>>>>
>>>
>>>
>>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com




More information about the Laszlo-user mailing list