• palli
  • NEWBIE
  • -3 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 27
    Replies

Hi,

 

How to write a test class method for Page Refrence method in apex class,

 

i am trying to to write a test class method , but this test class method shows error

below is the error .

 

System.QueryException: List has no rows for assignment to SObject

 


Please

please help me ,

 

Thanks in Advance

 

  • January 24, 2013
  • Like
  • 0

Hi,

I enabled delegated authentication in my salesforce. I just enabled delegated authentication in single sign on settings and did not follow the procedure for the delegated authentication and did not log into my account for 5 days.

While after trying to log into my account its showing an error as "Your company's Single Sign-On configuration is invalid. Please contact the administrator at your company for more information." How could I log back into my salesforce???

Please any solutions could be appreciated..

Thank you,

 

 

--- Shiva

  • January 17, 2013
  • Like
  • 0

I created an object in java and that code i would like use in salesforce? Is there any way to use java code in salesforce?

package de.vogella.xml.stax.model;

public class Item {
  private String date; 
  private String mode;
  private String unit;
  private String current;
  private String interactive;
  
  public String getDate() {
    return date;
  }
  
  public void setDate(String date) {
    this.date = date;
  }
  public String getMode() {
    return mode;
  }
  public void setMode(String mode) {
    this.mode = mode;
  }
  public String getUnit() {
    return unit;
  }
  public void setUnit(String unit) {
    this.unit = unit;
  }
  public String getCurrent() {
    return current;
  }
  public void setCurrent(String current) {
    this.current = current;
  }
  public String getInteractive() {
    return interactive;
  }
  public void setInteractive(String interactive) {
    this.interactive = interactive;
  }

  @Override
  public String toString() {
    return "Item [current=" + current + ", date=" + date + ", interactive="
        + interactive + ", mode=" + mode + ", unit=" + unit + "]";
  }
} 



-----------------

package de.vogella.xml.stax.read;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.Attribute;
import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;

import de.vogella.xml.stax.model.Item;

public class StaXParser {
  static final String DATE = "date";
  static final String ITEM = "item";
  static final String MODE = "mode";
  static final String UNIT = "unit";
  static final String CURRENT = "current";
  static final String INTERACTIVE = "interactive";

  @SuppressWarnings({ "unchecked", "null" })
  public List<Item> readConfig(String configFile) {
    List<Item> items = new ArrayList<Item>();
    try {
      // First create a new XMLInputFactory
      XMLInputFactory inputFactory = XMLInputFactory.newInstance();
      // Setup a new eventReader
      InputStream in = new FileInputStream(configFile);
      XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
      // Read the XML document
      Item item = null;

      while (eventReader.hasNext()) {
        XMLEvent event = eventReader.nextEvent();

        if (event.isStartElement()) {
          StartElement startElement = event.asStartElement();
          // If we have a item element we create a new item
          if (startElement.getName().getLocalPart() == (ITEM)) {
            item = new Item();
            // We read the attributes from this tag and add the date
            // attribute to our object
            Iterator<Attribute> attributes = startElement
                .getAttributes();
            while (attributes.hasNext()) {
              Attribute attribute = attributes.next();
              if (attribute.getName().toString().equals(DATE)) {
                item.setDate(attribute.getValue());
              }

            }
          }

          if (event.isStartElement()) {
            if (event.asStartElement().getName().getLocalPart()
                .equals(MODE)) {
              event = eventReader.nextEvent();
              item.setMode(event.asCharacters().getData());
              continue;
            }
          }
          if (event.asStartElement().getName().getLocalPart()
              .equals(UNIT)) {
            event = eventReader.nextEvent();
            item.setUnit(event.asCharacters().getData());
            continue;
          }

          if (event.asStartElement().getName().getLocalPart()
              .equals(CURRENT)) {
            event = eventReader.nextEvent();
            item.setCurrent(event.asCharacters().getData());
            continue;
          }

          if (event.asStartElement().getName().getLocalPart()
              .equals(INTERACTIVE)) {
            event = eventReader.nextEvent();
            item.setInteractive(event.asCharacters().getData());
            continue;
          }
        }
        // If we reach the end of an item element we add it to the list
        if (event.isEndElement()) {
          EndElement endElement = event.asEndElement();
          if (endElement.getName().getLocalPart() == (ITEM)) {
            items.add(item);
          }
        }

      }
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (XMLStreamException e) {
      e.printStackTrace();
    }
    return items;
  }

}

 



 

 How could i use the above code in salesforce? Please help me out from this task....

  • November 27, 2012
  • Like
  • 0

Hi ,

 

how to solution this error........

 

 

static void testBookParser()
{
xml2DB1 demo = new Xml2DB1();
String str = '<Books><Book><Name>My Book 1</Name><publisher>Tata</publisher><cost>200</cost></Book>'+
'<Book><Name>My Book 2</Name><publisher>Tata</publisher><cost>300</cost></Book>'+
'<Book><Name>My Book 3</Name><publisher>Tata</publisher><cost>400</cost></Book></Books>';
XmlStreamReader callxml = new XmlStreamReader(str);
System.debug('Callxml .....'+callxml);
List<Book__c> booklist = new List<Book__c>();
for(XmlStreamReader.Book b: callxml.listrecords)
{
Book__c bc = new Book__c();
bc.Publisher__c='Tata';
bc.Name__c=b.name;
booklist.add(bc);
}
System.debug('books .......'+booklist.size());
system.debug('books........'+booklist);
if(booklist.size()>0)
{
insert booklist;
}

}

  • November 05, 2012
  • Like
  • 0

Hi ,All

 

I would like to find out if there is a way to save XML files in some global repository within the Salesforce instance. I am not referring to uploading a XML file attachment for an Account. i dnt want to directly upload in xml sheet..
Instead of creating an using a custom object, I just want to store simple look up data in a XML file. using apex class only ..

I am creating a custom object like Books , fields in three like name,publisher,cost....

 

how to do , please help me..

  • November 05, 2012
  • Like
  • 0

Hi, 

 

How to write a code for Email validation in apex class ....

 

this is my page

============

<apex:page controller="JstestController">
<apex:form id="myform">
<apex:pagemessages />
<apex:pageBlock id="myblock">
Email Address: <apex:inputText value="{!email}" id="email"/><br/><br/>
<apex:commandButton value="Click me!" action="{!checkEmail}"/>
</apex:pageBlock>
</apex:form>
</apex:page>

 

class

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

 

public class JstestController
{
public String email { get; set; }
public PageReference checkEmail()
{

}

}

 

how to wrete email validation for input text  field ....

help me.......

 

  • October 29, 2012
  • Like
  • 0

hi , 

 

how to do emil validation using regular expression in apex class .....

 

how to write a code ......

 

please help me

  • October 26, 2012
  • Like
  • 0

hi friends,

 please help me ..............

how to write a server side validations on this below page............

i dnt know how to write serverside validations.........

 

 

 

apex page..............

============================

 

<apex:page controller="leadcontroller" id="pg">
<script type="text/javascript">
function formValidator()
{
var fname=document.getElementById("{!$Component.fname}");
if(fname==null || fname=="")
{
alert('Please Enter your First name');
return false;
}
return (true);
}
function formValidator1()
{
var lname=document.getElementById("{!$Component.lname}");
if(lname==null || lname=="")
{
alert('Please Enter your Last name');
return false;
}
return (true);
}
function validatePhone()
{
var phone=document.getElementById("{!$Component.phone}");
if(phone==null || phone=="")
{
alert('You must enter Phone number');
return false;
}
return true;
}
function formValidateEmail()
{
var email=document.getElementById("{!$Component.email}");
if(email==null || email=="")
{
alert('Please Enter a valid Email address');
return false;
}
return true;
}
function validateCompany()
{
var cmpny=document.getElementById("{!$Component.cmpny}");
if(cmpny==null || cmpny=="")
{
alert('Enter your Company name');
return false;
}
return true;
}
</script>
<apex:form id="myform">
<apex:pageBlock id="pb">
<apex:pageBlockSection title="Lead Information" id="pbs" >
<apex:pageBlockSectionItem id="pbsifname">
<apex:outputLabel value="First Name" for="fname"/>
<apex:inputtext value="{!FirstName}" id="fname" onclick="formValidator()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsilname">
<apex:outputLabel value="Last Name" for="lname"/>
<apex:inputtext value="{!LastName}" id="lname" required="true" onclick="formValidator1()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsip">
<apex:outputLabel value="Phone" for="phone"/>
<apex:inputtext value="{!phone}" id="phone" onclick="validatePhone()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsie">
<apex:outputLabel value="Email" for="email"/>
<apex:inputtext value="{!Email}" id="email" onclick="formValidateEmail()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsic">
<apex:outputLabel value="Company" for="cmpny"/>
<apex:inputText value="{!Company}" id="cmpny" required="true" onclick="validateCompany()"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons id="pbb">
<apex:commandButton action="{!save}" value="save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

apex class

=================

 

public class leadcontroller
{
public string FirstName{get;set;}
public string LastName{get;set;}
public string phone{get;set;}
public string email{get;set;}
public string Company{get;set;}
public pageReference save()
{
Lead le=new Lead();
le.FirstName=FirstName;
le.LastName=LastName;
le.phone=phone;
le.email=email;
le.company=company;
insert le;

pagereference page = new pagereference('/'+le.id);
return page;

}

}

  • October 25, 2012
  • Like
  • 0

Hi, 

 

How to write a  java scripts in one function in visualforce page ..............

 

like first name,

last name,

phone ,

email,

company .

 

validations of firstname,lastname,phone,email

;...............

 

help me friends.....................

  • October 23, 2012
  • Like
  • 0

hi, how to write script validations for  Firstname, email,phone,.............

 

 

please help me

 

<apex:page controller="leadcontroller">
<script>

</script>
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel value="First Name" for="fname"/>
<apex:inputtext value="{!FirstName}" id="fname"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Last Name" for="lname"/>
<apex:inputtext value="{!LastName}" id="lname"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Phone" for="phone"/>
<apex:inputtext value="{!phone}" id="phone"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Email" for="email"/>
<apex:inputtext value="{!Email}" id="email"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

  • October 23, 2012
  • Like
  • 0

Hi ,

 

How to change standarad application logo .............

 

like sales application , call center  application , marketing application..............

 

please help me ...........

  • October 18, 2012
  • Like
  • 0

hi, 

 

 

 
How can I write a SOQL query to find duplicate Account names.................
 
 
  • October 12, 2012
  • Like
  • 0

Hi,

how to display list of records by using below soql query ,.....

 

it is write code in apex class and the results in system .debug....

 

please help me frnds..........

 

 

using this soql query...

 

Select Id, Name, (Select Id, Name From Contacts) From Account

  • October 12, 2012
  • Like
  • 0

hi,

 

how print even numbers between 1 to 50 in developer console class......

 

i write a code here ...........

 

An error is generate ... line9:18 no aviable alternaive at character '%'...

 

 

class

================

public class ListEvenNumbers
{
public void evenMethod()
{
Integer limit=50;
System.debug('Printing even numbers between 1 and '+limit);
for(Integer i=1;i<=limit;i++)
{
if(i%2==0)
{
System.debug('Display the even numbers'+i);
}
}
}
}

 

 

please help me

  • October 11, 2012
  • Like
  • 0

Hi,

 i have a error here  like===   AscDescOrderCls Compile Error: Illegal assignment from String to LIST<String> at line 33 column 16====

 

Please slove this error ..

 

plz help me 

 

public class AscDescOrderCls
{
public Integer i;
public List<String> lastValue{get;set;}
public List<String> fstName{get;set;}
public List<String> Descending{get;set;}
public AscDescOrderCls()
{
fstName=new List<String>();
Descending= new List<String>();
lastValue=new List<string>();

fstName.add('Rama');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');
fstName.add('Easu');
fstName.add('Hari');
fstName.sort();

for(i =fstName.size()-1; i>=0;i--)
{
lastValue=fstName.get(fstName.size()-1);
}
system.debug('Descending order'+lastValue);
}
}

  • October 10, 2012
  • Like
  • 0

Hi,  how to display list of values in Descending order .

 

apex Class :

============

public class SetPrimitiveDatatype
{
public set<String> fstName{get;set;}
public SetPrimitiveDatatype()
{
fstName=New set<String>();

fstName.add('Rama');
fstName.add('Anil');
fstName.add('Srinu');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');
}
}

 

page

============

 

<apex:page controller="SetPrimitiveDatatype">
<apex:form >
<apex:pageBlock title="Display The Set of values">
<apex:pageBlockSection title="FirstName">
<apex:pageblockTable value="{!fstName}" var="fn">
<apex:column value="{!fn}"/>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Please help me friends.............

  • October 09, 2012
  • Like
  • 0

Hi , how to display ascending order and descending order set of values in visualforce page......

apex class

===========

public class SetPrimitiveDatatype
{
public set<String> fstName{get;set;}
public set<String> lstName{get;set;}

public SetPrimitiveDatatype()
{
fstName=New set<String>();


fstName.add('Rama');
fstName.add('Anil');
fstName.add('Srinu');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');

}
}

 

page

============

<apex:page controller="SetPrimitiveDatatype">
<apex:form >
<apex:pageBlock title="Display The Set of values">
<apex:pageBlockSection title="FirstName">
<apex:pageblockTable value="{!fstName}" var="fn">
<apex:column value="{!fn}"/>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

please help me .............

  • October 09, 2012
  • Like
  • 0

Hi,

Controller

================

public class ListPrimitiveDataype
{
public List<String> fstName{get;set;}
public List<String> lstName{get;set;}

public ListPrimitiveDataype()
{
fstName= New List<String>();
lstName= New List<String>();
}

public List<String> getfstName()
{
List<String> lst = New List<String>();
lst.add('anil');
return lst;
}

}

 

page

=================

<apex:page controller="ListPrimitiveDataype">
<apex:form >
<apex:pageBlock>
<apex:pageblockTable value="{!fstName}" var="f">
<apex:column value="{!f.lst}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 

i have error message here   "  Error: Unknown property 'String.lst'  .....

 

please help me 

  • October 08, 2012
  • Like
  • 0

hi , how to adding  sring values in  list collections. and display list of values by using this List <string>...

 

 

 

 

 

List<string> lst= new List<string>

 

 

please help me

  • October 08, 2012
  • Like
  • 0

Hi ,

 

Generate a PDF file on opportunity record, PDF contains Header with name & address, body contains Product Items - product name, qty and price, Footer contains the address of the organisation....

 

i have how to create a pdf format only ,but i dnt know how to records generate in pdf.

Please help me ..

 

  • September 27, 2012
  • Like
  • 0

Hi ,

 

how to solution this error........

 

 

static void testBookParser()
{
xml2DB1 demo = new Xml2DB1();
String str = '<Books><Book><Name>My Book 1</Name><publisher>Tata</publisher><cost>200</cost></Book>'+
'<Book><Name>My Book 2</Name><publisher>Tata</publisher><cost>300</cost></Book>'+
'<Book><Name>My Book 3</Name><publisher>Tata</publisher><cost>400</cost></Book></Books>';
XmlStreamReader callxml = new XmlStreamReader(str);
System.debug('Callxml .....'+callxml);
List<Book__c> booklist = new List<Book__c>();
for(XmlStreamReader.Book b: callxml.listrecords)
{
Book__c bc = new Book__c();
bc.Publisher__c='Tata';
bc.Name__c=b.name;
booklist.add(bc);
}
System.debug('books .......'+booklist.size());
system.debug('books........'+booklist);
if(booklist.size()>0)
{
insert booklist;
}

}

  • November 05, 2012
  • Like
  • 0

hi friends,

 please help me ..............

how to write a server side validations on this below page............

i dnt know how to write serverside validations.........

 

 

 

apex page..............

============================

 

<apex:page controller="leadcontroller" id="pg">
<script type="text/javascript">
function formValidator()
{
var fname=document.getElementById("{!$Component.fname}");
if(fname==null || fname=="")
{
alert('Please Enter your First name');
return false;
}
return (true);
}
function formValidator1()
{
var lname=document.getElementById("{!$Component.lname}");
if(lname==null || lname=="")
{
alert('Please Enter your Last name');
return false;
}
return (true);
}
function validatePhone()
{
var phone=document.getElementById("{!$Component.phone}");
if(phone==null || phone=="")
{
alert('You must enter Phone number');
return false;
}
return true;
}
function formValidateEmail()
{
var email=document.getElementById("{!$Component.email}");
if(email==null || email=="")
{
alert('Please Enter a valid Email address');
return false;
}
return true;
}
function validateCompany()
{
var cmpny=document.getElementById("{!$Component.cmpny}");
if(cmpny==null || cmpny=="")
{
alert('Enter your Company name');
return false;
}
return true;
}
</script>
<apex:form id="myform">
<apex:pageBlock id="pb">
<apex:pageBlockSection title="Lead Information" id="pbs" >
<apex:pageBlockSectionItem id="pbsifname">
<apex:outputLabel value="First Name" for="fname"/>
<apex:inputtext value="{!FirstName}" id="fname" onclick="formValidator()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsilname">
<apex:outputLabel value="Last Name" for="lname"/>
<apex:inputtext value="{!LastName}" id="lname" required="true" onclick="formValidator1()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsip">
<apex:outputLabel value="Phone" for="phone"/>
<apex:inputtext value="{!phone}" id="phone" onclick="validatePhone()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsie">
<apex:outputLabel value="Email" for="email"/>
<apex:inputtext value="{!Email}" id="email" onclick="formValidateEmail()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsic">
<apex:outputLabel value="Company" for="cmpny"/>
<apex:inputText value="{!Company}" id="cmpny" required="true" onclick="validateCompany()"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons id="pbb">
<apex:commandButton action="{!save}" value="save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

apex class

=================

 

public class leadcontroller
{
public string FirstName{get;set;}
public string LastName{get;set;}
public string phone{get;set;}
public string email{get;set;}
public string Company{get;set;}
public pageReference save()
{
Lead le=new Lead();
le.FirstName=FirstName;
le.LastName=LastName;
le.phone=phone;
le.email=email;
le.company=company;
insert le;

pagereference page = new pagereference('/'+le.id);
return page;

}

}

  • October 25, 2012
  • Like
  • 0

Hi ,

 

How to change standarad application logo .............

 

like sales application , call center  application , marketing application..............

 

please help me ...........

  • October 18, 2012
  • Like
  • 0

hi, 

 

 

 
How can I write a SOQL query to find duplicate Account names.................
 
 
  • October 12, 2012
  • Like
  • 0

Hi,

how to display list of records by using below soql query ,.....

 

it is write code in apex class and the results in system .debug....

 

please help me frnds..........

 

 

using this soql query...

 

Select Id, Name, (Select Id, Name From Contacts) From Account

  • October 12, 2012
  • Like
  • 0

hi,

 

how print even numbers between 1 to 50 in developer console class......

 

i write a code here ...........

 

An error is generate ... line9:18 no aviable alternaive at character '%'...

 

 

class

================

public class ListEvenNumbers
{
public void evenMethod()
{
Integer limit=50;
System.debug('Printing even numbers between 1 and '+limit);
for(Integer i=1;i<=limit;i++)
{
if(i%2==0)
{
System.debug('Display the even numbers'+i);
}
}
}
}

 

 

please help me

  • October 11, 2012
  • Like
  • 0

Hi,

 i have a error here  like===   AscDescOrderCls Compile Error: Illegal assignment from String to LIST<String> at line 33 column 16====

 

Please slove this error ..

 

plz help me 

 

public class AscDescOrderCls
{
public Integer i;
public List<String> lastValue{get;set;}
public List<String> fstName{get;set;}
public List<String> Descending{get;set;}
public AscDescOrderCls()
{
fstName=new List<String>();
Descending= new List<String>();
lastValue=new List<string>();

fstName.add('Rama');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');
fstName.add('Easu');
fstName.add('Hari');
fstName.sort();

for(i =fstName.size()-1; i>=0;i--)
{
lastValue=fstName.get(fstName.size()-1);
}
system.debug('Descending order'+lastValue);
}
}

  • October 10, 2012
  • Like
  • 0

Hi,  how to display list of values in Descending order .

 

apex Class :

============

public class SetPrimitiveDatatype
{
public set<String> fstName{get;set;}
public SetPrimitiveDatatype()
{
fstName=New set<String>();

fstName.add('Rama');
fstName.add('Anil');
fstName.add('Srinu');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');
}
}

 

page

============

 

<apex:page controller="SetPrimitiveDatatype">
<apex:form >
<apex:pageBlock title="Display The Set of values">
<apex:pageBlockSection title="FirstName">
<apex:pageblockTable value="{!fstName}" var="fn">
<apex:column value="{!fn}"/>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Please help me friends.............

  • October 09, 2012
  • Like
  • 0

Hi , how to display ascending order and descending order set of values in visualforce page......

apex class

===========

public class SetPrimitiveDatatype
{
public set<String> fstName{get;set;}
public set<String> lstName{get;set;}

public SetPrimitiveDatatype()
{
fstName=New set<String>();


fstName.add('Rama');
fstName.add('Anil');
fstName.add('Srinu');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');

}
}

 

page

============

<apex:page controller="SetPrimitiveDatatype">
<apex:form >
<apex:pageBlock title="Display The Set of values">
<apex:pageBlockSection title="FirstName">
<apex:pageblockTable value="{!fstName}" var="fn">
<apex:column value="{!fn}"/>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

please help me .............

  • October 09, 2012
  • Like
  • 0