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     [CLOSED] passing variable from html to fex

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] passing variable from html to fex
 Login/Join
 
Silver Member
posted
How to pass a variable form html hidden to fex sql passthru


While using dynamic drop down on select of first dropdown the value of firstdown or variable should be assigned to the second dropdown using sql passthru

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


WebFOCUS 7.6.x
Windows
Output: Excel,PDF, HTML
 
Posts: 42 | Registered: September 28, 2007Report This Post
Virtuoso
posted Hide Post
Sorry, I do not quite understand what you are saying.

Any variable from the html page, including te selected value of a dropdown box, is available in the fex that is called as &-variable.

If this is not the answer to your question, please explain a bit more.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
Shakila,

If I understood correctly that you are trying to create a dynamic dropdowns and filter the second dropdown values based on the selected value in the first dropdown. Here is one way that you could use to create the dynamic nature

TABLE FILE CAR
PRINT CAR
BY COUNTRY

ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
DEFINE FILE HOLD1
TST/A100 = '"' ||COUNTRY || '"';
OPTION2/A100='GROUP.options[GROUP.options.length] = new Option(' | '''' || CAR || '''' ||','|'''' || CAR || '''' || ');' ;
END
TABLE FILE HOLD1
SUM OPTION2 AS ''
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON COUNTRY SUBHEAD
"if (s ==")"
"{"
"GROUP.options[0] = new Option('ALL','ALL');"
ON COUNTRY SUBFOOT
"}"
ON TABLE HOLD AS CARLIST FORMAT WP
END

the above code holds values with javascript. Now on your HTML side you can use the javascript script as below

function Loadgroup(s)
{
var GROUP = document.form1.GROUP;
GROUP.options.length = 1;
!IBI.FIL.CARLIST;
}



If you are using SQLPASS thru instead of TABLE FILE you can still pass the variables to it as GAMP mentioned

RAO

This message has been edited. Last edited by: Rao D,


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

 
Posts: 104 | Location: Indianapolis | Registered: November 08, 2007Report This Post
Platinum Member
posted Hide Post
and call the function in html code


SELECT name="COUNTRY" id="country"   style="FONT-SIZE: 8pt; font-family: tahoma; WIDTH: 80px "  OnChange="Loadgroup[this.options[this.selectedIndex].text)
;"

This message has been edited. Last edited by: Rao D,


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

 
Posts: 104 | Location: Indianapolis | Registered: November 08, 2007Report This Post
Virtuoso
posted Hide Post
If you post code, whatever code, put it between the code and /code tags, to be found by clicking the '< / >' icon when you post a reaction.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
Hi Rao,
can you please specify how to pass variable in where clause

Thanks in advance


WebFOCUS 7.6.x
Windows
Output: Excel,PDF, HTML
 
Posts: 42 | Registered: September 28, 2007Report This Post
Platinum Member
posted Hide Post
GAMP, Thanks for the suggestion I tried using '< !-- -->' but didn't work next time I will go with quotes ''.

Shakila, There are many ways to do this if you are getting multiple values from listbox and if you have your where clause is in FOCUS request then here is one way
'WHERE COUNTRY EQ &COUNTRY.(OR(FIND COUNTRY IN CAR)).COUNTRY.;'

The above code will be generated when you are using GUI to add a filter

if your where clause is in SQLPASS then this is one way

-*to replace "OR" with "," and to truncate spaces
'-TYPE COUNTRY -- &COUNTRY
-SET &COUNTRY = STRREP(&COUNTRY.LENGTH,&COUNTRY,4,' OR ',1,',',&COUNTRY.LENGTH,'A&COUNTRY.LENGTH') ;
-SET &COUNTRY = TRUNCATE(&COUNTRY) ;
-SET &CNTRY = '(' |&COUNTRY |')' ;
-SET &CNTRY = TRUNCATE(&CNTRY);
-TYPE CNTRY -- &CNTRY
-SET &COMPARE = TRUNCATE(&COUNTRY);
-SET &COMPARE = CTRAN (&COMPARE.LENGTH,&COMPARE,39,32,'A&COMPARE.LENGTH');
-SET &COMPARE = STRIP(&COMPARE.LENGTH,&COMPARE,' ','A&COMPARE.LENGTH') ;
-SET &COMPARE = TRUNCATE(&COMPARE);
-TYPE COMPARE -- &COMPARE;

-SET &SQLCNTRY = IF '&COMPARE.EVAL' EQ 'FOC_NONE' THEN ' ' ELSE 'AND COUNTRY IN ' | &CNTRY ;

-TYPE SQLCNTRY -- &SQLCNTRY ; '

Here you need to place this "&SQLCNTRY" variable in your SQL query

the input string for variable &COUNTRY will look like " 'ENGLAND' OR 'FRANCE' OR 'ITALY' "
and the output string for variable &SQLCNTRY will look like
" AND COUNTRY IN ('ENGLAND','FRANCE','ITALY') "

There are plenty of talented people on this forum who might suggest you in better way than me.

Rao.


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

 
Posts: 104 | Location: Indianapolis | Registered: November 08, 2007Report This Post
Expert
posted Hide Post
Rao,

You can also edit previous posts by clicking on the relevant icon immediatley below the post in question. It would be good to go back and edit your posts so that we don't keep getting javascript errors.

You also didn't get the point from GamP, he suggested using [code ] and [/code] either side of your code (without the space).
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, 2004Report This Post
Platinum Member
posted Hide Post
Got IT!
Will follow! Smiler

Thanks TonyA and GamP


Rao.


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

 
Posts: 104 | Location: Indianapolis | Registered: November 08, 2007Report 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     [CLOSED] passing variable from html to fex

Copyright © 1996-2020 Information Builders