

Answer: Yes. It's possible by using the "data" property of the FORM object, and then generate the correct
format using TS.
The only (minor) drawback, is that form created using "dataArray", will always be added AFTER the fields you create using the "data" property.
So it's best to create the entire form using the "data" property.
So what we need to generate, is a string similar to this:
Haircolor: | haircolor=select| Blue=blue , Red=red , Brown=brown
#[Standard FORM object stuff here..] data.cObject = COA data.cObject { # First we generate the static part of the string. 10 = TEXT 10.value = Haircolor: | haircolor=select | # Then we collect the data from DB 20 = CONTENT 20 { # This is the table we want to get data from. table = tx_mytable select.pidInList = 54 # Here each Label/Value pair for the option tag is generated, # with each pair seperated by a comma renderObj = TEXT renderObj.dataWrap = {field:title}={field:uid}, # Finally we removed the last comma from the string. stdWrap.substring = 0,-1 } } #[Standard FORM object stuff here..]
This snippet was submitted by Peter Klein




Add comment