cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic JSPDynpage

Former Member
0 Kudos

Hello!

It's question for my understanding, I think.

I have JSPDynpage: JSP, class, bean.

If I want to dynamic show/hide (add/remove) some elements(button, for example) on my page, what should I do?

When I have only class(Dynpage) it's simple, but I have JSPDynpage.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Paul,

Since you are using JSPDynpage, and need to show/hide buttons, you will need to so in the .jsp file of your portal application.

for. eg. the edit button needs to be showed to the Administrator and not to the enduser.

In this case i will write the code to access the logged in user details in the .java file. Here once i find that the user is an admin i will save a boolean flag called checkAdminFlag in the bean to true.

Then in the .jsp file i will access the bean and retrieve the value of the checkAdminFlag. Depending on the value the edit button is made visible or not in a if condition.

Hope this helps.

Regards,

Melwyn

Former Member
0 Kudos

Thanks Melwyn Monis. I thought to do do like this, but <hbj:button> don't have standard property visible . That's why I'm asking that question

Former Member
0 Kudos

Hi Paul,

You need to put the if condition inside a scriplet in the .jsp file.

Here is a sample code.


<% 
    if(myBean.isCheckAdminFlag())		
    {	
%>
         <hbj:button  id="bhp_btn_edit"
	            text="Edit"
	            onClientClick="callEditForm()">
         </hbj:button>
<% 
    } 
%>

Hope this helps.

Regards,

Melwyn.

Former Member
0 Kudos

Melwyn Monis, thank you very much!

Answers (1)

Answers (1)

Former Member
0 Kudos

This question is still actual