cancel
Showing results for 
Search instead for 
Did you mean: 

Code Completion on portal jsps & htmlb

Former Member
0 Kudos

Hello,

what I have to do to use the code completion within a portal JSP file ?

The htmlb taglib is referenced in te portalapp.xml as follows:

<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>

Are there other settings needed for the project in the NDS ? The help is only referencing the standard web.xml

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Christian,

You have to add a reference in JSP as well. Here is a sample portalapp.xml and a .jsp page.

<b>Portalapp.xml</b>

<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config>
    <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
    </application-config>
  <components>
    <component name="display">
      <component-config>
        <property name="ClassName" value="nasa.ifmp.testjsp.display"/>
        <property name="SecurityZone" value="nasa.ifmp.testjsp/high_safety"/>
      </component-config>
      <component-profile>
        <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
      </component-profile>
    </component>
  </components>
  <services/>
</application>

<b>

JSP Page</b>

<%@ taglib uri="tagLib" prefix="hbj" %>
<hbj:content 
	id="myContext">
<script LANGUAGE="JavaScript" TYPE="text/JavaScript"> 	
function alertSelectedRadio(){
var funcName = htmlb_formid+"_getHtmlbElementId";
func = window[funcName];
alert(func);
var radiobutton = eval(func(htmlb_radiobuttonmodifier+"radiobutton"));
alert(radiobutton);

</script>

	<hbj:document>
		<hbj:documentHead 
			title="test">
		</hbj:documentHead>
		<hbj:documentBody>
			<hbj:form 
				id="simpleForm">
				<hbj:radioButtonGroup 
					id="TestRadioGroup" 
					columnCount="2" 
					selection="rb_fem">
					<hbj:radioButton 
						id="TestRadioButton1" 
						text="female" 
						key="rb_fem" 
						tooltip="I am female" 
						jsObjectNeeded="TRUE" 
						disabled="false" 
						/>
					<hbj:radioButton 
						id="TestRadioButton2" 
						text="male" 
						key="rb_male" 
						tooltip="I am male" 
						jsObjectNeeded="TRUE" 
						disabled="false" 
						/>
				</hbj:radioButtonGroup>
				<br>
				<hbj:button 
					id="SubButton" 
					text="Submit" 
					tooltip="Sends your info" 
				    onClientClick="alertSelectedRadio()"
					width="30px" 
					design="EMPHASIZED" 
					jsObjectNeeded="true">

				</hbj:button>
			</hbj:form>
		</hbj:documentBody>
	</hbj:document>
</hbj:content>


Former Member
0 Kudos

Hello Prakash,

the JSP already have the entry for the taglib. I've also added the htmlb.jar to the reference libs in the project properties. In .java file the code completion works fine, but not in the JSP at all.

Former Member
0 Kudos

Sorry, i misunderstood you. The code completion doesn't work with JSP tag. The code completion should work with any java code that you have directly to JSP. Email me at psingh@ust.net and i will send you a screen shot of what it should look like.

Answers (0)