Focal Point
Placing 'SELECTED' in html

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1851082822

May 16, 2007, 05:00 PM
Code Digger
Placing 'SELECTED' in html
Hi,

I am trying to load an HTML page which has a list box. Since the values in list are hard coded I am creating the

but after running the html it was not coming highlighted and when I did a view source I could see the statement as it is i.e. !IBI.AMP.V_SEL; did not get replaced with 'selected'.

Am I missing something here??

Thanks
May 16, 2007, 05:05 PM
Code Digger
read it as

{option value = "abc" selected} "abc" {/option}
please ignore curly braces
May 17, 2007, 03:01 AM
Alan B
CD
have never known an !IBI.AMP.var; to fail, so have to check the real basics.

When you say you are loading an HTML page, you do mean with -HTMLFORM in a fex? If the &var has not been set you would, at least, expect a couple FOC error messages.

Or this could happen if you use
-SET &select='!IBI.AMP.select;';
in your code.

Apart from that I can't think.

BTW, if you want to display HTML, select the Options link and tick Disable HTML.
<option value = "abc" selected> "abc" </option>


Alan.
WF 7.705/8.007
May 17, 2007, 02:26 PM
Code Digger
Hi Alan,

I am setting the variable in a Fex file (which then calls the HTML file) and using that &variable in html using !IBI.AMP.VARNAME;

This variable is basically used to write the word 'selected' in the option tag. But the code !IBI.AMP.VARNAME; is not replacing itself with 'selected' when fex calls the html.

I know this can be handled through Javascript but using & var is easier I guess.

Thanks,
CD
May 17, 2007, 02:53 PM
Kamesh
Tried the below code and it works fine in 716 version.

-SET &VAR='SELECTED';

-HTMLFORM BEGIN
<HTML>
<BODY>
<FORM NAME="FRM">
<SELECT NAME="TT">
<OPTION VALUE="YY">YY</OPTION>
<OPTION VALUE="XX">XX</OPTION>
<OPTION VALUE="ZZ" !IBI.AMP.VAR;>ZZ</OPTION>
</SELECT>
</FORM>
</BODY>
</HTML>
-HTMLFORM END


WFConsultant

WF 8105M on Win7/Tomcat
May 17, 2007, 03:04 PM
Francis Mariani
What is the name of your variable?

And you're not coding it as: !IBI.AMP.&VARNAME;


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
May 17, 2007, 04:13 PM
Fernando
Code Digger,

Try the other syntax < !-- WEBFOCUS VAR V_SEL -->

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
May 17, 2007, 05:04 PM
Francis Mariani
Sorry Fernando, but that is old-style, probably-will-not-be-supported syntax.


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
May 18, 2007, 04:12 AM
Alan B
CD
Had a check this morning and can find nothing to stop an &variable being evaluated with !IBI.AMP.var; as long as the HTML page is directly passed through WebFOCUS with -HTMLFORM.

Can you provide an extract of your code.


Alan.
WF 7.705/8.007