cancel
Showing results for 
Search instead for 
Did you mean: 

Can Javascript be of help in decision making here??

Former Member
0 Kudos

Hi

I am not too good in JavaScript and would like to take the help of experts.

I have an web template, which should show certain web items when a particular user is logged in.

Is it possible?

My web template has 4 drop downs A,B,C and D

and one Analysis Item.

Suppose there are two types of users, Admins and normal users.

Portal sends the type of user url parameterization,

If Admin type user executes the report from portal - only dropdowns A and B should be displayed.

If normal user executes the report - only dropdowns C and D should be available.

When both values are selected, the Analysis item executes for the selected values and gets displayed.

I could manage the second half with cascading dropdowns, but not sure how I can hide or display depending on the type of user who executes the report.

Can Javascript be of help?

How do I write IF conditions in Javascript and set the property of web items to hidden or display?

Let me know if you have any ideas or need more information

Cheers

Sri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sri,

Its possible through JS Code, to hide & unhide the object's for different user's.

We can access the web item's property through JS and set it there to show or not to show.

please check the below code to have an Idea about accessing the Values of web item in JS.

Thanks

Dipika

Former Member
0 Kudos

Hi Dipika

I tried to get the value of text item, but it is not returning the value.

suppose I have text item value as Sri

my variable in JavaScript should get that value.

However I understood how to set the properties dynamically but just a condition is missing.

Now all I need is, get the text item or dropdown item or any web item value to a variable in JavaScript

I can then apply that variable as a toggling variable and switch the display properties.

Thanks

Sri

Former Member
0 Kudos

Thanks Dipika I got it working!

Cheers

Sri

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

Hi,

Can you assign different roles for different users ? If that can be done, you can have 2 queries on the same Dat Provider with different DropDowns (A&B and C&D). Give the Admin User one role and the Normal User another role.

I think this is easier, but depends on your requirement. Hope this helps.

Former Member
0 Kudos

Hi Vishal,

I know that can be done but it the portal should not be touched at this moment.

Thanks