+ Start a Discussion
vinod fnuvinod fnu 

how to pass values from vf page to the controller to crete a list based on the input field on the vf page.

<apex:page standardcontroller="Entity__c" extensions="wrapperclassTwo">
  <apex:form >
  <apex:pageBlock >
      <apex:outputText>  
      Trust Name
      </apex:outputText>
      <apex:inputfield label="name of trust" value="{!Entity__c.name}"/>
      <apex:inputfield label="name of trust" value="{!lnput}"/>
  <apex:pageBlockSection columns="1" title="Transactions1">


i want to use either {!Entity__c.name} or the {!lnput}
in the controller class.


controller
public with sharing class wrapperclassTwo {
    public wrapperclassTwo(apexpages.StandardController controller){}
 ///  public string input = entity__c.name;
    Public string input{get;set;}
    Public string lnput{get;set;}
    list<Tnetoutputtransaction__c> obl1= new list<Tnetoutputtransaction__c>();
    List<Account_Holdings_Tax_Lots__c> obl2 = new list<Account_Holdings_Tax_Lots__c>();

    public list<wrapperClass> wrapperClassList = new list<wrapperclass>();
    public list<wrapperClass>getListWrapperObjectMethod(){
        
        obl1 =[select name,id From Tnetoutputtransaction__c limit 15 where name={!input];/or {!Entity__c.name}
         obl2 =[select name,id From Account_Holdings_Tax_Lots__c limit 15];
      
i want to use the that to 
 
Sunil RathoreSunil Rathore
Hi,
Please use the below code snippet:
<apex:page standardcontroller="Entity__c" extensions="wrapperclassTwo">
  <apex:form >
  <apex:pageBlock >
      <apex:outputText>  
		Trust Name
      </apex:outputText>
      <apex:inputfield label="name of trust" value="{!firstInput}"/>
      <apex:inputfield label="name of trust" value="{!secondInput}"/>
	  <apex:commandButton action="{!getListWrapperObjectMethod}" value="Give any name want to display on button"/>

  <apex:pageBlockSection columns="1" title="Transactions1">

  
  public with sharing class wrapperclassTwo {
	  ///  public string input = entity__c.name;
	public string firstInput{get;set;}
	public string secondInput{get;set;}
	public list<wrapperClass> wrapperClassList = new list<wrapperclass>();
	public wrapperclassTwo(apexpages.StandardController controller){
	}

	public list<wrapperClass>getListWrapperObjectMethod(){
		list<Tnetoutputtransaction__c> obl1= new list<Tnetoutputtransaction__c>();
		List<Account_Holdings_Tax_Lots__c> obl2 = new 
                     list<Account_Holdings_Tax_Lots__c>();
		obl1 =[select name,id From Tnetoutputtransaction__c limit 15 where name=: 
                   firstInput or secondInput];
		obl2 =[select name,id From Account_Holdings_Tax_Lots__c limit 15];
	}
}
Let me know if it helps you.

Many Thanks,
Sunil Rathore
 
satish palsatish pal
Hi,
Please see the below code 
VF page:
<apex:page   standardController="Entity__c" extensions="wrapperclassTwo"  >
 <apex:form id="myForm">    
      <apex:inputField label="Aname" value="{!Entity.name}"/>
      <apex:commandButton value="Next" action="{!GetData}"/>
    </apex:form>
</apex:page>


Controller class:

Public Class wrapperclassTwo{
public Entity__c Entity{get; set;}


    public wrapperclassTwo(ApexPages.StandardController controller) {
Entity=new Entity__c();
    }
     public void GetData(){
     system.debug(Entity.name);
}
}


Let me know if it helps you.

Many Thanks,
Satish Pal
vinod fnuvinod fnu
@sunil

i am still getting the same error.
Could not resolve the entity from <apex:inputField> value binding '{!input}'.  <apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable.