Edit
TsgcHTMLComponent_Edit — jednowierszowe pole tekstowe z etykietą, tekstem pomocy, typem pola i wiązaniem z zestawem danych, które renderuje element form-control Bootstrap 5, w Delphi, C++ Builder i .NET.
TsgcHTMLComponent_Edit — jednowierszowe pole tekstowe z etykietą, tekstem pomocy, typem pola i wiązaniem z zestawem danych, które renderuje element form-control Bootstrap 5, w Delphi, C++ Builder i .NET.
Samodzielne pole tekstowe, które generuje opatrzony etykietą element <input> Bootstrap. Ustaw nazwę, etykietę i typ pola, a następnie odczytaj właściwość HTML. Dostarczane jest w tej samej jednostce co pokrewne pola Memo, CheckBox i RadioGroup.
TsgcHTMLComponent_Edit
Pole form-control Bootstrap 5
Delphi, C++ Builder, .NET
Ustaw Name, Label_, InputType i Placeholder, a następnie odczytaj HTML (albo umieść go na stronie TsgcHTMLTemplate_Bootstrap).
uses
sgcHTML_Enums, sgcHTML_Component_Edit;
var
oEdit: TsgcHTMLComponent_Edit;
begin
oEdit := TsgcHTMLComponent_Edit.Create(nil);
try
oEdit.Name := 'email';
oEdit.Label_ := 'Email address';
oEdit.InputType := itEmail;
oEdit.Placeholder := 'you@example.com';
oEdit.HelpText := 'We never share it.';
oEdit.Required := True;
WebModule.Response := oEdit.HTML; // Bootstrap form-control
finally
oEdit.Free;
end;
end;
// Or bind it to a dataset field:
oEdit.DataField := 'Email';
oEdit.DataSource := dsCustomer;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Edit.hpp
TsgcHTMLComponent_Edit *oEdit = new TsgcHTMLComponent_Edit(NULL);
try
{
oEdit->Name = "email";
oEdit->Label_ = "Email address";
oEdit->InputType = itEmail;
oEdit->Placeholder = "you@example.com";
oEdit->HelpText = "We never share it.";
oEdit->Required = true;
String html = oEdit->HTML; // Bootstrap form-control
}
__finally
{
delete oEdit;
}
using esegece.sgcWebSockets;
var edit = new TsgcHTMLComponent_Edit();
edit.Name = "email";
edit.Label_ = "Email address";
edit.InputType = TsgcHTMLInputType.itEmail;
edit.Placeholder = "you@example.com";
edit.HelpText = "We never share it.";
edit.Required = true;
string html = edit.HTML; // Bootstrap form-control
Składniki, po które sięgasz najczęściej.
Name ustawia nazwę pola, Label_ widoczny podpis, a EditID identyfikator elementu (domyślnie edit_<Name>).
Value inicjuje pole, Placeholder wyświetla tekst zastępczy, a HelpText dodaje podpowiedź form-text Bootstrap pod polem.
InputType to TsgcHTMLInputType — itText, itEmail, itPassword, itNumber, itTel, itURL, itDate, itColor, itRange, itFile i więcej.
Required, Disabled i ReadOnly oznaczają pole na potrzeby walidacji i edycji.
DataField wraz z przypisanym DataSource wypełnia Value na podstawie bieżącego rekordu.
HTML zwraca opatrzony etykietą form-control. Ta sama jednostka deklaruje pokrewne pola TsgcHTMLComponent_Memo, TsgcHTMLComponent_CheckBox i TsgcHTMLComponent_RadioGroup.