Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
dynamic HTML tables from callout
Renata
my client cannot use VisualFormatter and yet we need to provide functionality for custom HTMl tables.
Therefore we allow them to build such tables via callout. It works very nice when building new tables. HTML code is passed back as a string and it displays great via tpls.
however I run into problems when a user wants to edit an existing table. I've been trying various DHTML ways of setting <table id='myTable'> to the value I get back from a dcr [my $table = $cgi->{'form'}{'table'}] but nothing seems to work.
Could anyone shed some light on how to re-draw tables dynamically in HTML ?
all help is appreciated ... ro
Find more posts tagged with
Comments
pflory
RO,
Could you provide a bit more detail about what you are trying to do?
You can not access the HTML code that is stored in the DCR, from within your callout ?
Is that the problem?
If so, have you looked at the example callout code that ships with TS?
What version of TS are you using?
Paul Flory
Renata
Paul,
thanks for you response, we did get it to work - basically i was running my init() function at the wrong time.
here is an 'outline' of my workaround for anyone in need of dynamic/custom HTML tables without VF:
1. in my dct <item name='table'> is a "cgi-callout" and a user clicks on a browse-like-button (Build Table) to open a new window
2. this new window is rendered through CGI and its behaviour is controlled via JavaScript - define functions for add table, add rows, headers, columns, etc. using dynamic HTML methods.
3. once the user is happy, clickOK and the HTML code (for the table only) gets stored in the <item name='table'> as part of this XML content record.
4. Let's say two days later they need to change it. When a user clicks "Build Table" in the dcr, the window that comes up should display their old table. To do that:
- pass the HTML string ($table) to this new window (my $cgi = TeamSite::CGI_lite->new(); my $table = $cgi->{'form'}{'table'}
- my init() function sets document.getElementByID("myTable").outterHTML = $table
- run your init() on load (<body onload="javascript: init();">)