function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
s2pid_fs2pid_f 

calling methods in the controller from HTML

Hi,

We are building a VF page as the login. On click of the login button we need to call a method in the controller associated to this page. This button is not a apex commandbutton, but a normal HTML anchor <a> tag. How do we call a controller method from html tags like <a>, <input> etc.

 

any help will be appreciated.

 

thanks

 

BulentBulent
you need to do a form post to the login page (we provide on out of the box) that you have on your site
s2pid_fs2pid_f
the login page is a visual force page and we are trying to use the sitelogin controller to work with it. Let me rephrase the question - can we invoke a method in a controller from a simple html control (non-apex control)?
BulentBulent
Let me change my question as well: Are you trying to implement a Single Sign On?
s2pid_fs2pid_f

Yes I am. There will be a VF based login page hosted on sites. which will take the user to a landing page, another VF page hosted on sites.

 

I also need to know how I can get the profile information on my landing page so that I can display/hide the applications based on the user profile.

BulentBulent
Sites integrates with Customer Portal and PRM portal for authentication. And these portal products support SSO integration. You can check the help for more details.
s2pid_fs2pid_f

Thanks for your direction. Can you help me with the 2nd part of my question - landing page and how will I be able to retrieve the user profile details to form this landing page?

 

thanks

BulentBulent

It'll be helpful if you provide more details about your flow

your landing page is visualforce page, which has a custom controller where you should be able to find the profile.

But still the user accessing your site will have the same profile since sites provides anonymous access. Once you authenticate them via the portal integration then you might have different profiles for these users 

s2pid_fs2pid_f

Let me explain my flow -

 

we have 2 pages on Sites.

1. Login Page

2. Landing Page

 

This site will be integrated to a customer portal. Users will be authenticated on the login page and taken to a landing page.

 

This Landing page will have links to other applications, some within salesforce and some outside of salesforce.

These links need to be made visible depending on the users profile setting in the customer portal. We plan to define tabs within the customer portal representing the applications, and setup the profiles as per the permissions we want to provide to users on the applications. Using these permissions we want to build the landing page.

 

I am trying to figure out, how to develop the landing page?

 

Let me know if you need more information.

 

thanks