Created On: 23 March 2011
Problem:
Is there a way to remove an object from a web page prior to the page being submitted to the user?
Resolution:
This can be done via a Python script. In Builder, create a new Server-Side script and associate it to the onGenerate event of the object you do not want to appear on the page.The script should contain the following:
elself.fail()
For example, if you want the object to appear only if a certain text field called TEXT1 contains the value "END", then you would have the following:
import string
page = elself.getParent()
obj = page.getObject('TEXT1')
value = obj.getValue()
if string.find(value, 'END')>=0:
elself.fail()
You can find other examples or information on scripting in Builder.Select Help/Help Topics under the Web Author's Guide Chapter 4 (Scripting)
elself.fail()
For example, if you want the object to appear only if a certain text field called TEXT1 contains the value "END", then you would have the following:
import string
page = elself.getParent()
obj = page.getObject('TEXT1')
value = obj.getValue()
if string.find(value, 'END')>=0:
elself.fail()
You can find other examples or information on scripting in Builder.Select Help/Help Topics under the Web Author's Guide Chapter 4 (Scripting)
Old KB# 33745
#Rumba
#EnterpriseLink