[Pas2js] How to change a div (or othe widget) content

Luca Olivetti luca at ventoso.org
Tue Oct 4 14:33:46 CEST 2022


El 4/10/22 a les 9:59, Luca Olivetti via Pas2js ha escrit:
> El 4/10/22 a les 9:52, Michael Van Canneyt ha escrit:
>>
>>
>> On Tue, 4 Oct 2022, Luca Olivetti via Pas2js wrote:
>>
>>> El 3/10/22 a les 17:35, Michael Van Canneyt via Pas2js ha escrit:
>>>
>>>>
>>>> I have changed this.
>>>>
>>>> I have also added TextMode as a property so you can choose between 
>>>> InnerText
>>>> and InnerHTML
>>>
>>>
>>> Unfortunately you left out the "if FTextContent<>''" which broke my 
>>> page (it empties a div hence later it doesn't find the element that 
>>> were there).
>>
>> I understood from your original mail that you wanted that particular 
>> part gone ?
> 
> I must have expressed myself poorly, I just wanted a way to modify the 
> content, i.e. what you did in a later commit
> 
> https://gitlab.com/freepascal.org/fpc/pas2js/-/commit/ad8c36e807de50be099dd0bf16e346fd21b0edc9 
> 
> 
>>
>> I reinstated it.
> 
> Thank you.


Aagh, now I see where the confusion came from: in one message I told 
that, if I assign and empty content, the element would keep the old one, 
so you removed the check, but then when I create the widget it would 
empty the content that it got from the html.
I guess I can't have my cake and eat it too, unless you could 
differentiate the two cases (i.e. initial assignment, when you just got 
the element from the html, and subsequent assignments).

Bye
-- 
Luca


More information about the Pas2js mailing list