[Laszlo-dev] Modifying someView.sprite.__LZdiv.innerHTML

P T Withington ptw at pobox.com
Thu Aug 20 17:56:03 PDT 2009


sprites are the kernel internel API.

If you want a supported API, you need to talk to the view.

It sounds to me like what you really want is a new LZX tag that is  
<div>, lighter weight than <html>, but might only work in DHTML runtime.

On 2009-08-20, at 18:10EDT, Raju Bitter wrote:

> Her'es another question:
>
> it seems like:
>
> someView.getMCRref().innerHTML
>
> works as well as
>
> someView.sprite.getMCRef().innerHTML
>
> And looking into the code I discover, that LaszloView#getMCRef just  
> does:
> function getMCRef () :* { return this.sprite.getMCRef(); }
> Any reason for doubling that behavior?
> - Raju
>
> On Aug 21, 2009, at 12:02 AM, Max Carlson wrote:
>
>> There is the view.getMCRef() method which returns a reference to  
>> the view's div (or movieclip if you're in Flash).  It's expedient,  
>> but dangerous - so your mileage may vary!
>>
>> I filed an improvement request to give this method a better name:
>> http://jira.openlaszlo.org/jira/browse/LPP-8400
>>
>> Raju Bitter wrote:
>>> I don't agree. Modifying innerHTML of DIVs is really valuable for  
>>> mixed runtime applications, or components which are re-used across  
>>> runtimes (Flash Google maps and Ajax Google Maps, for example).
>>> Using iFrames adds complexity in such a case. But you are right,  
>>> poking at internals is never safe, but in this case, adds some  
>>> fun. :-)
>>> Honestly, the more important DHTML runtime becomse, the greater is  
>>> the need for simple DOM modification inside OpenLaszlo apps. @Max:  
>>> what do you think?
>>> - Raju
>>> On Aug 20, 2009, at 10:46 PM, P T Withington wrote:
>>>> You're poking at internals here, so all bets are off.
>>>>
>>>> Obviously, you are free to do so, because it's open source, but  
>>>> the sprite API is an internal API.
>>>>
>>>> What's wrong with the <html> tag, which is the supported way to  
>>>> embed html in LZX?  It would be better to improve that to meet  
>>>> your needs, if possible.
>>>>
>>>> On 2009-08-20, at 16:33EDT, Raju Bitter wrote:
>>>>
>>>>> There as a question in the forum on how you can attach custom  
>>>>> HTML code to a view, not using the HTML tag.
>>>>> http://forum.openlaszlo.org/showthread.php?p=45147&posted=1#post45147
>>>>>
>>>>> I suggested to do:
>>>>>
>>>>> <canvas proxied="true">
>>>>>
>>>>>   <view id="targetview" width="320" height="260" />
>>>>>       <handler name="oninit">
>>>>>       <![CDATA[
>>>>>       var player="<embed type='application/x-shockwave-flash'  
>>>>> src='http://videodetective.net/flash/players/player4.3.132.swf?customerid=120000&publishedid=88 
>>>>>  8439&playerid=69&pversion=4&playlistid=0&videokbra  
>>>>> te=750&sub=&debug=' pluginspage='http://www.macromedia.com/go/getflashplayer' 
>>>>>  allowScriptAccess='always' flashvars='allowFullScreen=true'  
>>>>> allowfullscreen='true' height='260' width='320'></embed>";
>>>>>       targetview.sprite.__LZdiv.innerHTML = player;
>>>>>       Debug.write(targetview.sprite.__LZdiv);
>>>>>       ]]>
>>>>>   </handler>
>>>>>
>>>>> </canvas>
>>>>>
>>>>> Is that something which should be done? Seems to work...
>>>>>
>>>>> - Raju
>>>>
>>
>> -- 
>> Regards,
>> Max Carlson
>> OpenLaszlo.org
>



More information about the Laszlo-dev mailing list