EmbAJAX
Simplistic framework for creating and handling displays and controls on a web page served by an embeddable device (Arduino or other microcontroller with Arduino support).
Public Member Functions | Protected Attributes | List of all members
EmbAJAXTextInput< SIZE > Class Template Reference

A text input field. More...

#include <EmbAJAX.h>

Inheritance diagram for EmbAJAXTextInput< SIZE >:
Inheritance graph
[legend]
Collaboration diagram for EmbAJAXTextInput< SIZE >:
Collaboration graph
[legend]

Public Member Functions

 EmbAJAXTextInput (const char *id)
 
void print () const override
 
const char * value (uint8_t which=EmbAJAXBase::Value) const override
 
const char * valueProperty (uint8_t which=EmbAJAXBase::Value) const override
 
void setValue (const char *value)
 
void updateFromDriverArg (const char *argname) override
 
- Public Member Functions inherited from EmbAJAXElement
 EmbAJAXElement (const char *id)
 
const char * id () const
 
bool sendUpdates (uint16_t since, bool first) override
 
virtual bool valueNeedsEscaping (uint8_t which=EmbAJAXBase::Value) const
 
EmbAJAXElementtoElement () override final
 
- Public Member Functions inherited from EmbAJAXBase
void setVisible (bool visible)
 
void setEnabled (bool enabled)
 
virtual EmbAJAXElementfindChild (const char *id) const
 

Protected Attributes

char _value [SIZE]
 
- Protected Attributes inherited from EmbAJAXElement
byte _flags
 
const char * _id
 

Additional Inherited Members

- Public Types inherited from EmbAJAXBase
enum  Property {
  Visibility , Enabledness , Value , FirstElementSpecificProperty ,
  HTMLAllowed
}
 
- Static Public Member Functions inherited from EmbAJAXBase
static void setDriver (EmbAJAXOutputDriverBase *driver)
 
- Protected Member Functions inherited from EmbAJAXElement
void setBasicProperty (uint8_t num, bool status) override
 
bool basicProperty (uint8_t num) const
 
void setChanged ()
 
bool changed (uint16_t since)
 
void printTextInput (size_t size, const char *value) const
 
- Protected Member Functions inherited from EmbAJAXBase
void printChildren (EmbAJAXBase **children, size_t num) const
 
bool sendUpdates (EmbAJAXBase **children, size_t num, uint16_t since, bool first)
 
EmbAJAXElementfindChild (EmbAJAXBase **children, size_t num, const char *id) const
 
void printPage (EmbAJAXBase **children, size_t num, const char *_title, const char *_header, uint16_t _min_interval) const
 
void handleRequest (EmbAJAXBase **children, size_t num, void(*change_callback)())
 
- Static Protected Attributes inherited from EmbAJAXBase
static EmbAJAXOutputDriverBase_driver
 
static char itoa_buf [8]
 
constexpr static const char null_string [1]
 

Detailed Description

template<size_t SIZE>
class EmbAJAXTextInput< SIZE >

A text input field.

A text input field. The template parameter specifies the size (i.e. maximum number of chars) of the input field.

Note
To limit the rate, and avoid conflicting update-conditions, when typing into the text field in the client, changes are sent to the server one second after the last key was pressed. This worked for me, best.

Member Function Documentation

◆ setValue()

template<size_t SIZE>
void EmbAJAXTextInput< SIZE >::setValue ( const char *  value)
inline

Set the text inputs content to the given value. Note: In this particular case, the value passed is copied, you can safely pass a temporary string.

◆ updateFromDriverArg()

template<size_t SIZE>
void EmbAJAXTextInput< SIZE >::updateFromDriverArg ( const char *  argname)
inlineoverridevirtual

override this in your derived class to allow updates to be propagated from client to server (if wanted). The implementation need not call setChanged().

Reimplemented from EmbAJAXElement.

◆ value()

template<size_t SIZE>
const char* EmbAJAXTextInput< SIZE >::value ( uint8_t  which = EmbAJAXBase::Value) const
inlineoverridevirtual

const char representation of the current server side value. Must be implemented in derived class. This base class handles visibility and enabledness, only. Do call the base implementation for any "which" that is not handled in your derived class.

Reimplemented from EmbAJAXElement.

◆ valueProperty()

template<size_t SIZE>
const char* EmbAJAXTextInput< SIZE >::valueProperty ( uint8_t  which = EmbAJAXBase::Value) const
inlineoverridevirtual

The JS property that will have to be set on the client. Must be implemented in derived class. This base class handles visibility and enabledness, only. Do call the base implementation for any "which" that is not handled in your derived class.

Reimplemented from EmbAJAXElement.


The documentation for this class was generated from the following file: