NewUi: Select Lookup field value rendered as picklist programmatically - Forum - Rollbase - Progress Community

NewUi: Select Lookup field value rendered as picklist programmatically

 Forum

NewUi: Select Lookup field value rendered as picklist programmatically

  • I have lookup field rendered as picklist on New Page.

    How to select value by default on onLoad Page?

  • Hi,

    Please specify a function in "onLoad" event handler by following the below navigation.

    Object Definition->Pages->New->Properties

    Add a script component in the new record page by using desgin the page and define the function as follows.

    <script>

       function selectValue(){

          rbf_setFieldValue("R15390", "15401");

     }

    </script>

    R15390 Is the integration name of the lookup filed and 15401 is the record ID of the specific picklist value.

    Please find the screenshots

    Regards,

    Shiva

  • Hi Shiva,

    Thank you for your reply.

    I can't use rbf_setFieldValue because i don't know wich value will be first field.

    I need select default first value of picklist rendered from lookup field.

    I do by Keno UI api:

    var dropdownlist = $("#dropdownlist").data("kendoDropDownList");

    dropdownlist.select(1);

    dropdownlist.trigger("change");

    Regards,

    Marat

  • Prefer,  rbf_getFieldContext('dropdownlist').getKendoConfig() to access kendo widget configuration objects. Instead of directly querying for widget type.

    That is,

    var dropdownlist = rbf_getFieldContext('dropdownlist').getKendoConfig();

    //where 'dropdownlist' is field integration name

    Instead of:

    var dropdownlist = $("#dropdownlist").data("kendoDropDownList");

    This way, client-code will be imprevious of any widget implementation changes.

    Regards,
    Siraj.
  • Hi Siraj,

    Thank you! I'll try it.

    Regards,

    Marat