Hi All, I have a dropdown in maintain screen which populates the HTML table based on the value selected.There is a corresponding flag values for each values of dropdown in datasource.I want to make whole HTML table disabled (grey out) if flag value is 'Y' so that user can not interact it with further.If the flag value is 'N' the HTML Table will be active.How can I handle this in maintain?
Thanks in advance.This message has been edited. Last edited by: Kerry,
If you want to entire table to disappear use this Maintain command: Winform set Form1.HTMLTable1.Visible To 0 To make it reappear use: Winform set Form1.HTMLTable1.Visible To 1
If you want it to appear but not active use: Winform set Form1.HTMLTable1.Enabled To 0 To make it active use: Winform set Form1.HTMLTable1.Enabled To 1
Where Form1 is the name of your form, and HTMLTable1 is the name of your HTMLTable.
Mark
May 11, 2011, 02:26 AM
Shankar
HI Mark, I have some links also present in the HTML Table.I also need to disable those links as those links are still working. i.e, The colors are greyed out but on clicking the links it is performing the underlying tasks.How to disable or hide those links in HTML table in maintain?Please suggest.
I am using this in javascript after calling maintain function in which the HTML table is disabled based on the flag value of value selected in dropdown list.But this is not working and links are still executing its underlying function.Can you suggest where I am doing wrong or any alternate way to handle this?
Your original code should work if you are using plain href links. Can you post an example of the table and your javascript.
Alan. WF 7.705/8.007
May 13, 2011, 07:03 AM
Shankar
Hi Alan,
Here is the sample HTML table and code. I am using EMPDATA as datasource here.In my HTML table I have 6 columns Pin,Lastname,Firstname,Div,App,App1.Column App and App1 are having links in each row of the table.My maintain code looks like:
MAINTAIN FILE empdata
$$Declarations
Declare SelDiv / A4 ;
Case Top
Infer empdata.EMPDATA.PIN into EmpStack;
EmpStack.app/a200;
EmpStack.app1/a200;
getEmp( );
Winform Show Form1;
-* Replace the Winform Show command with the following code
-* when to display your form in a non-persistent state
-* Winform Show_And_Exit Form1;
EndCase
Case getEmp
Reposition empdata.EMPDATA.PIN ;
Stack clear EmpStack ;
For all next empdata.EMPDATA.PIN into EmpStack()
Where (DIV EQ SelDiv );
if SelDiv eq 'CORP' begin
Winform set Form1.HTMLTable1.Enabled To 0;
endbegin
else Winform set Form1.HTMLTable1.Enabled To 1;
Show( );
EndCase
Case Show
Declare (i/i4);
repeat EmpStack.foccount i = 1;
Compute EmpStack(i).app = '<A href= "" target="_blank" onclick="IWCCB(event);IWC_HTMLTable1(this,0);return false;">GENERATE REPORT</A>'
endrepeat i= i+ 1;
repeat EmpStack.foccount i = 1;
Compute EmpStack(i).app1 = '<A href= "" target="_blank" onclick="IWCCB(event);IWC_HTMLTable1(this,0);return false;">GENERATE REPORT</A>'
endrepeat i= i+ 1;
EndCase
END
I have a dropdown which contains DIV values based on which HTML table is populated.Here, Iam checking selected DIV value to enable or disable HTML table.In this sample code I have taken CORP value to disable the table.i.e If CORP is selected the whole table will be disabled else it will be enabled. Now,When the table is in disabled condition the links should also disappear from the table which I am trying to handle in javascript below:
function OnComboBox1_Change ( ) {
var oRows = document.getElementById('HTMLTable1').getElementsByTagName('tr');
var irows = oRows.length ;
IWCTrigger("getEmp");
for(i=1; i<=irows; i++){
document.getElementsByTagName("tr")[i].cells[5].style.visibility = "hidden";
document.getElementsByTagName("tr")[i].cells[6].style.visibility = "hidden";
}
}
I am bit confused whether this the right way to handle this or not.Please suggest.
Instead of just an alert you can use IWCTrigger to perform a Maintain case or anything else. This code ONLY allows the clicklink to work when the object is not disabled.
Mark
May 16, 2011, 12:18 PM
Alan B
Shankar
As before, you cannot process any javascript after an IWCTrigger. The IWCTrigger is a form submit function and any js after that will be ignored.