You need to sign in to do that
Don't have an account?
Custom Login Page on Visualforce
Hi All,
I am created custom visualforce page . Shows error for passing password value to controller.
Error: Read only property 'PackageTesting.login.password'
Note : its working without that password field .
Page:
----------
<apex:page showHeader="false" sidebar="false" controller="login">
<apex:form >
<br><apex:image value="{!$Resource.AnimFlag}" width="100" height="100"/></br>
<apex:pageBlock >
<apex:pageBlockSection title="Account New">
<br>User Name<apex:inputText value="{!username}"/></br>
<br>Pass Word<apex:inputText value="{!password}"/></br>
<apex:commandButton value="Submit" onclick="{!login}"/>
<apex:outputLink > ForgetPassword </apex:outputLink>
<apex:outputLink value="https://packagetesting.ap1.visual.force.com/apex/AccountDisplay"> Create new Account</apex:outputLink>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Controler
----------------
public with sharing class login{
String username;
String password;
public String getusername() {return username;}
public void setusername(String un){this.username=un;}
public String getpassword() {return password;}
public void getpassword(String pw){this.password=pw;}
public String getLogin(){
List<Account> a = [select id from Account where Name like:username+'%'and PackageTesting__Password__c like:password+'+'];
if(a.isEmpty()){
some Logic goes here;
}
else{
some logic goes here;
}
return null;
}
Plz help me
Regards
Sathish
You don't have a setpassword method, so password is considered a read only property.
change the second mehtod to setpassword(string pw) and all will be well.
All Answers
You don't have a setpassword method, so password is considered a read only property.
change the second mehtod to setpassword(string pw) and all will be well.