<t:div visibleOnRole="true">

Hello,

I've Problem in using <t:div> .

In my application i have 3 roles as role1,role2 and role3.

According to the roles i need to display only that part of the page which is required for that role.

Like role1 can view only one part of display, role 2 has to view only 2nd part of page and role 3 has to get the view 3 part of page.

Can i do tht using <t:div visisbleOnRole="true">

but i dont know what all rest of code i need to get .. like roles and all.

please help me .. its VVVVV urgent.

Thank you.

[574 byte] By [bronze-starDukes] at [2007-11-26 12:14:54]
# 1

<t:div render="#{yourBean.UserRole == role1}">

what role 1 can see

</t:div>

<t:div render="#{yourBean.UserRole == role2}">

what role 2 can see

</t:div>

<t:div render="#{yourBean.UserRole == role3}">

what role 3 can see

</t:div>

silverstar at 2007-7-7 14:18:05 > top of Java-index,Archived Forums,Socket Programming...
# 2

Hello,

Actually i tried but i'mnot able to get the roles from db.

Cus u please send me the code for bean also.

I think i missing something in my code.

Suppose I've database table as "User_Role" which has 3 fields like UserId . User_Role, Description.

Now my question is how to get the roles and if user role is "role1" then first part of the page has to be displayed and rest has to be hidden.

In the same way user role is "role2" second part of page has to be displayed.

rest the same way.

Please send me some brief idea and code abt this.

Thank you.

bronzestar at 2007-7-7 14:18:05 > top of Java-index,Archived Forums,Socket Programming...
# 3

> Actually i tried but i'mnot able to get the roles

> from db.

> Cus u please send me the code for bean also.

> I think i missing something in my code.

We knows nothing about your DB setup.

But this is just basic JDBC or Hibernate stuff. Nothing to do with JSF.

> Now my question is how to get the roles and if user

> role is "role1" then first part of the page has to be

> displayed and rest has to be hidden.

>

> In the same way user role is "role2" second part of

> page has to be displayed.

> rest the same way.

The answer is already given. Check the post above you.

goldstar at 2007-7-7 14:18:05 > top of Java-index,Archived Forums,Socket Programming...