Karsten
I'm new here

Scripting: How to enable input compontent which is not editable by rules

Editors should only change the value of a CMS_INPU_LIST via  a script rather than directly in the form. So I made this input not editable via rules. How can I make it editable via script to set the new values? I get the input field via the FS_BUTTON

thanks

// ??? make editable here

targets_inputlist_from_button.set(mappedTargetsNew); // set value here

// ??? make not editable here

<FS_BUTTON

          name="fs_targetbutton"

          hFill="no"

          noBreak="no"

          onClick="script:news_target_picker"

          style="button"

          useLanguages="no">

          <LANGINFOS>

            <LANGINFO lang="*" label="Set news targets" description="TEXT"/>

            <LANGINFO lang="DE" label="Nachrichtenziele zuweisen" description="TEXT"/>

          </LANGINFOS>

          <PARAMS>

            <PARAM name="targets_inputlist_from_button">#field.cs_targetmapping</PARAM>

            <PARAM name="editor_input_from_button">#field.cs_autor</PARAM>

          </PARAMS>

        </FS_BUTTON>

0 Kudos
12 Replies

Hello,

is this still an open question? Do you need further help or did the replies already help you? If so, it would be great if you mark the "correct answer".

If you found a solution by yourself, it would be very kind, if you post it here.

Best regards

Michaela

0 Kudos

I wasn't able to solve this. But I found a workaround: I made a second form element which is mapped to the same table column. Of course I got a warning that data conflics may happen but it is not a problem if you set the important form element on the last position in the mapping table (last wins).

Hi Karsten

You can use rules to do this as follows:

<ON_EVENT>

<WITH> 

  <OR>

   <IN_GROUP name="Developer"/>

   <IN_GROUP name="Administrators"/>

  </OR>

</WITH>         

<DO>           

  <PROPERTY source="st_tt_checkbox" name="EDITABLE"/>                   

  <PROPERTY source='st_csh_checkbox' name='EDITABLE'/> 

  <PROPERTY source="st_formfields_id" name="EDITABLE"/>

  <PROPERTY source='st_formfields_name' name='EDITABLE'/>                                         

</DO>     

</ON_EVENT>

You have to set the condition which can be value or permission group or any valid condition.

Regards

Vijay

0 Kudos