Initializing javascript values into dropdown list in web forms

jitendrat766521

04-06-2018

Hi Team,

I am facing some challenge on calling java script values into next page drop down list  so please provide me the solution on this ASAP.

This is my script:

var query = xtk.queryDef.create(

<queryDef label="Campaigns" namespace="nms" operation="select"

          schema="nms:operation" startPath="/" xtkschema="xtk:queryDef">

      <select>

    <node   expr="@label" />

  </select>

</queryDef>

)

var res = query.ExecuteQuery(); 

if (ctx.vars.length() == 0) {

  ctx.appendChild(<vars/>)

 

 

ctx.vars.appendChild(res);

2)This is my web form flow

1501471_pastedImage_4.png

Accepted Solutions (1)

Accepted Solutions (1)

Jean-Serge_Biro

MVP

05-06-2018

Hi Jitendrat,

Please may you check the context content (for vars elements) by selecting the Debug checkbox in the Preview tab?

Take care, you must retrieve 2 nodes, not only the label but the ID or internal name.

And in the web page activity section, if it is a web page compatibility v5, you must set the listbox in the Advanced tab.

Whatever you need to use a list box value dynamically set from your database, custom or standard tables values, you can set the XPath it as is in the Advanced tab of the Web page form (compatibility v5):

1502304_pastedImage_3.png

If the activity web page is a Web page v6 (standard one, not a compatibility v5 one), you can manage the values in the source page directly doing your queryDef in Javascript and assigning values to the <input select...> element values.

Regards
J-Serge

Answers (0)