You need to sign in to do that
Don't have an account?
Chaitra GV
Develop a visualforce page which comprises of an input box and search button
Develop a visualforce page which comprises of an input box and search button. If name is entered and the search button is clicked, the page should display name and designation with respect to the name entered.
I tried writing the code below. But it seems to be not working. Please help me to complete this code,
<apex:page controller = "DisplayDesig">
<apex:form>
<apex:pageBlock>
<apex:pageBlockTable value = "{!jobs}" var = "j">
<apex:inputField value = "{!j.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
(Controller to fetch designation from custom object:)
public class DisplayDesig {
public static List<Job__c> provideDesig(String Name)
{
List<Job__c> result =[SELECT Id, Designation__c from Job__c where Name =: Name];
return result;
}
}
I tried writing the code below. But it seems to be not working. Please help me to complete this code,
<apex:page controller = "DisplayDesig">
<apex:form>
<apex:pageBlock>
<apex:pageBlockTable value = "{!jobs}" var = "j">
<apex:inputField value = "{!j.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
(Controller to fetch designation from custom object:)
public class DisplayDesig {
public static List<Job__c> provideDesig(String Name)
{
List<Job__c> result =[SELECT Id, Designation__c from Job__c where Name =: Name];
return result;
}
}
Sorry for this issue you are facing.
Please find the sample code below which does the same.
Visual Force Page: Apex Controller: Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra