tbody creation missing from javascript creation functions?

Grepping around, I see functions for table creation / manipulation in the javascript DOM stuff, but nothing for the tbody tag. Is this because it's missing from the IRL DOM specification, or a bug, or what? Should I add functionality for creating this tag myself, or is it easier to fix the generated haskell? I ask because the place where I want to use this javascript from haskell stuff should be making a tbody embedded in a div that is smaller than the tbody; in modern browsers renders as a table with scrollbars. Thanks, thomas. thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>grep -irl mkTable * | grep .hs HTMLTableColElement.hs HTMLTableElement.hs HTMLTableSectionElement.hs Html.hs_unsplit thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>grep -irl tbody * | grep .hs thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>cd ..

When I broaden the grep to
tbod
instead, I get a hit for HTMLTableElements.hs.
This has functions
set'tHead, get'tHead
along with various other set/get combos, but only
get'tBodies
-- no set here.
Is there some logic to what gets both a set and a get, and what gets just a get?
Also, is there an easy way for me to manipulate the attributes, for
example "height" for a particular tag/dom element?
How about functionality for setting an element's position /
dimensions, analogous to setElementPosition / setElementDimensions in
mochikit (which I'm using now).
http://www.mochikit.com/doc/html/MochiKit/DOM.html
Thanks, thomas.
2007/12/4, Thomas Hartman
Grepping around, I see functions for table creation / manipulation in the javascript DOM stuff, but nothing for the tbody tag.
Is this because it's missing from the IRL DOM specification, or a bug, or what? Should I add functionality for creating this tag myself, or is it easier to fix the generated haskell?
I ask because the place where I want to use this javascript from haskell stuff should be making a tbody embedded in a div that is smaller than the tbody; in modern browsers renders as a table with scrollbars.
Thanks, thomas.
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>grep -irl mkTable * | grep .hs HTMLTableColElement.hs HTMLTableElement.hs HTMLTableSectionElement.hs Html.hs_unsplit
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>grep -irl tbody * | grep .hs thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>cd ..

(partial) answer...
http://www.haskell.org/haskellwiki/Yhc/Javascript/Programmers_guide/Up_from_...
in section "12 Getting and setting properties" seems close to what I want.
I still don't understand this well enough to use though...
t.
2007/12/4, Thomas Hartman
When I broaden the grep to
tbod
instead, I get a hit for HTMLTableElements.hs.
This has functions
set'tHead, get'tHead
along with various other set/get combos, but only
get'tBodies
-- no set here.
Is there some logic to what gets both a set and a get, and what gets just a get?
Also, is there an easy way for me to manipulate the attributes, for example "height" for a particular tag/dom element?
How about functionality for setting an element's position / dimensions, analogous to setElementPosition / setElementDimensions in mochikit (which I'm using now).
http://www.mochikit.com/doc/html/MochiKit/DOM.html
Thanks, thomas.
2007/12/4, Thomas Hartman
: Grepping around, I see functions for table creation / manipulation in the javascript DOM stuff, but nothing for the tbody tag.
Is this because it's missing from the IRL DOM specification, or a bug, or what? Should I add functionality for creating this tag myself, or is it easier to fix the generated haskell?
I ask because the place where I want to use this javascript from haskell stuff should be making a tbody embedded in a div that is smaller than the tbody; in modern browsers renders as a table with scrollbars.
Thanks, thomas.
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>grep -irl mkTable * | grep .hs HTMLTableColElement.hs HTMLTableElement.hs HTMLTableSectionElement.hs Html.hs_unsplit
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>grep -irl tbody * | grep .hs thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>cd ..

Thomas,
On Dec 4, 2007 8:40 PM, Thomas Hartman
Is there some logic to what gets both a set and a get, and what gets just a get?
If IDL says an attribute is readonly then only get. If not, then set and get.
Also, is there an easy way for me to manipulate the attributes, for example "height" for a particular tag/dom element?
If this is a DOM attribute, use set'height. If this is a style attribute, see below.
How about functionality for setting an element's position / dimensions, analogous to setElementPosition / setElementDimensions in mochikit (which I'm using now).
Mochikit probably has some wrappers around CSS to work cross browser. If you would like to manipulate styles directly, use "inlineStyle" function first (see CDOM/Level2/DomUtils.hs), then use setters and getters on the TCSS2Properties object. inlineStyle inp (set'borderWidth "0px") $ \_ -> Nice thing about setters, you may chain them together: inlineStyle inp (set'borderWidth "0px") (set'fontSize "14pt") $ \_ -> But then you need to remember how different browsers name same attributes (note that EchoCPS2 is not colored correctly in MSIE, while in FF it is green on black - correct coloring).
I wish Mochikit had any IDL specs for their interfaces (or perhaps some XML which with medium amount of pain might be converted to IDL). Is there any? Thank you. -- Dimitry Golubovsky Anywhere on the Web

Okay I'm beginning to get this.
Also, as to my question earlier about where to set styles I see this is in
CDOM/Level2/DomUtils.hs
I was looking in Level1, and that (you might me privately) is Wrong.
All the stuff that matters, and that is being developed is in under Level2.
thomas.
2007/12/4, Dimitry Golubovsky
Thomas,
On Dec 4, 2007 8:40 PM, Thomas Hartman
wrote: Is there some logic to what gets both a set and a get, and what gets just a get?
If IDL says an attribute is readonly then only get. If not, then set and get.
Also, is there an easy way for me to manipulate the attributes, for example "height" for a particular tag/dom element?
If this is a DOM attribute, use set'height. If this is a style attribute, see below.
How about functionality for setting an element's position / dimensions, analogous to setElementPosition / setElementDimensions in mochikit (which I'm using now).
Mochikit probably has some wrappers around CSS to work cross browser.
If you would like to manipulate styles directly, use "inlineStyle" function first (see CDOM/Level2/DomUtils.hs), then use setters and getters on the TCSS2Properties object.
inlineStyle inp (set'borderWidth "0px") $ \_ ->
Nice thing about setters, you may chain them together:
inlineStyle inp (set'borderWidth "0px") (set'fontSize "14pt") $ \_ ->
But then you need to remember how different browsers name same attributes (note that EchoCPS2 is not colored correctly in MSIE, while in FF it is green on black - correct coloring).
I wish Mochikit had any IDL specs for their interfaces (or perhaps some XML which with medium amount of pain might be converted to IDL). Is there any?
Thank you.
-- Dimitry Golubovsky
Anywhere on the Web

Thomas, Would the get'tBodies function be of any help?
======================
tBodies of type HTMLCollection, readonly
Returns a collection of the table bodies (including implicit ones).
.....
insertRow modified in DOM Level 2
Insert a new empty row in the table. The new row is inserted
immediately before and in the same section as the current indexth row
in the table. If index is -1 or equal to the number of rows, the new
row is appended. In addition, when the table is empty the row is
inserted into a TBODY which is created and inserted into the table.
======================
So, when you first call insertRow, TBODY is created. Then you call
get'tBodies and I think at the index 0, you'll get the TBODY you need.
Correct?
On Dec 4, 2007 8:12 PM, Thomas Hartman
Grepping around, I see functions for table creation / manipulation in the javascript DOM stuff, but nothing for the tbody tag.
Is this because it's missing from the IRL DOM specification, or a bug, or what? Should I add functionality for creating this tag myself, or is it easier to fix the generated haskell?
I ask because the place where I want to use this javascript from haskell stuff should be making a tbody embedded in a div that is smaller than the tbody; in modern browsers renders as a table with scrollbars.
Thanks, thomas.
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>grep -irl mkTable * | grep .hs HTMLTableColElement.hs HTMLTableElement.hs HTMLTableSectionElement.hs Html.hs_unsplit
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>grep -irl tbody * | grep .hs thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js/lib/haskell/DOM/Level1>cd ..
-- Dimitry Golubovsky Anywhere on the Web
participants (2)
-
Dimitry Golubovsky
-
Thomas Hartman