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] Radio group reverting to default param value after selection?:

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Radio group reverting to default param value after selection?:
 Login/Join
 
Virtuoso
posted
Hey all,

So, I've re-created an HTML form that populates a report within a frame below it from 7.6.11 in 8.1.04. I had it working completely as it should, we upgraded to 8.1.05, and then I had to move it to a new Enterprise Domain (Content directory). After moving it to the new Content directory, everything is working fine save for the 2 option radio button group I have in the form.

It is a radio control with 2 columns for both static values assigned to it (Daily and Weekly), with Daily being selected initially. This control is bound to a default parameter value Default that is found in the top level report that displays below the form.

What is supposed to happen is: when the form and report combo load for the first time in the browser, the Daily option is selected and the current daily date range (start: today's date, end: today's date) is passed from the drop-downs below this radio button group to populate the report along with the other default values passed from other controls. The user then has the option to select Weekly to show the report results from a beginning of week to end of week date range instead. When the user selects Weekly, the daily date range drop-downs are disabled and the weekly date range drop-downs are enabled. They then can pick a weekly range.

What does happen is: when the form/report combo loads for the first time, everything loads correctly and the user can use the Daily date range drop-downs to select a daily range of data to view along with using any other form control without issue. But once the user tries to select Weekly, the disabling and enabling of drop-downs work fine, but no matter what the user chooses from either drop-down group (Daily or Weekly) when enabled, the default value (set to Default) gets passed for the date range (which is set to give today's date for start and today's date for end). Also, the radio buttons when clicked aren't showing that they are selected and the initially selected Daily radio button goes blank as well (thus reinforcing why the default value is passed versus having either selected). So, ultimately, both radio buttons end up showing as blank no matter how many times you try to click one of them to select an option, the default value is the only thing ever getting passed after selecting Weekly, and neither radio buttons are selectable after which.

I do have some custom Js powering the enabling and disabling of the drop-downs based on which radio option is selected (which doesn't seem to be the issue, and works despite the radio buttons not working completely). When clicking Daily, the daily drop-downs enable, and the weekly drop-downs enable after clicking Weekly even after selecting Weekly and the radio buttons go blank and Default gets passed indefinitely. It's just the part of the radio button functionality that allows for selection that isn't working.

Here is my Js code I have under the Embedded JavaScript/CSS tab (using AppStudio 8.1.05):

if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
window.setTimeout(radio1_onclick,0);
initdt();
}
function initdt() {
}
function button1_OnClick(ctrl) {
OnExecute(ctrl);
}
//Begin function radio1_onclick
function radio1_onclick(ctrl) {
var rad_val;
var i;
for (i=0; i < document.form1.whichradio.length; i++)
   {
      if (document.form1.whichradio[i].checked)
      {
         rad_val = document.form1.whichradio[i].value;
      }
   }
var x=document.getElementById("combobox2");
var xx=document.getElementById("combobox3");
var y=document.getElementById("combobox4");
var z=document.getElementById("combobox5");
//alert(rad_val);
if (rad_val == 'Weekly')
{ x.disabled = true;
  xx.disabled = true;
  y.disabled = false;
  z.disabled = false;
}
else
{ x.disabled = false;
  xx.disabled = false;
  y.disabled = true;
  z.disabled = true;
}
}
//End function radio1_onclick


"whichradio" is the name assigned the 2 radio input elements nested within the radio1 radio control element hierarchy:
<div id="radio1">  <-- radio1_onclick() assigned to this guy.
  <table>
    <label>
      <input 1 name="whichradio">
    <label>
      <input 2 name="whichradio">


Again, I don't believe the radio1_onlclick handler is the issue because that functionality is working. I did however notice when I uncomment "alert(rad_val);" within that handler and run the form and report I get the pop-up saying daily is selected initially (like it should be), but then when I click Weekly I get the pop-up twice saying Weekly is the new value both times it pops up. The first time it pops up, Weekly is visibly selected, but then I get another pop-up directly after the first one. It saying the same, but then the radio button for it goes blank. Why?! It is sooo annoying!

Does anyone here have past experience with this type of thing occurring to them at all? Or would have any advice as to what I could do to troubleshoot this issue further?

Any help would be greatly appreciated! If you need more info than what I've currently provided, please let me know and I will try and clarify/add what I can. Again, everything was working as is in the other directory (in 8.1.05), but when I moved it and updated links to another 8.1.05 directory, the radio button group failed to allow the user to make selections.

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


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
how are you calling the function radio1_onclick(ctrl). My first thought is that it is being executed twice. Can you post your HTML?


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Virtuoso
posted Hide Post
Eric,

So, after you suggesting that I may be calling the handler twice, (for some reason or rhyme) I finally thought about whether or not having the radio1_onclick handler assigned within the radio1 element's events tab for onclick, and additionally having it assigned via the Tasks panel were actually referencing the same onclick call, or were actually 2 different calls to the same. I always assumed that if I had set up the Js call within the Tasks panel, that the reference in the events tab was just an auto reference of me having done such within the Tasks panel. But maybe at some point I accidentally made that extra call somewhere.

The big question is was it me that made the 2nd call, or was it the tool? Will have to test that out later though.

But, more importantly, to what I did after thinking the above and whether that fixed it:

I went to delete the reference to the handler in the events tab of the radio1 element, and that didn't do anything. It still ran funky. So, I put that reference back in, and then went to the Tasks panel and got rid of the task that made the call to the handler. After doing that, saving the form off, and running it again, everything finally decided to play nice and work. Now everything is working again as it did before.

So, thanks Eric for getting my wheels to turn a bit more in the direction I needed them to! lol

Issue resolved.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Expert
posted Hide Post
From the distant past: [REOPENED] DS HTML Composer: onClick event for radio button. It's highly unlikely this was ever fixed.


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
Virtuoso
posted Hide Post
Interesting... Thanks for the link Francis!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
Glad to see you figured it out.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Gold member
posted Hide Post
quote:
Originally posted by CoolGuy:
Eric,

So, after you suggesting that I may be calling the handler twice, (for some reason or rhyme) I finally thought about whether or not having the radio1_onclick handler assigned within the radio1 element's events tab for onclick, and additionally having it assigned via the Tasks panel were actually referencing the same onclick call, or were actually 2 different calls to the same. I always assumed that if I had set up the Js call within the Tasks panel, that the reference in the events tab was just an auto reference of me having done such within the Tasks panel. But maybe at some point I accidentally made that extra call somewhere.

The big question is was it me that made the 2nd call, or was it the tool? Will have to test that out later though.

But, more importantly, to what I did after thinking the above and whether that fixed it:

I went to delete the reference to the handler in the events tab of the radio1 element, and that didn't do anything. It still ran funky. So, I put that reference back in, and then went to the Tasks panel and got rid of the task that made the call to the handler. After doing that, saving the form off, and running it again, everything finally decided to play nice and work. Now everything is working again as it did before.

So, thanks Eric for getting my wheels to turn a bit more in the direction I needed them to! lol

Issue resolved.


CoolGuy,

I am trying to do exactly same thing like you but could not get this to work. Where can you add this to "whichradio"

<-- radio1_onclick[) assigned to this guy.

 
Posts: 60 | Registered: March 02, 2015Report This Post
Virtuoso
posted Hide Post
WebFocusDiver,

At the top of the Properties panel in the HTML Canvas tool of AppStudio there is a dropdown/select control that allows you to navigate the HTML's DOM hierarchy tree. A lot of the time you have to use this feature to ensure you are applying properties and events to the correct elements. Find the parent div that structures your radio button grouping, and then under the events tab, you can double-click the onclick event option and a method stub will be auto created in your Js for you to implement the whichradio ID functionality. Is this what you were wondering about? Hope this helps.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
quote:
Originally posted by CoolGuy:
WebFocusDiver,

At the top of the Properties panel in the HTML Canvas tool of AppStudio there is a dropdown/select control that allows you to navigate the HTML's DOM hierarchy tree.

A word of warning about the dropdown that lets you navigate the DOM tree: If you use that dropdown, and it still does not select the control/component you need to work with, it means App Studio has glitched and lost track of that control/component.

Your options at that point are 1) Start over from scratch or 2) Hack the HTML and remove all references to that control/component from the "XML island" code.

Option 2 is not supported by IBI.


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 CoolGuy and Squatch. I think I need to start from scratch.


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report 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] Radio group reverting to default param value after selection?:

Copyright © 1996-2020 Information Builders