Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
table element
kajjubee
Hi
Does anyone have code snippet for populating the table element in a dct where they can choose to insert rows/ columns without any presentation. I would like an alternative to VF. Thanks
Find more posts tagged with
Comments
iwovGraduate
Not sure what you mean by "table element in a dct" -- can you explain a little ?
An alternative to VF without WISYWIG would be to use <textarea> tag without VF options.
Drew_The_Goat
Funny, I currently am trying to create a set of table entry fields for a DCT that will allow a user to add table content but have it saved as XML structures (an XSL will later convert the XML to HTML).
This is super basic, but I used a fixed number of columns and variable amount of rows- it writes to XML crean enough:
<!--TABLE SECTION-->
<container combination="and" max="5" min="0" name="table" location = "content/table">
<label>Table</label>
<container combination="and" max="20" min="0" name="row" location = "row">
<label>Row</label>
<item name="Table Column1" pathid ="content/table/row/column1" >
<label>Col 1</label>
<text size="10" maxlength="50" rowcontinue="t"/>
</item>
<item name="Table_Column2" pathid ="content/table/row/column2" >
<label>Col 2</label>
<text size="10" maxlength="50" rowcontinue="t" />
</item>
<item name="Table_Column3" pathid ="content/table/row/column3" >
<label>Col 3</label>
<text size="10" maxlength="50" rowcontinue="t"/>
</item>
<item name="Table_Column4" pathid ="content/table/row/column4" >
<label>Col 4</label>
<text size="10" maxlength="50" rowcontinue="t"/>
</item>
<item name="Table_Column5" pathid ="content/table/row/column5" >
<label>Col 5</label>
<text size="10" maxlength="50" rowcontinue="t"/>
</item>
<item name="Table_Column6" pathid ="content/table/row/column6" >
<label>Col 6</label>
<text size="10" maxlength="50" rowcontinue="t" />
</item>
<item name="Table_Column7" pathid ="content/table/row/column7" >
<label>Col 7</label>
<text size="10" maxlength="50" rowcontinue="t"/>
</item>
<item name="Table_Column8" pathid ="content/table/row/column8" >
<label>Col 8</label>
<text size="10" maxlength="50" />
</item>
</container>
</container>
<!--TABLE SECTION END-->
Here is a sample of the XML output:
<table>
- <row>
<column1>bfs</column1>
<column2>bs</column2>
<column3>bf</column3>
<column4>bsdf</column4>
<column5>asd</column5>
<column6>afas</column6>
<column7>afds</column7>
<column8>afsd</column8>
</row>
<row>
<column1>bfs</column1>
<column2>bs</column2>
<column3>bf</column3>
<column4>bsdf</column4>
<column5>asd</column5>
<column6>afas</column6>
<column7>afds</column7>
<column8>afsd</column8>
</row>
</table>
Good luck, let me know if you find a better way.
Drew
Drew_The_Goat
Here is another approach that has variable columns and rows:
<!--TABLE SECTION-->
<container combination="and" max="5" min="0" name="table" location = "content/table">
<label>Table</label>
<container combination="and" max="20" min="0" name="column" location = "column">
<label>Column</label>
<item name="Row" pathid ="content/table/column/row" >
<label>Row</label>
<text size="50" maxlength="50" rowcontinue="t" max="20" min="0"/>
</item>
</container>
</container>
<!--TABLE SECTION END-->
kajjubee
What I meant with table element is to have a table in my html, I needed to capture the rows and columns for the table in the DCT. Providing replicants for rows and columns would make the DCT long and not-so-friendly. Any custom cgi script would help.
Thanks
Adam Stoller
I suppose you could have a CGI that prompts for number of rows and columns, and then have it render a table with text-fields in each cell - and on submit, captures all the data and [potentially] formats it before sticking the data into the DCR - and then have your PT read it and [re-]format it as per your requirements.
That doesn't sound toooooo difficult. The tricky parts are:
1) dealing with pre-existing data on callout
2) potentially allowing for re-sizing pre-existing data
3) formatting the data for insertion into the DCR
This actually sounds like it could be some fun to develop - unfortunately (perhaps) my customer doesn't require this functionality so I don't have sufficient incentive to actually work on developing it. If you're interested in putting together a design document for it, let me know - I'll be happy to try and pitch some ideas....
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Johnny
Actually if you havent already, I would try testing a DCT with 6.1
The visual layout is alot better with proper indentation.
New features like Item References would make this much more simpler to create and layout.
Have a look at the forms publisher webcast, it has some good examples.
John Cuiuli
templates_guru
This is exactly what our team developed couple years ago and it was very well received by the client...
It took a HTML developer and a TeamSite developer about a week to build it. No real hitches...pretty straightforward but very cool.