Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 10 of 11 total |
Wrap control inside a <DIV></DIV> tag? |
Sat, Oct 3 2015 1:51 PM | Permanent Link |
PA | Hello!
Is it possible to wrap any control inside a <DIV></DIV> tag at design-time, so that this control will become a DIV DOM element in the browser at run-time? |
Sat, Oct 3 2015 2:10 PM | Permanent Link |
PA | Ooops, this could lead to a misunderstanding, as any control will become a DIV at run-time in the browser. My question was about wrapping this control-DIV inside another custom DIV with custom attributes at design-time. Or to assign custom DIV attributes for a control at design-time? This would add a lot of flexibility and extend the possibilities hugely!
|
Sat, Oct 3 2015 2:14 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | PA,
<< Ooops, this could lead to a misunderstanding, as any control will become a DIV at run-time in the browser. My question was about wrapping this control-DIV inside another custom DIV with custom attributes at design-time. Or to assign custom DIV attributes for a control at design-time? This would add a lot of flexibility and extend the possibilities hugely! >> What exactly are you trying to accomplish ? The quick answer is no, simply because for an EWB application there shouldn't be any DIV elements present in the entire active document that aren't managed by EWB already (TBrowser, being the exception). Tim Young Elevate Software www.elevatesoft.com |
Sat, Oct 3 2015 2:18 PM | Permanent Link |
PA | This could be done by implementing a CustomDivAttributes property in the TControl class. The compiler then would add the attributes from this property to the control DIV. Very easy to implement.
This would be fantastic! |
Sat, Oct 3 2015 2:24 PM | Permanent Link |
PA | As an example, this would allow to add the draggable attribute to a control.
|
Sat, Oct 3 2015 2:43 PM | Permanent Link |
PA | More generally:
This would allow to ADD or REMOVE ANY specific attribute to a control - both at design-time and at run-time. For example, at run-time: MyControl.CustomDivAttributes.Add('draggable="true"'); or: // removes attribute with specific value: MyControl.CustomDivAttributes.Remove('draggable="true"'); or: // removes attribute with any value: MyControl.CustomDivAttributes.Remove('draggable'); or: MyControl.CustomDivAttributes.Replace('draggable="true"', 'draggable="false"'); |
Sat, Oct 3 2015 3:20 PM | Permanent Link |
PA | Well, the WebDOM unit contains the TDOMElement class which implements several attribute methods.
But how can I typecast a TControl to a TDOMElement? When I write: TDOMElement(BasicPanel1).setAttribute('Id', 'test'); then the compiler complains with: [Error] Unit1.wbs (27,3): The referenced class TDOMElement is not compatible with the expression being cast So how can I use a TControl as a TDOMElement? |
Sat, Oct 3 2015 4:26 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | PA,
<< This could be done by implementing a CustomDivAttributes property in the TControl class. The compiler then would add the attributes from this property to the control DIV. Very easy to implement. This would be fantastic! >> My initial reaction is no, that probably won't happen with EWB. It's too easy for the end developer to break behaviors doing that, and it circumvents any encapsulation offered by the control/component classes in the component library. Tim Young Elevate Software www.elevatesoft.com |
Sat, Oct 3 2015 4:27 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | PA,
<< So how can I use a TControl as a TDOMElement? >> You can't. Tim Young Elevate Software www.elevatesoft.com |
Sat, Oct 3 2015 4:31 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | PA,
<< As an example, this would allow to add the draggable attribute to a control. >> If you want to do this, then you should develop a *proper* descendant class that does this for you. As I said before, you seem to be trying to force EWB to act like a JS+HTML+CSS tool-chain when it's whole entire *purpose* is to *not* use those development languages/formats. The "draggable" attribute will not allow you to just start dragging around TControl-descendant instances and dropping them places. Doing so will completely subvert everything being tracked by the EWB UI layer and cause it to fail because it won't be in synch with what is actually occurring in the browser. EWB maintains this UI layer for many reasons: design-time/run-time dual usage, platform independence, and performance (in the browser). Tim Young Elevate Software www.elevatesoft.com |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Friday, December 6, 2024 at 05:39 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |