WT application architecture
Added by Bogdan Cosescu about 11 years ago
Hi guys!
I was thinking about my WT app. I'm in a team in which I'm working with a teammate that's a web developer. He knows HTML, Javascript, CSS. He has little knowledge of C and mostly no interest in WT.
The problem is that he is designing how the website should look and I'm implementing using WT. Several times we came across some differences between how WT renders some elements and how the web developer expects it to be. He does not approve on how WT inserts various HTML elements and inner styles to mimic a control. In his opinion he should design the site and WT only provide the html, javascript and css files back to the client. This would translate in minimum interaction between WT and his implementation of the site.
The question I would ask is how can I fulfill his request using WT? I know that there is this WidgetSet mode but I'm wondering how can I attach to html elements in his design without altering them with the WT render results.
For example I would like to bind to a canvas element only to draw on it but on rendering the html nothing can be changed.
Replies (4)
RE: WT application architecture - Added by Koen Deforche about 11 years ago
Hey Bogdan,
Only if a native control is not (widely) implemented in browsers, does Wt compose a control from different elements. This should not come as a surprise to a web developer though? Wt follows well established patterns, testimony of this is the ability to style using bootstrap's theme unmodified.
Now the styling is entirely to the designer; by overriding Wt's theme (which can indicate what style classes are put on various elements) as well and/or CSS.
But I have the impression that your designer still thinks in terms of 'pages' and not in term of different components? The issue of how a particular 'control' then is styled/implemented is then much less of a concern in the bigger picture as it is abstracted into a widget whose CSS and inner workings is to be defined only once. Thus he should design components, not pages. And Wt then composes the UI from these components, substituting placeholders with basic widgets (e.g. WLineEdit) or other components.
Our experience with designers is that they will indeed often style an entire page but then we take it apart to compose the different parts into different widgets. The page-oriented thinking comes from decades of PHP/JQuery culture.
Regards,
koen
RE: WT application architecture - Added by Bogdan Cosescu about 11 years ago
Page oriented design....something I heard many times from the web developer :D.
How about WidgetSet mode? Could that help in a page oriented design?
RE: WT application architecture - Added by Koen Deforche about 11 years ago
Well, WidgetSet mode cannot really help --- Wt will still want to replace the referenced elements with its own widget rendering. It does not simply attached behavior to existing elements.
RE: WT application architecture - Added by David Tidd about 11 years ago
Bogdan,
Am a newbie, this is my first post, so please forgive if you find me completely off base.
Having done this type work for more than 25 yrs, and in study of Wt for 6 mos, can share if I was faced with the "teammate" you have, I would use the templating system of Wt. Seems the "teammate" (prefer to use this very loosely) wants to contribute to the look and feel. Seems he also thinks linearly, mean no disrespect, just trying to help you negotiate am amiable solution. By using the templates you can provide the web person with the HTML template along with base CSS for the widget sets deployed and be done. Keep the templates in an external file opposed to within your c code itself. I would suggest de-referencing the standard widget sets in CSS with terms the web person can relate to the project goals, but not add any styling. This establish the environment for showing your work to date has been true to form while empowering this person to contribute positively upon the success of your project. It will draw a clear line and allow you to differentiate yourself when its time for evaluations.
All the best,
David