Focal Point
[SOLVED]Dialog Manager to generate Maintain Code in .mnt file

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8957039395

November 19, 2010, 03:40 AM
Mats Sjoberg
[SOLVED]Dialog Manager to generate Maintain Code in .mnt file
I have a need to generate a lot of identical code for all fieldnames in a stack.
For example:
Form2.T10.ReadOnly=stk_ReadOnly.T10; Form2.T10.ToolTipText=IF stk_ReadOnly.T10 EQ "0" then var_ttrw else var_ttro;
Form2.T20.ReadOnly=stk_ReadOnly.T20; Form2.T20.ToolTipText=IF stk_ReadOnly.T20 EQ "0" then var_ttrw else var_ttro;
Form2.T30.ReadOnly=stk_ReadOnly.T30; Form2.T30.ToolTipText=IF stk_ReadOnly.T30 EQ "0" then var_ttrw else var_ttro;
Form2.T40.ReadOnly=stk_ReadOnly.T40; Form2.T40.ToolTipText=IF stk_ReadOnly.T40 EQ "0" then var_ttrw else var_ttro;
F....

Normally i would code a loop in Dialog Manager and generate the fieldnames and the lines of code.
Am i rignt in suspecting that i cannot do this in an MNT file?

Regards, Mats

This message has been edited. Last edited by: Mats Sjoberg,


Mats Sundelin
Cybernetics Business Solutions AB
November 19, 2010, 04:16 AM
GamP
Yes, you're absolutely right about that. The maintain parser will not recognize DM commands.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 22, 2010, 08:40 AM
Mats Sjoberg
Thanks. I created a utility that types out the code so i can cut and paste it. //Mats


Mats Sundelin
Cybernetics Business Solutions AB
November 25, 2010, 07:32 AM
Håkan
Mats,

what about calling a a Focexec with the DM code which is written to a file which is readable for Maintain.

Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
November 26, 2010, 04:41 PM
Dave Ayers
Mats.

It looks like you want to generate code to set form properties. If so, it might be easier to do that in JavaScript, like processing an array of controls with name substitution to get the right data source for each property value. Of course all the data element would have to be part of the run-time page.


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
February 28, 2011, 08:43 AM
Mats Sjoberg
Thanks for the suggestions. I am sorry for not responding before. //Mats


Mats Sundelin
Cybernetics Business Solutions AB
February 28, 2011, 03:51 PM
Waz
You can use DM in Maintain code, but only if you are executing it, pre compiled code will not work.

But...

I think Dave is right, javascript may well be the best way.

I have in the past create a process to generate javascript and pass it back to the displayed or displaying maintain page.

It can be done.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!