s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266

Home Page:https://valencia.lbsfilm.at/midterm-presentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use a “Options” drop-down list outside of a tab-menu

AWSW-de opened this issue · comments

First of all: A big thanks for this well done interface!

I am currently working on a new 3D printable WordClock project and started to use your interface, because it saves me tons of time. Before I wrote an html configuration page manually and after some time while adding more and more functions it was not good to manage…

This is more a question than a bug, but with the given examples I could not figure out how to use a “Options” drop-down list outside of a tab-menu. I want to add a drop down list to select the language of the WordClock layout and interface as well. The values are stored in a int variable as “0” for German and f.e. “1” for English language….

Can you please add an example how to add such an options menu to achieve this ?

Thanks in advance! =)

I use ControlType::Option extensively in my project. You can review the related ESPUI code at https://github.com/thomastech/PixelRadio
See files named /src/webGUI.cpp and /src/callBacks.cpp

TL;DR: Since you want your menu choices to handle int values, your callback code would convert EPSUI's sender->value string vars to your required int vars. That's all there is to this.

  • Thomas

Thanks a lot!
I will have a look at this. Thanks for the hint as well.
Kind regards

Hello,
sorry i need to come back to this topic. Had a deep look into the linked files and they all use the tab option too...

Can you give me short example of an option list without the tab usage?

Thanks in advance :)

Kind regards