I run it with "Tools - run Scripts of the selected node" - both text and detailsText are written. Then I close and save the mm. I open the mm again - only the text is displayed, the detailsText is empty.
When I write a detailsText with usual commands (F3, Ctrl+F3), is is saved and reopened with problems.
Where or what is the difference?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As Luigi pointed out, node.setDetailsText() expects HTML as an argument. node.setDetails() on the other hand provides conversion. The lowlevel access method setDetailsText() is important to set the details exactly but it's a bit more difficult to use.
Of course it's not satisfying that the details text is not saved although it seemingly displays correctly. I am not sure what to do:
throw an exception if non-html is handed to setDetailsText()?
extend the description of setDetailsText() with a warning?
I am also worried about the fact that people thouroughly trying to take up scripting miss to find the API documentation - do you have suggestions for that, too?
Sorry for replying so late.
Volker
Last edit: Volker Börchers 2018-01-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
About API documentation: I believe that in those API methods if a simple
explanation could br added with example, it would already steer most people
in the right direction and minimize possible confusion.
Of course it's not satisfying that the details text is not saved although
it seemingly displays correctly. I am not sure what to do:
throw an exception if non-html is handed to setDetailsText()? * extend
the description of setDetailsText() with a warning?
I am also worried about the fact that people thouroughly trying to take up
scripting miss to find the API documentation - do you have suggestions for
that, too?
I have this script, added to a node:
I run it with "Tools - run Scripts of the selected node" - both text and detailsText are written. Then I close and save the mm. I open the mm again - only the text is displayed, the detailsText is empty.
When I write a detailsText with usual commands (F3, Ctrl+F3), is is saved and reopened with problems.
Where or what is the difference?
It has to be a HTML string, see this thread for details.
https://sourceforge.net/p/freeplane/discussion/758437/thread/5729a4cc/
Actually you could use
node.details = "Keine Datei(def)"
Please test it and report how it works.
But I am confused by too, so we should think about what to do with node.detailsText = "Keine Datei(def)" and if we should fix it too.
Regards,
Dimirty
Thanks to both. I will try with "node.details" ..
@Dimitry
my question is a side-effect of myvery first code here:
https://sourceforge.net/p/freeplane/discussion/758437/thread/4fef1f94/
There you can check if the code does something wrong or if the software has to be checked.
As Luigi pointed out, node.setDetailsText() expects HTML as an argument. node.setDetails() on the other hand provides conversion. The lowlevel access method setDetailsText() is important to set the details exactly but it's a bit more difficult to use.
Of course it's not satisfying that the details text is not saved although it seemingly displays correctly. I am not sure what to do:
I am also worried about the fact that people thouroughly trying to take up scripting miss to find the API documentation - do you have suggestions for that, too?
Sorry for replying so late.
Volker
Last edit: Volker Börchers 2018-01-21
About API documentation: I believe that in those API methods if a simple
explanation could br added with example, it would already steer most people
in the right direction and minimize possible confusion.
Just an opinion
On 21 Jan 2018 21:45, Volker Börchers boercher@users.sf.net wrote: