OPNsense Forum

English Forums => Development and Code Review => Topic started by: faunsen on November 07, 2016, 05:27:17 pm

Title: [SOLVED] MultiOptionField
Post by: faunsen on November 07, 2016, 05:27:17 pm
Hi,

for a new plugin I need the OptionField but with multiple selection.
The InterfaceField type for example has such a multiple selection.

Is it possible to do the same with a simple list?
Or is there a way to define an ArrayField that occurs as a multiple_select in the UI?


Kind regards
Frank
Title: Re: MultiOptionField
Post by: faunsen on November 25, 2016, 08:51:11 am
The CSVListField is exactly what I was looking for.
Code: [Select]
<MyItem type="CSVListField">
   <Required>Y</Required>
   <default>value1,value2</default>
   <SelectOptions>
      <value1>Value one</value1>
      <value2>Value two</value2>
      <value3>Value three</value3>
      <value4>Value four</value4>
   </SelectOptions>
</MyItem>
Title: Re: MultiOptionField
Post by: franco on November 25, 2016, 10:55:30 am
Hi Frank,

So this is solved? :)


Cheers,
Franco
Title: Re: MultiOptionField
Post by: faunsen on November 25, 2016, 11:14:38 am
Hi Franco,

yupp.

How can I mark a topic as solved?



Regards,
Frank
Title: Re: MultiOptionField
Post by: franco on November 25, 2016, 11:30:48 am
You can edit the first post's subject.