Hi Mark,
I'll try to explain what I mean. Let's assume I just have one block of type text_print on the workspace, lets call this text_print_block.
workspace XML : <block type="text_print">
I want to generate a text block and attach it to the 'text' value of the print block using Javascript.
the xml of the not-yet created block would look like this: <block type="text"><field name="TEXT"></field></block>
This second block doesn't exist yet so, I'd like to do something like
// make the new block
var new_block = new Block({
type = 'text'
});
// populate the new block with data
new_block.setField('text','the text I want to print');
the xml of the new block should now look like this: <block type="text"><field name="TEXT">the text I want to print</field></block>
// attach the new block to the value of the print block
text_print_block.setValue('TEXT', new_block);
workspace xml should now be :
<block type="text_print" id="2218" inline="false" x="-733" y="-156">
<value name="TEXT">
<block type="text" id="2205">
<field name="TEXT">the text I want to print</field>
</block>
</value>
</block>
I realise that I need to do what you explained yesterday to make the connection, this is pseudo-code to make it easier to grasp.
I hope this makes myself a little bit clearer.
Thanks Mark
Phil