cancel
Showing results for 
Search instead for 
Did you mean: 

HTMLB classlib question...

Former Member
0 Kudos

Hi, I have a question relating to the HTMLB library,

Currently my iView JSP has:

<b><hbj:link

id="link1"

text="Link to google"

reference="http://www.google.com"

target="_TOP"

tooltip="this takes you to: http://www.google.com";

onClick="LinkClick"

/></b>

If I wanted to add the fontSize attribute, how can I do this? I know I have to use the java command "setFontSize (LinkFontSize.fontsize)", but where would I do this? I currently have a JSPDynPage.java that does calls my jsp's is this where I am suppose to put code?

Or do I have to create entire page in Java code(servlet?) or I can create the JSP page, and then in Java use the attribute-changing methods like above?

I am a beginner in all of this and would greatly appreciate any code examples or suggestions you may have. Thank you for your help and patience.

Thank you very much,

Baggett.

Accepted Solutions (1)

Accepted Solutions (1)

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

I think you're missing your import at the top?

<%@ page import ="com.sapportals.htmlb.enum.LinkFontSize"%>

Hope this helps,

Marty

Former Member
0 Kudos

Your answer for this question is in your following forum post.

/thread/44380 [original link is broken]

Former Member
0 Kudos

Thank you Marty ! My portal server is down right now, I will try this when it comes back up. I will get back to you if I have any issues!

Thanks again,

Baggett

Former Member
0 Kudos

Hi, I'm trying to make the font size 16px, how can I do this? I am trying:

<% LinkFontSize size = new LinkFontSize("16");

link1.setFontSize(size);%>

I see that there is a constructor available but it is protected, how would I be able to use it?

Thanks so much!

Baggett.

Former Member
0 Kudos

Hi, I actually posted this question on "How to set font size... ", if you have time, you can check it out, it would be greatly appreciated!

Thanks for your tremendous amount of great help!

Baggett.

Answers (1)

Answers (1)

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Baggett,

I dont think fontSize is an attribute for an HTMLB textView control (although I may be wrong).

<hbj:link 
id="link1" 
text="<FONT size=3>Link to google</FONT>" 
reference="http://www.google.com" 
target="_TOP" 
tooltip="this takes you to: http://www.google.com" 
onClick="LinkClick" 
encode="false"
/>

To answer your other question, you can use the java commands you reference in a jsp like such:

link1.setOnClick("LinkClick");

Hope this helps,

Marty

Former Member
0 Kudos

Hi Marty, thank you for your reply! I tried this:

<b><hbj:link

id="link1"

text="Link to google"

reference="http://www.google.com"

target="_TOP"

tooltip="this takes you to: http://www.google.com";

onClick="LinkClick">

<% link1.setFontSize(LinkFontSize.STANDARD);%>

</hbj:link></b>

But however, I'm getting the error below, do you have any idea?

<b>Error in executing a process for compilation, E:/usr/sap/E9W/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/iviewdynexample/work/pagelet/_sapportalsjsp_testlogin.java:85: cannot resolve symbol symbol : variable LinkFontSize location: class pagelet._sapportalsjsp_testLogin link1.setFontSize(LinkFontSize.STANDARD); ^ 1 error .

Exception id: 12:24_08/06/05_0017_3095150

See the details for the exception ID in the log file</b>

Thank you,

Baggett