Hi Saravanan,
I'm not sure what you mean by "state 1" and "state 2", but if the "user status" you're referring to has to do with permissions or some type of access, then there is a roundabout way to have a wiki page display based on access.
So if you do the following:
1. Create or identify the wiki pages that you want to display to users based on their permissions/status/etc.
2. Create a default wiki page so the wiki webpart will use this automatically.
3. Within the default wiki page, setup your code so that it will identify those users based on their permissions and then load the respective wiki page you want that user to see.
Here's what I did for one customer of ours. I created two pages, one called "thisPageIsForProjectA" and the other called "thisPageIsForEveryoneElse". I then made a default wiki page with the following in it:
<script type="text/javascript">
LABKEY.Security.getUserPermissions({
containerPath: '/Project A',
success: onSuccess,
failure: onError
});
function onSuccess() {
var wp = new LABKEY.WebPart({
partName: 'Wiki',
renderTo: 'wikiDivTag',
frame: 'none',
partConfig: {name: 'thisPageIsForProjectA'}
})
wp.render();
}
function onError() {
var wp2 = new LABKEY.WebPart({
partName: 'Wiki',
renderTo: 'wikiDivTag',
frame: 'none',
partConfig: {name: 'thisPageIsForEveryoneElse'}
})
wp2.render();
}
</script>
<div id="wikiDivTag"></div>
So this code:
- Get the permissions for the user that is view the page right now.
- Determines whether they've got access to the Project A project.
- Loads the appropriate wiki web part based on that permission.
I believe that this code sample should get you on the right track with what you're trying to do.
For more information on our Javascript API and the security endpoint, please checkout the following documentation:
https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Security.html
Regards,
Jon