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 added a checkbox with the name 'ABC' on HTML page. The page also contains few dropdowns too and I want if a particular value from the dropdown is selected than the name of the checkbox changes to 'XYZ'.
I'm trying to do this from JavaScript function:
function On_Click(ctrl) { var a1 = IbComposer_getCurrentSelection('List_Box'); if (List_Box = "Honda") { document.getElementById('Show_check_Box').innerHTML = "ABC"; } else { document.getElementById('Show_check_Box').innerHTML = "XYZ"; } OnExecute(ctrl) }
Can anybody please guide me what is the error in this code or Do I need to add anything more in this code?
Thank you in advance.This message has been edited. Last edited by: MeM,
You can create a task. Or you can click on your list box, then go to the Properties panel and click the yellow lightning bolt. Then you will see all the events for your list box. One of them should be the click event. You can type the name of your function there.
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
You also mention that you you need to change the "name" but then refer to "innerHTML" within the JavaScript.
Which is it meant to be? because they are not the same attribute. "name" will affect the variable name passed to WebFOCUS e.g. &ABC or &XYZ, whereas the "innerHTML" would affect the value passed.
That being said, if you are actually talking about a checkbox then check your understanding of what the "innerHTML" for a checkbox is!
Or are you talking about the label applied to a checkbox?
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
I do not recommend working with the label in the checkbox. You cannot easily get to it because it is inside an HTML input tag, which is in turn inside a small HTML table which allows for multiple checkboxes. The ID of the checkbox is actually an HTML div tag that surrounds this table.
Instead, click on the checkbox and blank out the default checkbox label in the Settings panel. Then select a standalone "Label" under the Components tab. Place this label next to your checkbox. Then you can change it with "innerHTML" like you have in your example.
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
I created a list box ("listbox1") with three selections: Honda, Mazda, Toyota.
I created a label ("label1").
I created a checkbox ("checkbox1"). I placed the label to the left of the checkbox.
If the selection is Honda, the label changes to ABC. If the selection is not Honda, it is XYZ.
I clicked on the list box and then in the Properties panel I clicked the yellow lightning bolt. I clicked on the right side of the "Value Changed" event and HTML Composer created the function "listbox1_onchange" automatically.
if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
//Begin function window_onload
function window_onload() {
UpdateData();
set_label();
}
function listbox1_onchange(event) {
set_label();
}
function set_label() {
var a1 = IbComposer_getCurrentSelection("listbox1");
if (a1 == "Honda")
{
document.getElementById("label1").innerHTML = "ABC";
}
else
{
document.getElementById("label1").innerHTML = "XYZ";
}
}
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015