Expand my Community achievements bar.

SOLVED

Initializing javascript values into dropdown list in web forms

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

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