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.
On my launch page I have two radio butons and one combo box. When radio1 is clicked I want the datasource for the combobox to be tblemployees but it radio2 is clicked I want the datasource for the combobox to be tbladdresses. How do I change the datasource for the combobox on the click event of the radio buttons? Or is there another way of doing this?
Theorectically you could change the various attributes on your SELECT tag as required and then call the IB javascript function that is responsible for the dynamic nature of the HTML.
However, it may be easier for you to have two SELECT tags and use your "onclick" event to make the one you want visible (and the other hidden) using style attributes. To ease your coding and the variable values you pass from your HTML form, you might want to have seperate variable names for each of your SELECT tags and deal with the differences within your called fex.
If I get time then I'll try and knock up an example for you.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
<SCRIPT type=text/javascript>
// Show or hide the source
// depending upon the radio button selected
function showsrce(btn) {
if (btn==1) {
showItem = document.getElementById("ITEM5");
this.showItem.style.visibility = "visible";
showItem = document.getElementById("ITEM6");
this.showItem.style.visibility = "visible";
showItem = document.getElementById("ITEM7");
this.showItem.style.visibility = "hidden";
showItem = document.getElementById("ITEM8");
this.showItem.style.visibility = "hidden";
} else {
showItem = document.getElementById("ITEM5");
this.showItem.style.visibility = "hidden";
showItem = document.getElementById("ITEM6");
this.showItem.style.visibility = "hidden";
showItem = document.getElementById("ITEM7");
this.showItem.style.visibility = "visible";
showItem = document.getElementById("ITEM8");
this.showItem.style.visibility = "visible";
}
}
</SCRIPT>
and add your onclick events to your radio buttons -
onclick="showsrce(1);"
remembering to change the value being passed for the second radio button.
When you click each radio button on the HTML page the JavaScript function will be called with a value. The if statement evaluates the condition that the value (btn) being equal to 1 is true (the double == is correct) and hides the relveant controls accordingly.
Good luck.
TThis message has been edited. Last edited by: Kerry,
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Thank you soo much. I have a question. I need both Comboboxes to be named "Employee" because in my report it is looking for the "employee" parameter. Is that ok? the id names will be different but the names will be the same.
Everything appears to be workining except for my radio button onclick events. When I click on the first radio button it works then when I click on the second radio button. Nothing happens. I checked the value of BTN and it appears to retain the value of 1 regardless of which button i click. I did make sure I changed the second button to onclick=showsrce(2);
Are you sure that you have the double equals sign in the JavaScript IF? This is a required syntax and if there is only one then that would explain the non changing state.
If you want to make sure that the values are being passed then you can add
alert(btn);
immediately after the function line and that will show you the value passed in the onclick event.
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Also I did the alert and its passing only the same value on each click even though i am clicking a different radio button. Maybe I have my radio buttons set up wrong.
I have one radio1 then two radio1_0 and radio1_1 inputs. I put the onclick events under the radio1_0 and radio1_2.
When you clickon these radio buttons is the value changing for your btn variable. I copied the code and clicked on the buttons and it is just displaying value 0.
I see your posts have been changed but recalling the one I saw just I left work - I think your problem was how you were using the passed value in your JavaScript.
You had "function ITEM2_onclick(ctrl) {" in your code but then referred to the passed value as "btn" instead of "ctrl".
However, I'm glad you managed to get it working.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004