• Pramod Kumar
  • NEWBIE
  • 0 Points
  • Member since 2012
  • Mr
  • Metacube Software Pvt. Ltd

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 8
    Replies
Can we use Live Agent without service cloud license?

currently we can use live agent with service cloud.
public Component.Apex.TabPanel getMyTabs()
{
    Component.Apex.TabPanel myTabPanel = new Component.Apex.TabPanel();  
     for (integer i=0 ;i<menus.size();i++)  //just a sample, this could easily be a SOQL loop
     {
         Component.Apex.Tab myTab = new Component.Apex.Tab();
         myTab.Label = menus.get(i).name;
         myTab.name =  menus.get(i).name;
         myTab.switchtype = 'client';
         //Want to associate a VF page with this Tab so that if someone Click this tab  
         associated VF page content render in body part.
         myTab.style='font-family: Arial, Helvetica, sans-serif; color: #000000;  background-image: url(/dimg/portalTabActiveRight000099C2E4FE.gif)';
         myTabPanel.childComponents.add(myTab);
     }   
    return myTabPanel;
}

I Want to associate a particular VF page with each Tab so that if someone Click that tab
associated VF page content render in the body part.

menus list also contains target VF page related path which will be displayed when user clicks in respective tab.

I am not getting anything how to do this. Can someone help me plz

 

I Want to do it through apex:include.

vf page with list of accounts ..when particular accnt name is selected it gives the name of the contacts in that particular account.
page
<apex:page standardController="Account" extensions="contactExt" showHeader="true" >

<apex:form >

<apex:pageBlock >

<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel value="Account Name" for="accts"></apex:outputLabel>

<apex:selectList id="accts" value="{!selectedAcctId}" size="1" >

    <apex:selectOptions value="{!accts}"/>
    <apex:actionsupport event="onchange" action="{! getAccountContacts}" rerender="ContactDetail" />
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>


<apex:outputPanel id="ContactDetail">

<apex:repeat value="{!acctContacts}" var="contact">
<p>{!contact.FirstName & ' ' & contact.LastName}</p>
</apex:repeat>
       
</apex:outputPanel>
</apex:form>
    </apex:page>

controller:

public class contactExt{
   
public String selectedAcctId { get; set; }
    public List<Contact> acctContacts {get;set;}

    public contactExt(Apexpages.StandardController con){
               
    }
   
    public void getAccountContacts(){
       
        acctContacts = [Select Id, FirstName, LastName from Contact where AccountId = :selectedAcctId];
    }
   
    public List<selectOption> getaccts() {
        List<selectOption> options = new List<selectOption>();

        options.add(new selectOption('', '- None -'));

        for (Account account : [SELECT Id,  Name FROM Account]) {

            options.add(new selectOption(account.id, account.Name));

        }
        return options;
    }
   
   
}


whats is the use of :::

<apex:selectList id="accts" value="{!selectedAcctId}" size="1" >
taking id = "accts"and value="{! selectedAccId}" ..what is id and value holding

Hi all,

 

This is really just a request for information, but  it just seems like I'm making things way too hard on myself.

I typically use inputText boxes for date input, so that may be coloring what  sems to go on in my code.
Basically, I can't seem to get data from the VF page to the controller without using an apex:actionFunction.

For example, this APEX class has to have data and a method for processing the <apex:actionFunction> tag:

public class OpportunityHistoryController {
  ...
  public String From_Date {get;set;}  // 
  ...
  public void dateChange() {
      System.debug('DATECHANGE WAS MADE:');
      ...
    }

   ...

 And next, the VF page markup calls the controller function:

<apex:page controller="OpportunityHistoryController" id="opportunityHistPage">
<apex:form id="OpportunityForm">
<script>
function DynamicDatePicker(d_id) {
 DatePicker.pickDate(false,d_id.id,false);
 dateChange(d_id);
 }
function checkDateFormat() {}
</script>
   <apex:pageBlock title="Opportunity History Statement" id="pb1">
    
    <apex:actionFunction action="{!dateChange}" reRender="condisplay" name="dateChange">
     <apex:param value="" assignTo="{!dummy}" name="assignvalue"/>
    </apex:actionFunction>
     
    From: <apex:inputText value="{!From_Date}" id="f" onfocus="DynamicDatePicker(this);" onchange="checkDateFormat(this.id);" onblur="setFocusOnLoad()" size="20" disabled="false"/>

     ...

 Now, why the <apex:actionFunction> is needed, I have no clue - all I know is that most of my code seems to not update values between the page and the controller unless there is some linkage between the two.  In fact, the "dateChange()" function in the controller doesn't really have to do anything - it just has to be present.

My suspicion is there is something going on with the MVC architecture with SFDC that is necessitating this "connection" between the two to notify the controller that the VF page is "dirty" - If anyone has a documentation reference on other ways to do this, I'd very much appreciate it.

Similarly, with SelectLists, I seem to have to make up similar coding  -

For instance, Taking the OpportunityHistoryController example I'm messing with above, and add the following subroutines:

public class OpportunityHistoryController {
  ...
        public  Map<id,UserRole> maplstroles{get;set;}
        public UserRole theRole {get;set;}  // Role ID
        ...
        public OpportunityHistoryController() {
	    ...
	    maplstroles = new Map<id,UserRole>();            
    	    }

	// build Role SelectOptions
        public List<SelectOption> getRolesLst(){
           System.debug('Entering getRolesLst');
           options.clear();
           options.add(new selectOption('--None--','-- Select Role --'));
           for(UserRole rx:[SELECT ID, Name From UserRole  ORDER BY Name ASC]){
             options.add(new selectOption(rx.id,rx.name));
             maplstroles.put(rx.id,rx);
             }
           return options;
           }


	 // process the "apex:actionFunction " call...
	 public void RoleID() {
	    System.debug('getting roleID for: ' + rid);
	    theRole =  maplstroles.get(rid);
	    System.debug('theRole.Id: ' + theRole.Id);
	    System.debug('theRole.Name: ' + theRole.Name);
	    }

 ...And somewhere in the VF markup, I want to update the apex page:

<apex:page controller="OpportunityHistoryController" id="opportunityHistPage">
<apex:form id="OpportunityForm">
<script>
function callactionfun(picklistval){
   change(picklistval);
   }
</script>
  ...
   <apex:pageBlock title="Opportunity History Statement" id="pb1">
    ...
    <apex:actionFunction action="{!RoleID}" reRender="condisplay" name="change">
     <apex:param value="" assignTo="{!rid}" name="assignvalue"/>
    </apex:actionFunction>

     ...
     
    <apex:selectList value="{!rid}" multiselect="false" size="1"  
    			onchange="callactionfun(this.options[this.selectedIndex]);" >
        <apex:selectOptions value="{!RolesLst}"/>
    </apex:selectList>

...

 ...It's really just a personal opinion, but it looks like SFDC is following more of the "MVVC" model - where we basically have to notify the controller of changes that occur on the view.   

Sorry, but I'm still doing research on this.  
But if anyone has ideas about how to make coding for dynamic input easier, I'd appreciate it.

 

 

 

 

 

 

hai,

 I have two fields(field1,field2) in if page.

Suppose when I enter value in first field, the second field should get value with increment of first field value.

  • December 01, 2012
  • Like
  • 0

I create a VF page that has 3 table in it and these three table showing as vertical instead of horizontal.i want to display table in the following format:

 Application   
TypeDateByToComments/Notes
App rec    
Com App    
App Assing    
App routed   

 

 

  • November 30, 2012
  • Like
  • 0