on 11-04-2005 6:10 AM
Hello All,
Ive new in HTMLB. Have written this code wherein a JSP page is called from a JSPDynPage file. But am <b>not getting any output. Its all blank.</b> Dunno if im going wrong .... Please help.
Struggling with this since y'day.
<b>CODE</b>:
<u><b>UserInfoDynPage.java</b></u>
package com.sap.sample;
import com.sapportals.htmlb.*;
import com.sapportals.htmlb.enum.*;
import com.sapportals.htmlb.event.*;
import com.sapportals.htmlb.page.*;
import com.sapportals.portal.htmlb.page.*;
import com.sapportals.portal.prt.component.*;
public class UserInfoDynPage extends PageProcessorComponent
{ public DynPage getPage()
{ return new UserInfoDynPageDynPage();
}
public static class UserInfoDynPageDynPage extends JSPDynPage
{ //private UserInfoBean UserInfoBean = null;
public void doInitialization()
{ IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentSession componentSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
/*Object o = componentSession.getValue("UserInfoBean");
if(o==null || !(o instanceof UserInfoBean))
{ UserInfoBean = new UserInfoBean();
componentSession.putValue("UserInfoBean",UserInfoBean);
}
else
{ UserInfoBean = (UserInfoBean) o;
}*/
// fill your bean with data here...
}
public void doProcessAfterInput() throws PageException
{
}
public void doProcessBeforeOutput() throws PageException
{ this.setJspName("UserInfo.jsp");
}
}
}
-
<u><b>UserInfo.jsp</b></u>
<%@ taglib uri="tagLib" prefix="hjb" %>
<hbj:content id="myContext" >
<hbj:page title="UserInfo Page">
<hbj:form id="myFormId" >
<hbj:textView id="title" text="Search Screen" design="STANDARD" />
<table>
<tr>
<td>
<hbj:label id:"lb_Search" text"Search For" labelFor="search" />
</td>
<td>
<hbj:inputField id="search" type="string" maxlength="25" />
</td>
</tr>
<tr>
<td>
<hbj:label id="lb_SearchType" text="Search Type" labelFor="searchType" />
</td>
<td>
<hbj:dropdownListBox id="SearchType" tooltip="UME Object to search for" disabled="false">
<hbj:listBoxItem key="user" value="User" />
<hbj:listBoxItem key="group" value="Group" />
<hbj:listBoxItem key="role" value="Role" />
</hbj:dropdownListBox>
</td>
</tr>
</table>
<br>
<hbj:button id="submit" text"search!" tooltip="Click me to search" disabled="false" design="emphasized" />
<br>
<br>
</hbj:form>
</hbj:page>
</hbj:content>
-
<u><b>Portalapp.xml</b></u>
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="UserInfoDynPage">
<component-config>
<property name="ClassName" value="com.sap.sample.UserInfoDynPage"/>
<property name="ComponentType" value="jspnative"/>
<property name="JSP" value="pagelet/UserInfo.jsp"/>
</component-config>
<component-profile>
<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
</component-profile>
</component>
</components>
<services/>
</application>
=============
Please help.
Awaiting Reply.
Thanks,
Uday
Message was edited by: Uday Hardikar
Hi Uday,
If u tru once without using any methods in doInitialization().
I think then u will get output .
After u will try by using that method .
It might be problem in doInitialization() method only.
IPortalComponentRequest req = (IPortalComponentRequest) getRequest();
IPortalComponentSession componentSession = req.getComponentSession();
UserInfoBean = new UserInfoBean();
componentSession.putValue("UserInfoBean",UserInfoBean);
Try like this.
cheers
BHI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.