Page 1 of 1
How to use protect
Posted: Wed Nov 06, 2013 12:42 pm
by dieter
I have a screen which shall be used for editing and for displaying data. If the program is called in edit mode all textboxes are open. If the program is called in view mode all textboxes should be disabled. I know that i can do this by binding an disabled indicator to every input field. But i am looking for more simple solution. So i found in the Visual Designer the keyword "protect" on screen level. I tried to set this property. But there is no effect. I can edit all fields.
Where is my mistake?
Dieter
Re: How to use protect
Posted: Wed Nov 06, 2013 1:02 pm
by kfritz
Hi Dieter,
The protect keyword is a DDS keyword, adapted by ProfoundUI. This keyword does not affect the record format in which it is specified. And it requires the overlay keyword too.
More informations about:
http://publib.boulder.ibm.com/infocente ... fptect.htm
Hope this helps.
Regards,
Karl
Re: How to use protect
Posted: Wed Nov 06, 2013 6:41 pm
by Scott Klement
I agree with Karl. To use the PROTECT feature in green-screen, you have to first display the screen, then write the screen containing PROTECT, and it'll protect the fields that are already on the display. This is a confusing feature, but... that's how it works, so we needed to do it the same way in Profound UI to preserve compatibility.
You might consider using JavaScript to protect your fields, instead. For example, you could use the getAllFields() API to get all of the fields, and then use applyProperty() or similar to disable the field.
Re: How to use protect
Posted: Wed Nov 06, 2013 7:30 pm
by akumar
I have used an indicator bound to ReadOnly property of the individual textbox. The same field can be used for all the textboxes on the form. If that indicator is set on before displaying the screen, the fields values cannot be modified.
In the Edit mode, just turn off the Read only indicator.
Re: How to use protect
Posted: Thu Nov 07, 2013 4:22 am
by dieter
Thanks to all for the answers. So i think i will not use the protect keyword. The solution Akumar suggests is the "classic" solution which i have already implemented. I am looking for a more generic solution. So i will try the suggestion from Scott to use a Java API.
Dieter
Re: How to use protect
Posted: Thu Nov 07, 2013 3:04 pm
by Scott Klement
Actually, I was referring to a JavaScript API. (Java is a completely different/separate language from JavaScript.)
Re: How to use protect
Posted: Fri Nov 08, 2013 3:43 am
by dieter
Scott, you are right. I wanted to write "JavaScript API", not "Java API".
Thank you for the correction.
Dieter