Combobox show label instead of value

ihm185

28-11-2018

Hi everyone,

I am pulling data from a field in DB and filling up a combo box. I want to show a different label instead of value. Even after making changes in the label, the value is still displayed. How can I force the label to be displayed in dropdown instead of value?

Please help me.

Accepted Solutions (0)

Answers (2)

Answers (2)

ihm185

03-12-2018

Thank you for replying Pablo,

After I changed the label values from the frontend, the XML code looks like this.

<container colcount="1" colspan="1" id="container903" label="R1" labelPosition="inherit" style="container" type="container">

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    <input action="refresh" colspan="1" dateEditor="jsCalendar" enabledWhenHistory="false" id="input934" label="What solution can we help you with?*" labelPosition="inherit" required="true" targetSchema="schema:Name" targetSchemaMode="xpath" type="select">

    <storage dateFormat="DDMNY4" enum="product_interest" firstYear="1920" lastYear="2015" mode="xpath" timeFormat="none" type="string" unbound="false" useLabelAsValue="false" userEnum="" xpath="@product_interest">

        <variable xpath="jv" />

        <options>

            <option autoSqlName="true" id="IDforThisField12" label="(None specified)" origin="product_interest:" value="" />

            <option autoSqlName="true" id="IDforThisField13" label="Vendor" origin="product_interest:Digital" value="Digital" />

            <option autoSqlName="true" id="IDforThisField14" label="Operation" origin="product_interest:Software" value="Software" />

            <option autoSqlName="true" id="IDforThisField15" label="Learning" origin="product_interest:Study" value="Study" />

            <option autoSqlName="true" id="IDforThisField16" label="Agenda" origin="product_interest:Planning" value="Planning" />

        </options>

    </storage>

    <contextOptions useContext="0" xpath="productGroupEnum/enumValue-collection/enumValue" xpathLabel="@label" xpathValue="@name" />

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    </input>

</container>

Here we can see that the label is different from the value, but when the form loads in the browser its showing values instead of the label. This happens when we are storing/retrieving the value from db field but in case of storing the value to a variable it works perfectly and we can display a different label from value.

Best regards,

Imran