• RAVITEJA C 19
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
I am using visualforce site, there I have a inputtext button which is binded to contact standard button "Birthdate". The date formate in Birthdate field field is MM/DD/YYYY. But when my visualforce site getting loaded it shows the format like "Fri May 20 00:00:00 GMT 2016". I want to show the date in MM/DD/YYYY format only. Please help.

Visualforce code is below:
<apex:inputText id="brhdate" size="10" value="{!contactEdit.Birthdate}"  html-readonly="true" onmouseover="initialiseCalendar(this, '{!$Component.brhdate}')" />

This is a inputText field so we can also enter value using calender. But it also should appear the value if it exist in that contact already.
My problem is while site is loaded, this field shows existing date in different format like "Fri May 20 00:00:00 GMT 2016". Please tell me how can I show the date in MM/DD/YYYY.

Thanks you in advance.
 
Illegal assignment from List<System.SelectOption> to Set<String>  
@Line 15

public class FieldDependencyPickList {
public    Map<String,List<String>> cityMap{get;set;}
    public List<SelectOption> place {set;get;}
    public List<SelectOption> city {set;get;}
    public String selCity    {get;set;}
    public String selPlace    {set;get;}

public FieldDependencyPickList(){
    cityMap=new Map<String,List<String>>();
    List<String> hcityPlaces=new List<String> {'apet','npet','bpet','abpet'};
        List<String> apcityPlaces=new List<String> {'rjy','kkd','tni','vskp'};
            cityMap.put('HYD',hcityPlaces);            
            cityMap.put('AP',apcityPlaces);
                Set<String> place=cityMap.keySet();
L15   place=new List<SelectOption>();
        city=new List<SelectOption>();
        SelectOption so=new SelectOption('none','-None-');
        city.add(so);
        place.add(so);
    for(String p:place){
        SelectOption nsp=new SelectOption(p,p);
        city.add(nsp);
}  
    }
        public void placesGetter(){    
            place.clear();
            List<String> sp=cityMap.get(selcity);
            for(String pp:sp){
                SelectOption so1=new SelectOption(pp,pp);
                place.add(so1);
    }
  }
}

I just ran in to a problem where I was trying to reference Apex code that lived in a Managed Package, and even though I had the correct syntax, I just couldn't get my code to compile properly. I'd like to share the solution with you.

 

 Here's a simplified version of the code that was frustrating me:

 

public class PackageExtenderClass{

public PackageExtenderClass(){
}

public String myExtenderMethod(){
String temp = myNamespace.UtilityClass.getRandomString();

return temp;
}
}

 

 The above code is correct in every way, but I couldn't get it to compile - I kept getting this error:

Error: Compile Error: Package Visibility: Type is not visible: utilityclass at line 7 column 26

 

It turns out that in order to solve this problem, I needed to update the Version Settings for my PackageExtenderClass so that it referenced the 1.6 version of the 'myNamespace' Managed Package instead of the older 1.3 version. This is becuase the 1.3 version of the Managed Package didn't include a definition for the getRandomString() method. The getRandomString() method was only added in the 1.6 version of the Managed Package.

 

  • October 21, 2009
  • Like
  • 0