• Abdul Mujeeb Shaik
  • NEWBIE
  • 30 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 8
    Replies
I need SYNTAX to read the SelectedValues (selectList value) 
in picklist (selectoptions) which is in <APEX:REPEAT>
===
objectivetype: "yes, no, Maybe, dontknow"
===
My VF code:
-------------------
<table border="1" width="100%">
<apex:REPEAT value="{!ques}" var="singleQuestion">
<tr>
<td> {!singleQuestion} </td>

<td>
<apex:selectList value="{!Selectedvalues}" size="1">
<apex:selectoptions value="{!objectivetype}" />
</apex:selectList>
</td>
</tr>
</apex:repeat>
</table>
=====================
In Controller:
--------------
public List<String> Selectedvalues{get; set;}


 
Hi. 
<apex:inputField id="lookup" value="{!surveyObj.User__c}" style="width: 300px;" html-placeholder="select The User from the Lookup"><br/><br/>
this is the lookup to user, and i wanna get that value in AngularJs...i
===========================================================

in the below code i am able to get the data for input type="text"
<input maxlength="100" type="text" required="required" class="form-control" placeholder="Enter Last Name"  ng-model="lastName"/>
so here i am using   ng-model="lastName" for this so i can able to get the input value.

But the above code(1st or 2nd  line) i am using <apex:input filed......>
so,Here i am facing the challange....could any one pls help me out here.


 
Hi All 
i am getting this error in test class:
Error Msg:
System.NullPointerException: Attempt to de-reference a null object

In My Controller i used this:
 
Map <String, Schema.SObjectField> fieldMap = schemaMap.get(selectedObject).getDescribe().fields.getMap();
        
            Schema.DescribeSObjectResult R = schemaMap.get(selectedObject).getDescribe();
selectedObject is a picklist, there will be always a value 'Sobject'. Please help me out in this. 

Awaitng for ur Response.
Thanks & Regards
Hi, I am getting this error in console window.

Mixed Content: The page at 'https://c.ap1.visual.force.com/apex/weatherAndGoogleMap_v1?core.apexpages.devmode.url=1' was loaded over HTTPS, but requested an insecure script 'http://api.openweathermap.org/data/2.5/weather?q=London,uk&callback=test'. This request has been blocked; the content must be served over HTTPS.

how can i overcome this issue.
As the visualforcepage is in https and it is trying to call other url of type http.
so how to solve this issue.
thanks 

I am calling 
an http 
I am Getting this Error when i run/save the vf page:
Error: Cannot coerce from class core.apexpages.el.adapters.RuntimeTypeMetadataELAdapter to class java.lang.Boolean    

this is my vf code:
<apex:repeat value="{!mapkeys}" var="key">
<!--    <apex:column headerValue="{!key}"> </apex:column>-->
    
    <apex:dataTable value="{!mapprofile[key]}" var="v" width="30%" border="2">
 <apex:column value="{!v.SObjectType}"  headerValue="Sobject Name"/> 
             <apex:column value="{!v.PermissionsRead}" headerValue="Read"/>
             <apex:column value=" {!v.PermissionsCreate}" headerValue="Creat"/>
<apex:column value=" {!v.PermissionsEdit}" headerValue="Edit"/> 
<apex:column value=" {!v.PermissionsDelete}" headerValue="Delete"/>  
</apex:dataTable>
    
    
        <!--<apex:outputText value="{!yourMap[key]}"/> -->
    
</apex:repeat>

and i dont know how to clear this bug, i searched here and also i googled  but no luck , 
can any one quickly respond to my post please.

thanks in advance.
Hi One Vf page And Controller Through Which am passing 2 datefields as parameters to another Vf page.

In test class i want to Pass it to cover the test class.

For this Code i wnat Test logic .
if((Apexpages.currentPage().getParameters().get('MyVariable1'))!=NULL)
            fDate = (Date.valueOf(Apexpages.currentPage().getParameters().get('MyVariable1')));
   
         else   
            fDate=date.valueof('2014-01-01');
 
         if((Apexpages.currentPage().getParameters().get('MyVariable2'))!=NULL) 
            tDate = (Date.valueOf(Apexpages.currentPage().getParameters().get('MyVariable2')));  
          
        else
            tDate=date.valueof('2014-6-30');

This is how i worte the test class for this 
 

PageReference pageRef = Page.effortsbymonthtilldateinexcelv1;
           Test.setCurrentPage(pageRef);
          EffortsByMonthTillDateinExcelv1  controller1 = new EffortsByMonthTillDateinExcelv1 ();
         //System.currentPageReference().getParameters().put('MyVariable1', '2014-01-01');
          //System.currentPageReference().getParameters().put('MyVariable2', '2014-12-31');
           ApexPages.currentPage().getParameters().put('MyVariable1', '2014-01-01');
             ApexPages.currentPage().getParameters().put('MyVariable2', '2014-12-31');
          EffortsByMonthTillDatev1 ef1= new EffortsByMonthTillDatev1 ();
          ef1.fDate = date.valueof('2014-01-01');
          ef1.tDate = date.valueof('2013-01-01');
           
           ef1.mainlogic();
         ef1.search();
         ef1.getHeadcountList();
         ef1.appendEmptyOpportunities();
         ef1.createHeadCountPerMonth();

But still 'MyVariable1' & 'MyVariable2' is not passing pls help me its uregent to deployee
Thanks 
 

Hi i need to dispaly all Account names & the related contacts, using a wrapper class,

i tried this , but it still have a bug unable to realted the accountid in contact ,
my code

<apex:page controller="conacc" >

<apex:form >
    <table>
             <apex:repeat value="{!wrapper}" var="wrap">
            <apex:repeat value="{!wrap.conRec1}" var="w">
            <tr>
                <td>
                <apex:outputText value="{!wrap.accRec1.Name}"/>
                </td>                


          
             <td>
                          <apex:outputfield value="{!w.name}"/> 
               </td>
               </tr>
            </apex:repeat>
            </apex:repeat>
   </table>   
</apex:form>
</apex:page>
 

apex code
 

public with sharing class conacc {

  
    public List<MyWrapper> wrapper {get; set;}

  public List<Account> accLst1 {get; set;}

    public List<Contact> conLst1 {get; set;}

    public conacc ()

    {
    
      accLst1 = [select id,Name from Account  ] ;


       conLst1 = [select Id,Name from contact where AccountId IN : accLst1 ] ;

      

        wrapper = new List<MyWrapper>() ;
       for(Integer i=0 ; i < 20; i++)

            wrapper.add(new MyWrapper(  conLst1, accLst1[i])) ;

    System.debug('----------'+ wrapper);
       

    }

public class MyWrapper

    {

        public Account accRec1 {get; set;}

        public List<Contact> conRec1 {get; set;}

        

        public MyWrapper( List<Contact> con ,Account acc )

        {

            accRec1 = acc ;

            conRec1 = con ;

        }

}


}
just displaying account names & contacts , please correct me where i am doing mistake 


 

how to query all the Contacts,opportunity and opportunitylineitems from Account Object.
I can able to query only contacts and opportunities from Account object.
but i want OpportunitylineItems also in a single query to display in table formats , cany any one help me

This is how i am querying,

SELECT Name,(SELECT name,OpportunityLineItems.name from Opportunities) FROM Account

this is error , but i must query from Account Sobj Only.

Hi, There are three filds, Rout__c (Parent), Rout_outlet__c(Junction Object) ,Account.

In Rout_outlet__c(Rout__c,Account__c {Lookup Fields})

In Route__c Standard Controller, I want Account Names as a Lookup Filed.


Thanks 

Abdul Mujeeb

This is my Pgblock Table, Working Fine, but when ever i tried to Add a Row, In The First Colum i am taking the InputField(Account Lookup),  And displaying related record in the column & changing the First Row , Input field to OutputField,
But, When i add a Row, The Before all columns changes to Inputfield, Help me in this situation...!!
<apex:pageBlock>
<apex:pageblockSection columns="1"> 
<apex:pageBlockTable title="Account" var="acc" value="{!attendeeList}"> 
<apex:column headerValue="Outlet Name" >  
                            
                                  <apex:outputPanel Rendered="{!onOff}" >
                                  <apex:inputField value="{!Myobject.Account__c}"  >
            <apex:actionSupport event="onchange" action="{!AccountPopulated}"  reRender="pb,mapPanel,map_canvas" oncomplete="showAddress();"/> 
                                         </apex:inputField>   
                                    
                                    </apex:outputPanel>

                                    <apex:outputPanel rendered="{!NOT(onOff)}">
                                   
                                            <apex:outputField value="{!acc.Account__r.Name}">
                                                 
                                             </apex:outputField>
                                    </apex:outputPanel>
 
                         </apex:column> 
                          
                          <apex:column headerValue="Outlet Address 1" style="width:150px;">
                                 <apex:outputtext value="{!acc.Account__r.BillingStreet}"/>
                          </apex:column>
                           <apex:column headerValue="Outlet Address 2" style="width:150px;">
                                 <apex:outputtext value="{!acc.Outlet_Address2__c}"/>
                          </apex:column>
</apex:pageBlockTable>
</apex:pageblockSection>
         <apex:commandButton action="{!addRow}" value="Add Row" reRender="pb"/>
 </apex:pageBlock>
User-added image

I need SYNTAX to read the SelectedValues (selectList value) 
in picklist (selectoptions) which is in <APEX:REPEAT>
===
objectivetype: "yes, no, Maybe, dontknow"
===
My VF code:
-------------------
<table border="1" width="100%">
<apex:REPEAT value="{!ques}" var="singleQuestion">
<tr>
<td> {!singleQuestion} </td>

<td>
<apex:selectList value="{!Selectedvalues}" size="1">
<apex:selectoptions value="{!objectivetype}" />
</apex:selectList>
</td>
</tr>
</apex:repeat>
</table>
=====================
In Controller:
--------------
public List<String> Selectedvalues{get; set;}


 
Hi All 
i am getting this error in test class:
Error Msg:
System.NullPointerException: Attempt to de-reference a null object

In My Controller i used this:
 
Map <String, Schema.SObjectField> fieldMap = schemaMap.get(selectedObject).getDescribe().fields.getMap();
        
            Schema.DescribeSObjectResult R = schemaMap.get(selectedObject).getDescribe();
selectedObject is a picklist, there will be always a value 'Sobject'. Please help me out in this. 

Awaitng for ur Response.
Thanks & Regards
I am Getting this Error when i run/save the vf page:
Error: Cannot coerce from class core.apexpages.el.adapters.RuntimeTypeMetadataELAdapter to class java.lang.Boolean    

this is my vf code:
<apex:repeat value="{!mapkeys}" var="key">
<!--    <apex:column headerValue="{!key}"> </apex:column>-->
    
    <apex:dataTable value="{!mapprofile[key]}" var="v" width="30%" border="2">
 <apex:column value="{!v.SObjectType}"  headerValue="Sobject Name"/> 
             <apex:column value="{!v.PermissionsRead}" headerValue="Read"/>
             <apex:column value=" {!v.PermissionsCreate}" headerValue="Creat"/>
<apex:column value=" {!v.PermissionsEdit}" headerValue="Edit"/> 
<apex:column value=" {!v.PermissionsDelete}" headerValue="Delete"/>  
</apex:dataTable>
    
    
        <!--<apex:outputText value="{!yourMap[key]}"/> -->
    
</apex:repeat>

and i dont know how to clear this bug, i searched here and also i googled  but no luck , 
can any one quickly respond to my post please.

thanks in advance.

how to query all the Contacts,opportunity and opportunitylineitems from Account Object.
I can able to query only contacts and opportunities from Account object.
but i want OpportunitylineItems also in a single query to display in table formats , cany any one help me

This is how i am querying,

SELECT Name,(SELECT name,OpportunityLineItems.name from Opportunities) FROM Account

this is error , but i must query from Account Sobj Only.

This is my Pgblock Table, Working Fine, but when ever i tried to Add a Row, In The First Colum i am taking the InputField(Account Lookup),  And displaying related record in the column & changing the First Row , Input field to OutputField,
But, When i add a Row, The Before all columns changes to Inputfield, Help me in this situation...!!
<apex:pageBlock>
<apex:pageblockSection columns="1"> 
<apex:pageBlockTable title="Account" var="acc" value="{!attendeeList}"> 
<apex:column headerValue="Outlet Name" >  
                            
                                  <apex:outputPanel Rendered="{!onOff}" >
                                  <apex:inputField value="{!Myobject.Account__c}"  >
            <apex:actionSupport event="onchange" action="{!AccountPopulated}"  reRender="pb,mapPanel,map_canvas" oncomplete="showAddress();"/> 
                                         </apex:inputField>   
                                    
                                    </apex:outputPanel>

                                    <apex:outputPanel rendered="{!NOT(onOff)}">
                                   
                                            <apex:outputField value="{!acc.Account__r.Name}">
                                                 
                                             </apex:outputField>
                                    </apex:outputPanel>
 
                         </apex:column> 
                          
                          <apex:column headerValue="Outlet Address 1" style="width:150px;">
                                 <apex:outputtext value="{!acc.Account__r.BillingStreet}"/>
                          </apex:column>
                           <apex:column headerValue="Outlet Address 2" style="width:150px;">
                                 <apex:outputtext value="{!acc.Outlet_Address2__c}"/>
                          </apex:column>
</apex:pageBlockTable>
</apex:pageblockSection>
         <apex:commandButton action="{!addRow}" value="Add Row" reRender="pb"/>
 </apex:pageBlock>
User-added image

Hi,

I am working on visualforce page on lead object and this visualforce page will be used when user click on the "new(already exist) " button then this new VF page popup and to make sure that user not creating duplicate lead so i add field: first name,last name and email in that page.when user enter the information then userclick on "search " button and if there no lead matches with user input then he/she be able to create the new lead. i do know that how to "search button " in the vf page.

here is the VF code:

<apex:page standardController="Lead" recordSetVar="leads" sidebar="true" showHeader="true" standardStylesheets="true" tabStyle="lead" >
<style>
.activeTab {background-color: #236FBD; color:white;background-image:none}
.inactiveTab { background-color: lightgrey; color:black;background-image:none}
</style>

  <apex:form >
    <apex:pageBlock >
          <apex:pageMessages />
            <apex:pageBlockButtons >
              <apex:commandButton value="Edit" action="{!save}" id="editButton" />
              <apex:commandButton value="Save" action="{!save}" id="saveButton" />
              <apex:commandButton action="{! cancel}" value="Cancel!" immediate="true"/>
            </apex:pageBlockButtons>
       <apex:pageBlockSection title="Search for Duplicates" columns="1" >
           <apex:inputField value="{!lead.Firstname}"/>
           <apex:inputField value="{!lead.lastname}"/>
           <apex:inputField value="{!lead.company}"/>
           <apex:inputField value="{!lead.email}"/>
           <apex:inputField value="{!lead.phone}"/>
       </apex:pageBlockSection>
       
    </apex:pageBlock>
   </apex:form>
</apex:page>

 

 

please help me

thanks

 

I am working on a project that has a very large Visualforce page.  I'm breaking it down into more manageable chunks by using a "State" object that encapsulates information about a particuar state inside of smaller objects.  The base class is abstract, and each state extends that abstract class to provide different functionality.  Anyhow, one state manages a purchase order and has a method called getPO ().  I can access that method via an Apex expression like this:

 

{!curState['PO'].PO_Number__c}

 

In that object (which works perfectly).  Obviously I cannot access the getPO() method directly because the base class does not have that method and the Controller that maintains the state object returns the abstract State obejct, I also have a method called getLineItems() that returns a collection of objects (line items on a purchase order).  The collection is a "List."  I can actually test this such as:

 

<apex:outputText value="{!curState['LineItems']}"/>

 

Which shows the collection as having the correct number of elements.

 

When I attempt to iterate over that collection in a pageBlockTable such as:

 

<apex:pageBlockTable id="lineItems" value="{!curState['LineItems']}" var="t">


it will not compile.  The error message is:

    Save error: Cannot coerce from class core.apexpages.el.adapters.RuntimeTypeMetadataELAdapter to class java.lang.Boolean

 

Perhaps I'm misunderstanding what Datatable should take in the value.  However, if I put the exact same list in the controller class, it WORKS.  Any ideas on how I can fix this?

 

Thanks in advance.

 

  • October 05, 2011
  • Like
  • 0