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     [SOLVED]Webfocus 8.1 HTML page help needed

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Webfocus 8.1 HTML page help needed
 Login/Join
 
Gold member
posted
Hi,

I'm trying to add a situation to the html page. If certain values in the dropdown is selected then checkbox A should appear otherwise checkbox B should appear. Can anybody please suggest, how this can be done?

Thanks in advance.

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


WebFOCUS 8.2.02
Windows, All Outputs
 
Posts: 95 | Registered: May 16, 2016Report This Post
Master
posted Hide Post
In my example, the dropdown has a unique identifier of "combobox1". Next to it are two checkboxes, identified as "checkbox1" and "checkbox2". Both checkboxes occupy the same position on the HTML page (i.e., they are on top of each other).

Here are the choices in my dropdown:

Apple
Lemon
Lettuce
Pear
Radish
Tomato

Three of these are fruits, and three are vegetables (Okay, okay, I'm going to make "Tomato" a vegetable, even though it is considered a fruit). When a fruit is selected, checkbox1 (A) shows "Deliver Fruit?". When a vegetable is selected, checkbox2 (B) shows "Deliver Vegetable?".

Here is the embedded JavaScript code to show the correct checkbox for the dropdown:

// After HTML page loads, show the correct checkbox
function combobox1_ononafterload(ctrl) {
    show_checkbox();
}

// When dropdown choice has been changed, show the correct checkbox
function combobox1_onchange(event) {
    show_checkbox();
}

// Code to determine which checkbox should appear
function show_checkbox() {
    document.getElementById("checkbox1").style.display = "none";
    document.getElementById("checkbox2").style.display = "none";

    var a = document.getElementById("combobox1");
    var choice = a.options[a.selectedIndex].value;

    if ( choice == "Apple" ||
         choice == "Lemon" ||
         choice == "Pear" ) {
            document.getElementById("checkbox1").style.display = "block";
         }
    else {
            document.getElementById("checkbox2").style.display = "block";
    }
}


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Gold member
posted Hide Post
Thank you Squatch. Is there any way, I can just do without writing the code?
 
Posts: 95 | Registered: May 16, 2016Report This Post
Master
posted Hide Post
quote:
Originally posted by MeM:
Thank you Squatch. Is there any way, I can just do without writing the code?

I can't think of a way right now, maybe someone else knows how.

I assume you are using App Studio because you are on WebFOCUS 8.1. There is an Embedded JavaScript/CSS tab at the bottom of App Studio. As long as your controls are named the same as in my example, you should be able to paste the code in that place after any code that is already there (And making any logic changes needed to match your needs -- your dropdown will have different values, of course).

If the names of your controls are different, just replace all references to combobox1, checkbox1 and checkbox2 to whatever the names of your controls are.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Virtuoso
posted Hide Post
Except if someone know something really hot about GUI, you won't have choice to code MeM.

This is where programmers start their job Music


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Thank you Squatch and Martin.
 
Posts: 95 | Registered: May 16, 2016Report This Post
Master
posted Hide Post
With GUI - Tasks and Animation, you can control visibility of elements with onchange event of list box.

Since you need to control based on value selected, only option is to use javascript code.

Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Gold member
posted Hide Post
Thank you Ram.


WebFOCUS 8.2.02
Windows, All Outputs
 
Posts: 95 | Registered: May 16, 2016Report 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     [SOLVED]Webfocus 8.1 HTML page help needed

Copyright © 1996-2020 Information Builders