As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a drop-down list with 3 values, based on these values, different textareas are shows. I'm getting an error when trying to parse the values. Unable to set property 'value' of undefined or null reference. on inputList.value= '';
This worked in earlier version but not 8.0.08. Here is the relevant JS:
//Begin function cleanArray
function cleanArray(originalArray){
var newArray = new Array();
for(var i = 0; i < originalArray.length; i++){
if(originalArray[i] != ""){
newArray.push(originalArray[i]);
}
}
return newArray;
}
//End function cleanArray
//Begin function parseList
function parseList(textArea){
var textAreaControl = document.getElementById(textArea);
var itemArray = textAreaControl.value.split("\n");
var whichInput = "";
switch(textArea){
case "top_assoc_area":
whichInput = "top_assoc_list";
break;
case "client_group_area":
whichInput = "client_group_list";
break;
case "chain_area":
whichInput = "chain_list";
break;
case "mid_list_area":
whichInput = "mid_list";
break;
}
var finalArray = cleanArray(itemArray);
var inputList = document.getElementById(whichInput);
inputList.value = "";
for(var i = 0; i < finalArray.length; i++){
//if(i = 0){
// inputList.value = ' "' + finalArray[i] + '" ';
//}else{
// inputList.value = inputList.value + 'OR "' + finalArray[i] + '" ';
//}
if(inputList.value == ""){
inputList.value = "" + finalArray[i].trim() + "";
}else {
inputList.value = inputList.value + "," + finalArray[i].trim() + "";
}
}
}
//End function parseList
This message has been edited. Last edited by: <Kathryn Henning>,
This looks more like a javascript issue instead of a webfocus issue. How are you passing text area into the gunction? Can you post that piece of code? Or the whole html? I would try putting an alert into the function to make sure you are getting a value passed for text area in the first place.
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 11.2.0.2
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013
In chrome press F12 to bring up developer tools, click on the console tab, refresh the procedure and hit the submit button in your procedure. Everything in the console.log(); will be output to the console tab so you can verify your code including parameters ans objects. You are able to add breakpoints in your script and then hover over the parameters to see what values they are.
All nice debugging techniques.
Hopefully below assists you.
-HTMLFORM BEGIN
<!DOCTYPE html>
<html lang="en">
<head>
<script>
//Begin function cleanArray
function cleanArray(originalArray){
var newArray = new Array();
for(var i = 0; i < originalArray.length; i++){
if(originalArray[i] != ""){
newArray.push(originalArray[i]);
}
}
return newArray;
}
//End function cleanArray
//Begin function parseList
function parseList(textArea){
-* var textAreaControl = document.getElementById(textArea);
-* var itemArray = textAreaControl.value.split("\n");
var textAreaText = document.getElementById(textArea).value;
console.log('Output for textAreaText: ' + textAreaText);
var itemArray = textAreaText.split("\n");
console.log('Output for itemArray: ' + itemArray);
var whichInput = "";
-* switch(textArea){
switch(textAreaText){
case "top_assoc_area":
whichInput = "top_assoc_list";
break;
case "client_group_area":
whichInput = "client_group_list";
break;
case "chain_area":
whichInput = "chain_list";
break;
case "mid_list_area":
whichInput = "mid_list";
break;
}
var finalArray = cleanArray(itemArray);
console.log('Output for finalArray: ' + finalArray);
}
//End function parseList
</script>
</head>
<body>
<textarea id="myTextArea">
1
2
3
4
</textarea>
<input type="button" onClick="parseList('myTextArea');" value="submit">
</body>
</html>
-HTMLFORM END
WF 8.1.05, MRE, BI Portal, App Studio, Apache Tomcat/8.0.21, MS Windows Server 2014 Express, MS Windows 10, Chrome