Dynamic Control Creation - Web Page (OpenInsight Specific)
At 15 DEC 1998 05:51:31PM Tom Horan wrote:
I was wondering is there a way to dynamically create controls? How do I do this?
Will this work with a form that will be convert to html?
I want to create a windows with no controls. Then based on a rule table I want to dynamically create controls. The number of controls will vary depending on the rule table. Is this possible.
At 16 DEC 1998 01:15AM Don Bakke wrote:
Tom,
You can create dynamic controls, even dynamic windows, essentially by using the Utility("CREATE") function. The hard part is learning the structure of these controls. An easy approach is to create generic controls, use the Get_Property(Control, "ORIG_STRUCT") to get the structure layout, write these to a record, then use your table driven method for selecting the appropriate controls and update the necessary parameters (e.g. size, position, etc.)
I also highly recommend Sprezzatura's REVMEDIA on Window structures which also details control structures. While this isn't exactly what you need since this deals with the source structures rather than the object structures, it is a great primer for what you are going to do.
I believe creating dynamic controls for web pages is even easier since these are defined ultimately by HTML. I'm not an expert in this but perhaps Mike Ruane will chime in with some ideas.
At 16 DEC 1998 03:52AM Oystein Reigem wrote:
Tom,
I was wondering is there a way to dynamically create controls? How do I do this? Will this work with a form that will be convert to html?
If you have an OI form where controls are created dynamically, the form will not contain these controls at design time. And HTML Publisher can only generate HTML elements based on the controls present at design time. It cannot guess what the form's CREATE handler is going to do (I assume that's where you create your "dynamic" controls). So if you have a form that contains no controls at design time, your generated web page will not contain much.
It seems you must make your own web page generator, one that can take the same rules that the form's CREATE handler uses, and produce HTML elements instead of form controls. (Sounds like fun, really
)
- Oystein -
At 17 DEC 1998 07:22AM Oystein Reigem wrote:
Tom,
(You can do dynamic stuff in a web page too. You can e.g have some Javascript changing the content of the page. So you could conceivably have a web page that reconfigures itself. But then you need to know Javascript in addition to knowledge about HTML and HTML forms. So I don't think this would be your first choice.)
- Oystein -
At 17 DEC 1998 11:47PM Tom Horan wrote:
Got the code to work in OI, now comes the fun of trying to figure this out in html. Thanks for your help.