# plugconf: comboboxen speichen displayField statt valueField

**URL:** https://forum.shopware.com/t/plugconf-comboboxen-speichen-displayfield-statt-valuefield/5340
**Category:** Shopware 3.5
**Tags:** programming
**Created:** [1. Dezember 2011 um 17:00 UTC](https://forum.shopware.com/t/plugconf-comboboxen-speichen-displayfield-statt-valuefield/5340 "2011-12-01T17:00:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bui\_ak](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bui\_ak](https://forum.shopware.com/u/bui_ak)
#### Post date: [1. Dezember 2011 um 17:00 UTC](https://forum.shopware.com/t/plugconf-comboboxen-speichen-displayfield-statt-valuefield/5340/1 "2011-12-01T17:00:01Z")

</div>

hallo, analog zu [http://wiki.shopware.de/Die-Shopware-Pl … #Combo-Box](http://wiki.shopware.de/Die-Shopware-Plugin-Konfiguration%5C_detail%5C_760%5C_444.html#Combo-Box) habe ich ein element hinzugefügt: ` $form-\>setElement('combo', 'timeToDisplay', array('label'=\>'Anzeige in Tagen','value'=\>'2','attributes'=\>array( 'valueField'=\>'myId','displayField'=\>'displayText', 'mode' =\> 'local', 'triggerAction' =\> 'all', 'store' =\> ' new Ext.data.ArrayStore({ id: 0, fields: ["myId", "displayText"], // Hier kommen die wichtigen Informationen rein data: [[1, "eins"], [2, "zwei"], [3, "drei"], [4, "vier"], [5, "fuenf"], [6, "fuenfzehn"]] }) ' ),'scope'=\>Shopware\_Components\_Form::SCOPE\_SHOP));` nach dem speichern im admin liefert ein print\_r auf die Config(): ` ... [\_data:protected] =\> Array ( [timetodisplay] =\> fuenf ` das ist ziemlich ungünstig. mache ich da was falsch? ach und btw. könnt ihr bitte in Shopware\_Models\_Plugin\_Config noch eine methode getAll() { return $this-\>\_data; } aufnehmen? danke.

---

<div class="post-metadata">

### Author: ![Patrick\_Stahl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrick_stahl/32/7679_2.png) [@Patrick\_Stahl](https://forum.shopware.com/u/Patrick_Stahl)
#### Post date: [1. Dezember 2011 um 17:38 UTC](https://forum.shopware.com/t/plugconf-comboboxen-speichen-displayfield-statt-valuefield/5340/2 "2011-12-01T17:38:39Z")

</div>

Hallo bui\_ak. Nein, du machst nichts falsch. Leider ist es derzeit in Shopware so, dass du nur das DisplayField zurückbekommst. Allerdings kannst du doch auch mit dem DisplayField arbeiten, oder nicht? Beispielsweise mit einem Switch. Gruß, Patrick :shopware:

---

<div class="post-metadata">

### Author: ![bui\_ak](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bui\_ak](https://forum.shopware.com/u/bui_ak)
#### Post date: [1. Dezember 2011 um 18:43 UTC](https://forum.shopware.com/t/plugconf-comboboxen-speichen-displayfield-statt-valuefield/5340/3 "2011-12-01T18:43:30Z")

</div>

im prinzip schon. allerdings kommen die values aus s\_core\_states und dort sind die values nicht unique. ein sql-statement ‘select id … where name=…’ ist nicht das problem. aber eine eigentlich unnötige mögliche fehlerquelle.

---

<div class="post-metadata">

### Author: ![Marcel\_S](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@Marcel\_S](https://forum.shopware.com/u/Marcel_S)
#### Post date: [5. Dezember 2011 um 10:26 UTC](https://forum.shopware.com/t/plugconf-comboboxen-speichen-displayfield-statt-valuefield/5340/4 "2011-12-05T10:26:21Z")

</div>

Hallo, wir haben dafür jetzt ein Ticket in unserem Issue Tracker angelegt. Wir hoffen das dies bereits in der nächsten Version behoben wird. Grüße, Marcel
