How to assign TWebCheckListBox Parent without JavaScript?


I just finished your class section "Understanding the Visual Control Library" for the 4th time. I think you still need plenty of JavaScript knowledge to work effectively in TMS Web Core.

For example: Using the TWebAccordion in the example project in the OnRenderSection event a TWebListControl is used and it's ParentElement is set like this :

lb.ParentElement := APanel.element;

I would like to use a TWebCheckListBox instead, however TWebCheckListBox
doesn't have a ParentElement property, just plain Parent. And the APanel Param is a TJSHTMLElementRecord. How can I assign it at the TWebCheckListBox Parent without JavaScript?

Should have put it here to begin with. Just thought while you were online I would sneak it in :)

I do not understand. You want to insert a Panel in a TWebCheckListBox? A TWebCheckListBox wasn't designed to have other childs than the items with checkboxes.

No, I would like to use TWebCheckListBox in an Accordion section instead of a TWebListControl, or any other list control with checkbox, but I can't figure out how to set the Parent property

You can use

webchecklistbox1.parentELement := webpanel1.ElementHandle;

It will compile. It's just the designtime class that doesn't have the property yet. We'll add it for the next release.

Which component?

TWebCheckListBox doesn't have the ParentElement property and the APanel parameter in the OnRenderSection event doesn't have an ElementHandle property either.

  1. I just gave an example that using in code webchecklistbox1.parentELement does work.

  2. To use it with TWebAccordion

procedure TForm3.WebAccordion1RenderSection(Sender: TObject;
  ASection: TAccordionSection; ACaption, APanel: TJSHTMLElementRecord);
  WebCheckListbox1.ParentElement := APanel.element;


Thank you.

I'm always amazed at the support from TMS. You no doubt have many duties, yet you still take time to answer posts.


1 Like