Expand my Community achievements bar.

SOLVED

Creating Drop Down Menu Not Working

Avatar

Level 2

Hi everyone !
I'm trying to create a dropdown menu in an input forms and I don't know why this doesn't work, knowing that I've created an enumeration in the DataSchema,

 

here's the code for the DataSchema :

<enumeration basetype="short" default="sh" name="scriptLanguage1">

    <value label="Shell script" name="sh" value="0"/>

    <value label="DOS Batch" name="batch" value="1"/>

    <value label="Visual Basic script" name="vbs" value="2"/>

    <value label="Perl" name="perl" value="3"/>

    <value label="Python" name="python" value="4"/>

    <value label="Ruby" name="ruby" value="5"/>

    <value label="Other..." name="other" value="6"/>

</enumeration>

And this is the attribute linked to this enumeration :

<attribute desc="Language" enum="scriptLanguage1" label="Language" name="sscript" type="short"/>

 

This is the attribute i put in the Input Forms :

<input label="The Scripts languages" xpath="sscript"/>

I also tried to change xpath="sscript" to xpath="@sscript" but still not working ,

 

Thank you in advance for your help.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

 

Hi @AnasSpir05 ,

Have you updated the database structure after creating 'sscript' attribute in schema?

If yes, are you looking for dropdown in input form's preview tab?

 

the scripts given by you is correct.

And in input form, it should be xpath="@sscript"

<input label="The Scripts languages" xpath="@sscript"/>

 

In preview tab of input form, you can't see the dropdown (it will be greyed out).

(Example you can open any out of box forms like nms:recipient, go to preview tab, and you can see dropdown will be greyed out)

ParthaSarathy_0-1685703392158.png

 

 

To test the dropdown, create a navigation hierarchy for your schema, and check the input form function. drop down will work with your script. But make sure you modify xpath="@sscript" in input form.

 

Regards,

ParthaSarathy

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

 

Hi @AnasSpir05 ,

Have you updated the database structure after creating 'sscript' attribute in schema?

If yes, are you looking for dropdown in input form's preview tab?

 

the scripts given by you is correct.

And in input form, it should be xpath="@sscript"

<input label="The Scripts languages" xpath="@sscript"/>

 

In preview tab of input form, you can't see the dropdown (it will be greyed out).

(Example you can open any out of box forms like nms:recipient, go to preview tab, and you can see dropdown will be greyed out)

ParthaSarathy_0-1685703392158.png

 

 

To test the dropdown, create a navigation hierarchy for your schema, and check the input form function. drop down will work with your script. But make sure you modify xpath="@sscript" in input form.

 

Regards,

ParthaSarathy

Avatar

Level 2

Hi @ParthaSarathy ,

Thank you for your reply, otherwise yes I have updated the database but what I want is that at least I can see the result in the input forms and then I could create the navigation hierarchy but I don't even have a preview of the dropdown menu in gray.

Avatar

Community Advisor

@AnasSpir05 , have you created enumeration above <element label="schema label" name="schemaName"... tag?

I have tried your script in sandbox and its working fine.

Schema: name - test:schemaName
---
<srcSchema .........  
label="Schema Name" name="schemaName" namespace="test" xtkschema="xtk:srcSchema">

 <enumeration basetype="short" default="sh" name="scriptLanguage1">
    <value label="Shell script" name="sh" value="0"/>
    <value label="DOS Batch" name="batch" value="1"/>
    <value label="Visual Basic script" name="vbs" value="2"/>
    <value label="Perl" name="perl" value="3"/>
    <value label="Python" name="python" value="4"/>
    <value label="Ruby" name="ruby" value="5"/>
    <value label="Other..." name="other" value="6"/>
  </enumeration>

<element label="Test" name="test" autopk="true">
  <attribute desc="Language" enum="scriptLanguage1" label="Language" name="sscript" type="short"/>
</element>
</srcSchema>



// UPDATE THE DATABASE STRUCTURE
// DISCONNECT & RECONNECT CAMPAIGN

Input form: 
name: test:schemaName

<form ............. name="schemaName" namespace="test" xtkschema="xtk:form">
  <input label="The Scripts languages" xpath="@sscript"/>
</form>

//SAVE
//PREVIEW NOW

 

Output:

ParthaSarathy_0-1685712679436.png

 

 

After creating navigation hierarchy:

ParthaSarathy_1-1685712735440.png

If its not working in your current schema, try creating a new schema, and configure the above script alone and give a try.

Avatar

Level 2

Hi @ParthaSarathy ,

Yes, I've just found the solution, in fact I couldn't put it in another container I had and it wouldn't display, but now it works, and thanks for your help in any case!