Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Passing parameters between html page

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Passing parameters between html page
 Login/Join
 
Member
posted
Hi,

I need anyone's assistance in accomplishing this task. What I'm doing is trying to pass HTML form object values from one HTML file to another from

I have combo box control with static values in PAGE1 & Similarly there is another combo box in PAGE2
user choose values from in PAGE1 should reflect with the same value in PAGE2 .

I have tried using the query string passing the control values through link below is code
Gives me an error not able to locate the PAGE2


On page1.html

function onClickHandler(){
location.href = 'page2.html?name=' + document.getElementById('combobox').value;

// Try using Full path
// /location.href = "http://isdbasisdev/HTML_Form.htm?Rand=" + document.getElementById('combobox').value;

}

then on page2.html

function parseQueryString()
{
var queryDict = {}
location.search.substr(1).split("&").forEach(function(item) {
queryDict[item.split("=")[0]] = item.split("=")[1]
});

return queryDict;
}

function onLoadHandler(){
document.getElementById('combobox').value = parseQueryString().name;
}


~Ravi

This message has been edited. Last edited by: <Emily McAllister>,


7.6.10
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus
ETL 7.6.10
SQL Server 2000 / 2008
DB2 ,Oracle
 
Posts: 5 | Location: Dallas,TX | Registered: July 09, 2010Report This Post
Expert
posted Hide Post
I'm not going to bother to debug your JavaScript code that assembles and splits the name/value pairs, but are your properly referencing the html file?

Where are "page2.html" and "HTML_Form.htm" located? If they're on the web server, then the href should include the web alias to the folder. If they're in a WebFOCUS repository, the href is definitely not a simple refernce to the file only.

And, I don't see any WebFOCUS related code in your post.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
quote:
On page1.html

function onClickHandler(){
location.href = 'page2.html?name=' + document.getElementById('combobox').value;

// Try using Full path
// /location.href = "http://isdbasisdev/HTML_Form.htm?Rand=" + document.getElementById('combobox').value;

}

then on page2.html

function parseQueryString()
{
var queryDict = {}
location.search.substr(1).split("&").forEach(function(item) {
queryDict[item.split("=")[0]] = item.split("=")[1]
});

return queryDict;
}

function onLoadHandler(){
document.getElementById('combobox').value = parseQueryString().name;
}


~Ravi




Francis,

Thank you for quick response .

I have created html document PAGE1 & PAGE2 using App studio with combo box control in each with static fields on different HTML page

At this point trying to link between pages as user choose values from PAGE1 (On click) should reflect with the same value in PAGE2 & they are running on the server

On page1.html

function onClickHandler(){

location.href = "http://isdbasisdev/PAGE2.htm?Rand=" + document.getElementById('combobox').value;

}

then on page2.html

function parseQueryString()
{
var queryDict = {}
location.search.substr(1).split("&").forEach(function(item) {
queryDict[item.split("=")[0]] = item.split("=")[1]
});

return queryDict;
}

function onLoadHandler(){
document.getElementById('combobox').value = parseQueryString().name;
}


~Ravi


7.6.10
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus
ETL 7.6.10
SQL Server 2000 / 2008
DB2 ,Oracle
 
Posts: 5 | Location: Dallas,TX | Registered: July 09, 2010Report This Post
Silver Member
posted Hide Post
Hi Ravi

Try to using the following rather than document.getElementById:

IbComposer_getCurrentSelection('controlID', [layer]);

where:
controlID
Alphanumeric
Is the unique identifier of the control from which values are obtained.
layer
Integer
Is an optional parameter used to specify the layer number in a multi source Tree control
if a Multi source Tree control is being used. The layer number starts with 1 for the first
layer.
Example: Getting the Current Selected Value for a Drop Down List
function button1_onclick(ctrl) {
var values = IbComposer_getCurrentSelection('combobox1');
for(var I = 0; i < values.length; i++)
alert(values[i]);

You can also use PARENT in the IbComposer_get...
command and reference the first HTM page.

Best of Luck
Barry Solomon


WebFOCUS 8
Windows, All Outputs
 
Posts: 34 | Registered: September 08, 2015Report This Post
Expert
posted Hide Post
quote:
location.href = "http://isdbasisdev/PAGE2.htm


This is not a valid href for an html file within the WebFOCUS environment.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
A rudimentary, but working example. The two files are stored in the WF Repository. These files were not created by a GUI tool.

fmtest1.htm
 <!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">

<title>fmtest1</title>

<script>

function onClickHandler()
{
    //alert(document.getElementById('combobox').value);
    location.href = '/ibi_apps/views.bip?BIP_REQUEST_TYPE=BIP_RUN&BIP_folder=IBFS:/WFC/Repository/Test/FrancisMariani&BIP_item=fmtest2.htm'
    + '&name_value=' + document.getElementById('combobox').value;
    + '&name_text=' + document.getElementById('combobox').text;
}

</script>

</head>

<body>

<h1>fmtest1.htm</h2>

<select size="10" id="combobox" onclick="onClickHandler();" style="width: 100px;">
    <OPTION VALUE='alex'>Alex</OPTION>
    <OPTION VALUE='bill'>Bill</OPTION>
    <OPTION VALUE='carla'>Carla</OPTION>
</select>

</body>

</html>

fmtest2.htm
 <!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">

<title>fmtest2</title>

<script>

function parseQueryString()
{
    var queryDict = {}
    location.search.substr(1).split("&").forEach(function(item)
    {
        queryDict[item.split("=")[0]] = item.split("=")[1]
    });

    return queryDict;
}

function onLoadHandler() {
    document.getElementById('combobox').value = parseQueryString().name_value;
}

</script>

</head>

<body onload="onLoadHandler();">

<h1>fmtest2.htm</h2>

<select size="10" id="combobox" onclick="onClickHandler();" style="width: 100px;">
    <OPTION VALUE='abel'>Abel</OPTION>
    <OPTION VALUE='alex'>Alex</OPTION>
    <OPTION VALUE='bill'>Bill</OPTION>
    <OPTION VALUE='bob'>Bob</OPTION>
    <OPTION VALUE='carla'>Carla</OPTION>
    <OPTION VALUE='carol'>Carol</OPTION>
</select>

</body>

</html>

As Barry suggests, if you're using the GUI to create your HTML pages, you should use the so-called API calls to manipulate the elements.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Passing parameters between html page

Copyright © 1996-2020 Information Builders