[Laszlo-user] Hyperlink with onclick?

David Temkin temkin at laszlosystems.com
Sat Sep 27 10:37:40 PDT 2008


Right, that makes perfect sense and is useful.


On Sep 27, 2008, at 10:35 AM, 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
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20080927/bd16e184/attachment.html


More information about the Laszlo-user mailing list