arithma
While thinking about mimicking ASP.NET webcontrols in PHP, a few questions started emerging.
The most prevalent one that I can talk out clearly would be:
- How would you go around naming the resulting objects in html (giving them id's) and using those in the respective Javascript code? Randomized names that are saved? A pool of names? Some property passed in to the server side web control that dynamically writes it in the output HTML and JS?
The following is a concern over a potential solution I was thinking about (going with Javascript all the way, and creating the pages dynamically using it.. much like GWT (Google Web Toolkit) does, or just using GWT in fact..)
- Should we always assume that JS could be disabled? Are there well known web apps that just don't work if JS is disabled?
I am especially interested in concerns that I should be aware of and not able to think of at this early stage of pondering (before I commit myself and hit a brick wall)
rolf
There is a concern of dependency, for example before using a form control, you need to have a form, for using trantitions, a script include has to be declared in HEAD.
Tags can have IDs and CLASSes. I thought that you could have several ids from the same class (for example .select#1 .select#2, then .text#1 .text#2). I was deceived to know that ids are expected to be unique in the document, not in the class. That sucks.
so anyway i'd go with a generic, parent class (maybe for the document) that would have a method get_id that will return a new, incremented id. You can use that every time i'm creating a control.