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] Which IbComposer function should I use to change the value of a checkbox?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Which IbComposer function should I use to change the value of a checkbox?
 Login/Join
 
Gold member
posted
I have a launch page with several checkboxes the user can use to select which systems to include when building the final report.

I have one checkbox at the top to Select/Unselect all the checkboxes (common type of control function you see everywhere).

I have a JavaScript function which is called when the Select/Unselect All checkbox is clicked which works great.

The problem I'm having is figuring out which WF8 IbComposer function will allow me to check or uncheck a checkbox in my function.

I've tried IbComposer_setCurrentSelection, but to no avail coding it like this:

var chkval = true; 
IbComposer_setCurrentSelection('mycheckbox',chkval,'false');  


In WF7 I just coded it in JavaScript like this:

  
document.getElementById("mycheckbox").checked = true;  


The old way doesn't work, so I'm hoping someone out there has done this and can set me straight on how to do this in WF8.

This message has been edited. Last edited by: Dennis_V,


Local: AppStudio 8.2.03 - Win7 - Tomcat Server: WebFOCUS 8.2.03 - Windows 2008 R2 Enterprise on VMWare 2 CPU, 3.2GHz, 4GB of RAM Output Formats: HTML, Excel, PDF, PPT, Active Reports
 
Posts: 38 | Location: Denver, CO | Registered: March 16, 2005Report This Post
Virtuoso
posted Hide Post
quote:
document.getElementById("mycheckbox").checked = true;

The above still does work in WF8.
I always use
mycheckbox0.checked = true;

The "issue" with WF8 is that if you haven't manually adjust the properties of your checkbox to name it as you wish, WF8 assign random name such as INPUT1 to the first element in the table tag.
So it's possible that your control is named "MyCheckBox" but the first element under the div tag (input) is not named the same way.
Then, when you are trying to do a "MyCheckBox0.checked = true" or anything to test the input field it doesn't work because the reference is not valid.
This issue only occurs on the first input field (true for radio and checkbox). The others are named properly such as MyCheckBox1, MyCheckBox2, ...

To see what I mean look at the properties of your control. At the top of the properties section you can see your control's name in a "drop down" box.
Click on the down arrow and you should see something such as
MyCheckBox <DIV>
  table1 <TABLE>
    MyCheckBox_LABEL_0 <LABEL>
      INPUT1 <INPUT>
    MyCheckBox_LABEL_1 <LABEL>
      MyCheckBox1 <INPUT>
   ....

Click on
INPUT1 <INPUT>
you will then be in the first element of your MyCheckBox control
Change the Unique Identifier for "MyCheckBox0"
Change The Name for "MyCheckBox"

Then you will be able to perform action such as

MyCheckBox0.checked = true

if (MyCheckBox0.checked == true)


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
Thanks Martin, you solved my problem!

My problem was I did not understand where you actually name the checkbox control.

I was using the Unique Identifier at the container level and referencing that in my Javascript.

Now I know that you use the pull-down at the top of the Properties window to get at the actual control name within the container to change it to whatever you want to use in your JavaScript.

Much appreciated.


Local: AppStudio 8.2.03 - Win7 - Tomcat Server: WebFOCUS 8.2.03 - Windows 2008 R2 Enterprise on VMWare 2 CPU, 3.2GHz, 4GB of RAM Output Formats: HTML, Excel, PDF, PPT, Active Reports
 
Posts: 38 | Location: Denver, CO | Registered: March 16, 2005Report This Post
Virtuoso
posted Hide Post
My pleasure to have helped you.

It took me a while at the beginning of WF8 to understand and find that the controls are not "created" the same way as they were in WF7.

Now, I have the habit to always renamed the controls and its children. It become also much more easy when it's time to debug.

Please update your first post then add [SOLVED] at the beginning of the subject.


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
  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] Which IbComposer function should I use to change the value of a checkbox?

Copyright © 1996-2020 Information Builders