Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PB 11.5 DW Modify of displayonly property of edit control

Status
Not open for further replies.

LunaRoja

Programmer
Sep 21, 2010
34
US
Hello,

I am trying to set the displayonly attribute of a datawindow column dynamically.

I have tried many combinations and I think I am just missing something in the approach.

Below, I have a couple lines of code as an example. To clarify some of the contents:

- ls_colname is the name of the column to modify (of course)
- disableinput is a column on the datawindow with values 'N' or 'Y'. A value of 'Y' indicates that the column should be display only.

I would appreciate any nudge you can give me to get me back on course.

Thanks... LR

===========================================

ls_modstring = ls_colname + ".Edit.Displayonly = '~No~' " + &
" ~t if(disableinput = ~~'Y~~', ~'Yes~' , ~'No~')'"
dw.Modify(ls_modstring)
 
What is not working? If the Modify failing? Does the column not change? Are you just wanting to prevent the user from editing the column?

Matt

"Nature forges everything on the anvil of time"
 
My appolgies for not being clear.

If 'disableinput' = "Y", I want to make the "ls_colname (column)" displayonly, if the value is not "Y", I want to make the "ls_colname" editable. I thought I had expressed that, but I guess I was a bit unclear. What I really, and simply, want to know is how to toggle the "displayonly" attribute for a column to true or false. The syntax for the IF expressions on columns which have a bit of complexity escapes me.

Thanks for considering the question. If you have any insights regarding how to toggle the displayonly property of an edit control I would really appreciate it.

Gracias,

LR
 
Ok, that (above) was not a very clear answer to your question.

What is not working is that the column I am trying to modify does not change from display only to editable regardless of the value of the "disableinput" column I am evaluating in the IF statement.

The return string from the modify operation is blank.

The column I am testing starts with zero as the tab order and the "displayonly" property set to TRUE.

So, based on the value of the alpha column "disableinput", I either want to leave the target column displayonly=TRUE or change it to displayonly=FALSE (and give the column a non-zero tab order).

Does that make sense? What it boils down to is "how can I modify the displayonly property of a column using an IF statement which evaluates another column (which is alpha)?"

Gracias,

LR
 
Hello,

First, thanks to anyone who looked in on this question.

Second, I know what the problem is. I should have been modifying the "Protect" property, not the Displayonly property for the datawindow column.

Thanks again,

LR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top