Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] HTML multi-layered radio button
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] HTML multi-layered radio button
 Login/Join
 
Member
posted
I'm attempting to create a Radio button in a HTML report that enables other controls conditioned on which button value is selected. For example, if the options on my radio button are 'CustomerID', and 'All CustomerID', I'd like an edit control to pop up when 'CustomerID' is selected, so I can manually type in a CustomerID. 'All CustomerID' would default to include all IDs. I've been able to do this in the text editor version of my report as seen below.

-IF &CUSTOMERID EQ _FOC_NULL THEN GOTO ALLCUST ELSE GOTO CUST;
-CUST
WHERE ORDERS.ORDERS.CUSTOMERID EQ '&CUSTOMERID';
-ALLCUST

How do I replicate this in HTML? Thanks

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 13 | Registered: August 28, 2019Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You have several options depending on your ability on coding.

In your HTML canvas/composer add your radio button (to select either All or specific customer) and a text box (for customerID entry)
Then using either radio button Event handler or Task/Animations control the display or not of the entry control field and its value

Could be as simple as per below. In a domain, create a new Text Editor, paste below code then save as .htm type file
<!DOCTYPE html>
<html><head><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="mycharsetmeta" http-equiv="Content-Type" content="text/html; charset=WINDOWS-1252"><meta name="Generation" content="Created in release 8204, Generation 4"><meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <!-- Copyright 1996-2013 Information Builders, Inc. All rights reserved. -->
    
<script type="text/javascript">
//confidential_id=IBI_OptionsScript
var bRuntime=true;var szHtmlAlias="./ibi_html/";var is_mobile="false";var loadingscreen="";var ib_composer="ib_composer";var emf="ib_composer_emf";var ibiOptions = new Array(ib_composer);document.write('<script src="'+szHtmlAlias+'ibigbl.js" type="text/javascript"><\/script>');</script><script type="text/javascript">
//confidential_id=IBI_ibigblloadCss
if(typeof ibigblloadCss != 'function'){alert("JavaScript alias '"+szHtmlAlias+"'  is not valid.");window.location("about:blank");}</script><title>HtmlPage</title><style type="text/css">.internal_default {
 }
 </style><script type="text/javascript">
//confidential_id=clientEventHandlersJS

if(typeof(bRuntime) != 'undefined') {
}
function window_onload() {
  UpdateData();
}
function onInitialUpdate ()
{
  IbComposer_showHtmlElement('CUSTOMERID', 0);
}
function radio1_onchange(event) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
  if (radio10.checked == true)
  {
    IbComposer_showHtmlElement('CUSTOMERID', 0);
    CUSTOMERID.value = '';
  }
  else
    IbComposer_showHtmlElement('CUSTOMERID', 1);
}
</script><!--//confidential_id=focus_xmlelement
<rootxmlnode focoption="_FOC_NULL" nextelementuniquenumber="2"><html_elements><html_body thumbnailscale="4" dynamic_lang="en" use_appl_css="no" maximum_number_saved_sets="25" checkserveraccess="yes" maptype="0" mobiledocument="no" loadiniframe="yes" responsivedesign="no" dtnewcont_margin="2" autofitchildren="no" dynamic_lang_default="en" edaconnectionrequired="false" ibiapp_app="" ismre="1" ibif_ex="/WFC/Repository/IT/HtmlPage1.htm"><html_event eventname="load" eventhandlername="window_onload"/><layer name="default"/>
</html_body><html_element bindcontrolid="radio1" layername="default" elementtype="12" columns="1" groupChildren="1" inputcontrol="1" defaultlocation="30,30,80,152" onetimepopulated="0" myviewonautofit="dontyouever" defaultselection="1"><link linktype="default" persistentuniqueid="compUid_1"><condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0"><data_info datatype="0" sourcetype="typeMaster" selectedvalue=""><static_values><static value="A" display="All Customers" selected="1" noinput="0"></static><static value="S" display="Specific Customer" selected="0" noinput="0"></static></static_values></data_info></condition></link><html_event eventname="change" eventhandlername="radio1_onchange"/></html_element><html_element bindcontrolid="table1" layername="default"/><html_element bindcontrolid="radio10" displaytext="Value1"/><html_element bindcontrolid="CUSTOMERID" layername="default" elementtype="7" inputcontrol="1" defaultselection="1" controltype="7" onetimepopulated="0"><link linktype="default" persistentuniqueid="compUid_2"><condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0"><data_info datatype="0" sourcetype="typeMaster"></data_info></condition></link><data_info/></html_element><html_element rtFileName="htmlpathsub/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/default_theme.css" type="cssfile"/><html_element rtFileName="htmlpathsub/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/bip-neutral.css" bindcontrolid="IBI_THEME_CSS" desc="Neutral" type="cssfile"/></html_elements><variables></variables><requests></requests><tasks><task id="load" trigger="load"/></tasks><animations></animations></rootxmlnode>
--></head>
<body class="IBI_PageBg" data-usepopupcontrols="no"><div class="IBI_DesktopContainer IBI_temp_unselect" style="display: none;"><div tabindex="1" class="IBI_ReportControlTarget IBI_Radio internal_default" id="radio1" style="border: currentColor; border-image: none; left: 30px; top: 30px; width: 120px; height: 50px; position: absolute; z-index: 1;" contenteditable="false"><table class="IBI_ReportControlTarget IBI_Radio internal_default" id="table1" cellspacing="0" cellpadding="0"><tbody><tr><td nowrap=""><label class="internal_default" id="radio1_LABEL_0" style="cursor: default;" for="radio10"><input tabindex="1" id="radio10" type="radio" checked="" value="A" displaytext="All Customers" name="radio1">All Customers
</label></td></tr><tr><td nowrap=""><label class="internal_default" id="radio1_LABEL_1" style="cursor: default;" for="radio11"><input tabindex="1" class="internal_default" id="radio11" type="radio" value="S" displaytext="Specific Customer" name="radio1">Specific Customer</label></td><td nowrap=""></td></tr></tbody></table></div><input tabindex="2" class="IBI_ReportControlTarget IBI_rounded_s internal_default" id="CUSTOMERID" style="left: 160px; top: 50px; width: 170px; position: absolute; z-index: 2;" type="text" name="CUSTOMERID"></div></body></html>
<!-- cc kppp -->


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: 2290 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Guru
posted Hide Post
Does it have to be a radio button? Why can't you have a regular dropdown box and add the "All" option to it?


Webfocus 8
Windows, Linux
 
Posts: 254 | Location: Palm Coast, FL | Registered: February 05, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Could also be, but from what I understand there is only two choices : All or Specific CustID.
And when the second is selected ModGuy wants to have an entry box to provide the CustId and not a list of all CustID

But your option is also valid if you want to provide a list of all CustID from which you pick from


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: 2290 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] HTML multi-layered radio button

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.