OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • [SOLVED] MultiOptionField
« previous next »
  • Print
Pages: [1]

Author Topic: [SOLVED] MultiOptionField  (Read 4633 times)

faunsen

  • Full Member
  • ***
  • Posts: 102
  • Karma: 17
    • View Profile
[SOLVED] MultiOptionField
« 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
« Last Edit: November 25, 2016, 11:33:17 am by faunsen »
Logged

faunsen

  • Full Member
  • ***
  • Posts: 102
  • Karma: 17
    • View Profile
Re: MultiOptionField
« Reply #1 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>
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: MultiOptionField
« Reply #2 on: November 25, 2016, 10:55:30 am »
Hi Frank,

So this is solved? :)


Cheers,
Franco
Logged

faunsen

  • Full Member
  • ***
  • Posts: 102
  • Karma: 17
    • View Profile
Re: MultiOptionField
« Reply #3 on: November 25, 2016, 11:14:38 am »
Hi Franco,

yupp.

How can I mark a topic as solved?



Regards,
Frank
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: MultiOptionField
« Reply #4 on: November 25, 2016, 11:30:48 am »
You can edit the first post's subject.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • [SOLVED] MultiOptionField
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2