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
nani@rnani@r 

I WAN T TO DISPLAY LIKE USER NAME,PASSWORD IN MY VISUALFORCE PAGE ?

PLS HELP ON THAT QUESTION .IWANT TO CREATE USERNAME,PASSWORD IN MY VISUALFORCE PAGE.

Navatar_DbSupNavatar_DbSup

Hi,

Try the below code snippet as reference:

..............

Page

.............

<apex:page id="page1" controller="Login_Info">

<apex:form id="form1">

<apex:pageBlock id="block1">

<apex:pageBlockSection id="section1">

<apex:outputText >User Name</apex:outputText>

<apex:inputText id="name" value="{!name}"/> 

<apex:outputText >User Password</apex:outputText>

<apex:inputSecret id="password" value="{!password}"/>

<apex:outputText >Search Name</apex:outputText>

<apex:inputText id="searchname" value="{!sname}"/>

<apex:commandButton id="save1" value="Save" action="{!save}" onclick="CheckSave()" />

</apex:pageBlockSection> 

</apex:pageBlock>

          

            <br/>

<br/><br/><br/><br/><br/><br/>

 

<apex:outputPanel id="uu">

 

 <apex:dataTable value="{!f}" var="fac" id="theTable1" rowClasses="odd,even" styleClass="tableClass1" cellPadding="4" border="1">

   <apex:column >

 

                            

                        <apex:facet name="header">Id</apex:facet>

                         

                       <apex:outputText value="{!fac.Login_User_Id__c}"/>

 

                </apex:column>

                <apex:column >

               

                <apex:facet name="header">User Name</apex:facet>

                          

                       

                        <apex:outputText value="{!fac.Name}"/>

 

                </apex:column>

 

       <apex:column >

 

                        <apex:facet name="header">Passwords</apex:facet>

                                                   

                        <apex:outputText value="{!fac.Login_User_Password__c}"/>

 

                </apex:column>

               

 

        </apex:dataTable>

 

  <apex:outputPanel >

                     Data Deleted Is

 

   <apex:dataTable value="{!e}" var="fac" id="theTable" rowClasses="odd,even" styleClass="tableClass" cellPadding="4" border="1">

  

    

   <apex:column >

 

                            

                        <apex:facet name="header">User Name</apex:facet>

                          

                       

                        <apex:outputText value="{!fac.Name}"/>

 

                </apex:column>

 

                <apex:column >

 

                        <apex:facet name="header">Passwords</apex:facet>

                                                    

                        <apex:outputText value="{!fac.Login_User_Password__c}"/>

 

                </apex:column>

               

 

        </apex:dataTable>

 

</apex:outputPanel>

            </apex:outputPanel>

 

<script Language="JavaScript">

 

function CheckSubmit()

{

}

function CheckSave()

{

}

 

</script>

</apex:form>

</apex:page>

 

..............

Controller

..............

 

 public class Login_Info

{

public List<Login_Info__c> f{get;set;}

public list<Login_Info__c> e{get;set;}

public list<Login_Info__c> g{get;set;}

 

Integer a=1;

String b;

 public String password { get; set; }

 public String name { get; set; }

 public String sname { get; set; }

 public Integer len { get; set; }

 

Login_Info__c obj=new Login_Info__c();

public PageReference save()

{

obj.Name=name;

obj.Login_User_Password__c=password;

insert obj;

 

PageReference pageRef = new PageReference('https://c.ap1.visual.force.com/apex/Login_Detail');

    pageRef.setRedirect(true);

    return pageRef;    }

 

}

Note: In above code snippet we are saving the user name and password in a custom object.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.