Page 2 of 2
Re: Table field and listStyle
Posted: Sun Nov 29, 2020 5:55 am
by stam
And more weirdness:
Every time i click into the field, it adds a line of code within the first <li>, below the text of the first list item. This is what happens when i click on 3 times in
any line in the text -- it adds empty lines
only below the
first list item:
Code: Select all
<li>
<p>xxx</p>
<p>		 </p>
<p>		 </p>
<p>		</p>
</li>
And i don't know what html entity
	 is meant to represent - i can't find reference to this online...
Re: Table field and listStyle
Posted: Sun Nov 29, 2020 7:07 am
by FourthWorld
	 is the character entity for tab.
Re: Table field and listStyle
Posted: Sun Nov 29, 2020 7:20 am
by stam
FourthWorld wrote: Sun Nov 29, 2020 7:07 am
	 is the character entity for tab.
Thanks Richard - hardly ever use it as in normal html it collapses into a single space unless enclosed in a <pre></pre> block, so I blanked that completely; thanks for reminding me. I always use this as ascii 9 in code, should have realised...
The question still remains however why it keeps adding blank lines (well, with 2 tabs) under the first list item no matter where I click in the field... just weird...
Re: Table field and listStyle
Posted: Sun Nov 29, 2020 3:54 pm
by FourthWorld
Hard to say exactly what's happening with the blank lines without knowing exactly what's being typed there, but if it happens after typing a return maybe it's because the list tags already have returns inserted between since of the tags.
In short, I believe that once we fix the htmltext part of this the blank lines will go away with it.
I never use the table object myself, as there's another problem there with the metrics on Linux, where the editing field overlaps the right and bottom edges. I've been tempted to fix that, but I do rarely need spreadsheet behavior in my apps I just haven't had the time; last time I needed an editable grid it was for a small number of rows and columns and just easier to use fields.
Re: Table field and listStyle
Posted: Sun Nov 29, 2020 7:35 pm
by stam
No typing... happens when i just click in the field.
In the example above - populate the field with xxx/yyy/zzz and use listStyle to adorn the fields.
When I then click in this, not only does it covert to html, but every time i click in the field, it adds blank rows under the first item -- every click.
Hurts my brain to figure this out so i've jut quit and i'll wait until the html fix is in - for now have reverted to simple fields
Re: Table field and listStyle
Posted: Sun Nov 29, 2020 7:47 pm
by FourthWorld
Simple fields are usually all that's needed for working with list-style paragraphs, so you should be fine.
Does Excel offer list-style paragraphs?
Re: Table field and listStyle
Posted: Sun Nov 29, 2020 7:49 pm
by stam
FourthWorld wrote: Sun Nov 29, 2020 7:47 pm
Simple fields are usually all that's needed for working with list-style paragraphs, so you should be fine.
Does Excel offer list-style paragraphs?
Sure - it will work. I've already implemented similar in other environments in older versions of this complex app.
In those versions i processed the text to add enumeration to each line which i know i can do in LC as well, was just hoping i wouldn't have to... (lazy, i know...)
Re: Table field and listStyle
Posted: Sun Nov 29, 2020 10:08 pm
by jacque
I was able to get rid of the htmltext by adjusting the isHTML() function with a blunt-edged hack. The real fix would be to change the paragraphTagRegex() function to return "true" for list fields but my regex isn't good enough to figure that out. At any rate, if you can get isHTML() to return true for list fields, the display is fixed.
But it goes much deeper than that. When you click a line in the (now fixed) text the temp field that is created always has a line number of 1. That's because there are no fixed line numbers and the <ol> tag will use 1 as the first list item. The table field scripts are more complex than I have time to track and fix.
However, if someone can provide regex to allow for lists, and you change your script to use specific numbers instead of auto-generated ones, then I think it will work. Here is the regex that needs to be updated to include list tags:
Code: Select all
private function paragraphTagRegex
return "<p( [a-zA-Z0-9]+=" & quote & "[a-zA-Z0-9]+" & quote & ")*>"
end paragraphTagRegex