Skip to Content
avatar image
Former Member

Add a textview to a group

Hi

I have created a jsp site like this:

<hbj:content id="content_firstpage">

<hbj:page title="firstpage">

<hbj:form id="form_firstpage">

<table>

<tr>

<td>

<hbj:group id="group1" design="PRIMARYCOLOR" title="latest headlines" tooltip="all the news you need" width="200">

<hbj:groupBody></hbj:groupBody>

</hbj:group>

</td>

</tr>

</table>

</hbj:form>

</hbj:page>

</hbj:content>

How can I add a textview element to this Group using JSP?

I have tried with:

A:

<%

TextView S = new TextView();

S.setText("this is a test!");

group1.addComponent(S);

%>

B:

<%

TextView S = new TextView();

S.setText("this is a test!");

pageContext.setAttribute("group1", S);

%>

A gives a compile error, in B nothing is displayed. Can anyone help me?

Brgds// -Fred

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 11, 2004 at 09:48 AM

    Thanks Parnas. This is how I wanted to solve the issue!

    I know that the tag solution works fine as well, but not in my case.

    Correct code:

    <hbj:group id="group1" design="PRIMARYCOLOR" title="latest headlines" tooltip="all the news you need" width="200">

    <hbj:groupBody>

    <%

    TextView T = new TextView();

    T.setText("this is a test!");

    T.setWrapping(true);

    group1.addComponent(T);

    %>

    </hbj:groupBody>

    </hbj:group>

    Brgds// -Fred

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      What is the compilation error you are getting.

      It could be because of the TextView class not being imported in the jsp.

      (I usually find the "created" java class from the jsp and look at it to see what actually is the problem. Can't really remember where SAP J2EE puts them)

  • avatar image
    Former Member
    Aug 13, 2004 at 09:06 AM

    It works fine with your solution. I got a compilation error that said that it had never heard of the groupid. Placing the code between the start and end of the group tags helped me.

    I thought that this could help to wrap links, but it didn't.

    Thanks!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 10, 2004 at 10:51 AM

    Hi,

    Use textview tags of HTMLB to add textview in the group.

    Thanks

    Senthil

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 10, 2004 at 11:48 AM

    I think A should work but you have to place the code between start tag

    <hbj:group id="group1" design="PRIMARYCOLOR" title="latest headlines" tooltip="all the news you need" width="200">
    

    and the end tag

    </hbj:group>

    as it is only here the group1 reference is valid

    Add comment
    10|10000 characters needed characters exceeded