christian_ibend
I'm new here

CMS_INPUT_DOM über API befüllen

Jump to solution

Hallo, ich möchte einen Text) geeignet in ein CMS_INPUT_DOM (st_dom) übertragen.  Aus irgendeinem Grund gelingt mir das aber nicht. Sowohl der Blick in den Javaclient, als auch die Begutachtung per API zeigen hernach keine Veränderung. Was übersehe ich?

<code><pre>

    String myText = "TEST";

    final FormatTemplates formatTemplates = ...;

    final FormatTemplate paragraphTemplate = ...;

    final Section element = ...;

    element.setLock(true);

    final FormData formData = element.getFormData();

    final FormField domField = formData.get(null, "st_dom");

    final DomElement stDom = (DomElement) domField.get();

    DefaultDomNode root = stDom.getRoot();

    DefaultDomNode p = (DefaultDomNode) root.appendChild(paragraphTemplate);

    p.appendChild(myText);

    domField.set(stDom);

    element.setFormData(formData);

    element.setLock(false);

</pre></code>

    final FormatTemplates formatTemplates = ...;
    final FormatTemplate paragraphTemplate = ...;
    final Section element = ...;

    element.setLock(true);

    final FormData formData = element.getFormData();
    final FormField textField = formData.get(null, "st_text");
    final FormField domField = formData.get(null, "st_dom");
    final DomElement stDom = (DomElement) domField.get();

    DefaultDomNode root = stDom.getRoot();
    DefaultDomNode p = (DefaultDomNode) root.appendChild(paragraphTemplate);
    p.appendChild("TEST");
    domField.set(stDom);

    element.setFormData(formData);
    element.setLock(false);
1 Solution

Accepted Solutions
christian_ibend
I'm new here

Habe vergessen, auf dem Element .save() aufzurufen ... :smileyplain:

View solution in original post

1 Reply
christian_ibend
I'm new here

Habe vergessen, auf dem Element .save() aufzurufen ... :smileyplain: