function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
L037242283804838405L037242283804838405 

transert input field

hi guys,
how can i transfer input field to the controller by clicking on button
i tried that
<apex:inputField value="{!customer.Name}"/>
                <apex:commandButton action="{!getCustomer1}" value="find">
                  <apex:param name="Mahavir"
                value={!customer.Name}
                />

controller function:
public PageReference getCustomer1() {
     String a=System.currentPageReference().getParameters().get('Mahavir');
customer=
            [SELECT Name, address__c, full_name__c FROM Customer__c WHERE Name =: a];
            return (new ApexPages.StandardController(customer)).view();
   
    }
its not working :(
what should i do its urgent thanks for fast answer
Phillip SouthernPhillip Southern
What are you trying to accomplish?  It looks like you are using standardcontroller.......are you already on the page of the client when you are executing this?

If not....you don't neccearily need a param on the button.....create one in the controller and then reference on your page.  So in the controller under the class declaration do

public string customerName{get;set;}

Then on the page do: <apex:inputText value="{!customerName}"/>

Then for your query: ..... Where Name = :customerName.....