Combobox show label instead of value | Adobe Higher Education
Skip to main content
Level 3
November 28, 2018
解決済み

Combobox show label instead of value

  • November 28, 2018
  • 2 の返信
  • 1926 ビュー

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.

このトピックへの返信は締め切られました。
ベストアンサー ihm185

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

2 の返信

pablo_rosero1
Level 9
November 30, 2018

Hi Imran,

This is done by changing label="name" in the code.

See Modifying Factory Forms in Adobe Campaign Classic |

I hope this helps!

All the best,

Pablo

ihm185作成者回答
Level 3
December 3, 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