Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
browser field
Rukmini
hi
Is there a way to set the <browser> field to readonly in Teamsite 6.1
Thanks
Rukmini
Find more posts tagged with
Comments
Adam Stoller
can you elaborate on the issue you're trying to resolve?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Rukmini
i have a field in the DCT
<item name="Diagrams_1" pathid="Diagrams_1">
<label>(Diagrams)</label>
<description/>
<browser extns=".gif,.jpg" initial-dir="/templatedata/images" />
</item>
I want to disable the textfield so that the user selects the images only using the browse button
Thanks
Rukmini
screen057.png
screen058.png
Adam Stoller
I believe you can set the textfield to be read-only via FormAPI on initialization - and that should do the trick.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
The browser entity includes the text input field. You could write an API which causes the field to clear (or an alert to pop up, etc., etc.) when a user clicks on / types in / changes that field without the browser button populating it.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K
Rukmini
When i try to to do it through formapi it throws an exception
Rukmini
Migrateduser
Could you be more specific about the exception it throws? You may have an error in your accessor string.
Rukmini
This is what i do in my javascript
var PROMAP1 = ROOT_ITEMS[0].getName() + "/" + "Process_Mapping_1";
if (PROMAP1!=null)
{
var ProMap_fld = IWDatacapture.getItem(PROMAP1);
ProMap_fld.setReadOnly(true);
}
Migrateduser
That looks like it ought not fail even if PROMAP1 didn't point to a valid item, since you're testing for null. What's the specific exception being thrown, and which line is it throwing it on? Are you sure ROOT_ITEMS[0] is valid?
Rukmini
Root item is valid it just terminates the javascript and since i am calling it in the init it just shows there is a javascript error and loads the DCT
Migrateduser
If you turn on javascript debugging, it should give you a better error and an exact line number.
In IE, this is in Tools > Internet Options > Advanced
You have to uncheck "Disable Script Debugging"
Adam Stoller
This code does not seem to bear any resemblence to the code you posted previously - in which you didn't indicate anything about the browser being used within a replicant.
If you don't provide us all of the pertinent information - how do you expect us to diagnose your problems?
So - let's start this over again:
1) You're using TS6.1 - is it 6.1 or 6.1SP1 ?
2) What platform?
3) Can you provide a streamlined DCT that can be used to replicate the problem?
4) If you're using FormAPI (which I believe you must for what you want to do) - please provide that code too - either embedded within the DCT or as a separate file (whichever way you are referencing it within the DCT)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Rukmini
The javascript exception i get is object doesnt support this property
Migrateduser
And what line are you getting it in? Ghoti's idea is best... we need better context to figure out what's going on for you.
Rukmini
I am using teamsite 6.1
In my DCT i am calling a javascript function where i set the browser field to readonly
here is the DCT code
?xml version="1.0" encoding="UTF-8"?>
<data-capture-requirements
dtd-system-identifier="none" name="">
<ruleset name="dct">
<root-container location="Billing_Information" name="Billing_Information">
<item name="Process_Mapping_1" pathid="Process_Mapping_1" required="t">
<label>(Process Mapping) </label>
<description/>
<browser extns=".gif,.jpg" initial-dir="/templatedata/images" />
</item>
</root-container>
<script language="javascript" location="template-type" src="../info.js"/>
</ruleset>
</data-capture-requirements>
java script code
var ROOT_ITEMS = IWDatacapture.getRootItems();
var PROMAP1 = ROOT_ITEMS[0].getName() + "/" + "Process_Mapping_1";
var ProMap_fld = IWDatacapture.getItem(PROMAP1);
if (ProMap_fld!=null)
{
ProMap_fld.setReadOnly(true);
}
function init() {
var ProMap_fld = IWDatacapture.getItem(PROMAP1);
if (ProMap_fld!=null)
{
ProMap_fld.setReadOnly(true);
}
}
IWEventRegistry.addFormHandler("onFormInit", init);
I am getting the javascript error on setReadonly
here is the entire process
Thanks Rukmini
ClassisSampleReport.rptdesign
TestVendorResponses.rptdesign
Migrateduser
It executes fine for me. I made two minor changes just for ease of use on my system. I put info.js in the same dir so the path to it was just:
<script language="javascript" location="template-type" src="info.js"/>
and I set the initial-dir on the browser to /templatedata since I don't have an images directory. There is one little oddity that I experience.
If I run it exactly as you have it, not only is the text field next to the browse button readonly, but the button itself doesn't show. If I comment out your first setReadOnly, then I get a grey field with a usable browse button, which I believe is what you were going for. I'm using 6.1sp1 on w2k3 with IE6 on w2k as the client.
Rukmini
I have the same settings but my browser field is enabled.
when i comment setReadonly then my rest of the form works fine
Rukmini
The datacapture6.0.dtd does not support readonly property for browser fields is there a workaround for that