cancel
Showing results for 
Search instead for 
Did you mean: 

iView custom property

MarkusKlein
Active Contributor
0 Kudos

Hello,

i want to implement a custom property to an iView, which value should have an impact on the respective jsp defined in the portalapp.xml.

E.g.: I have added a HTMLB for Java gridlayout to a jsp:

<hbj:gridLayout id="test" width="500" cellspacing="2">

...

</hbj:gridLayout>

The width of the Grid should be customizeable as an iView property.

The component property entry of the portalapp.xml should look like this:

<property name="test_width" value="500" />

What value do i have to add to the jsp in order to use the value provided by the component property?

Would this work?

<hbj:gridLayout id="test" width=test_width cellspacing="2">

</hbj:gridLayout>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Markus,

Try this.

<%

IPortalComponentRequest currentRequest =

(IPortalComponentRequest) pageContext.getAttribute(javax.servlet.jsp.PageContext.REQUEST);

IPortalComponentContext componentContext =

currentRequest.getComponentContext();

IPortalComponentProfile profile = componentContext.getProfile();

String width = profile.getProperty("test_width");

%>

Use this width to set in the gridlayout width.

Include the necessary imports.

Hope this helps.

Regards,

Harini S

MarkusKlein
Active Contributor
0 Kudos

Hi Harini,

i will try that thx

regards,

Markus

Answers (1)

Answers (1)

Former Member
0 Kudos

Markus,

Personalizable properties can be accesed from you JSPDynPage, so if you are using HTMLB classlibs to define the Layout you can take this value dynamically from the profile and adjust the layout width.

But if you are using the Taglibs as you mentioned you need to pass this value in a bean or as such put it in Context or Session and use it in the JSP file.

Hope this answers your question

cheers

Kiran