You need to sign in to do that
Don't have an account?
d.tejdeep@nicomatic.in
how to show the record list querying the user input
controller:
public with sharing class textInputsCon {
public String inputText1{get;set;} // input text1 value from vf
public String inputText2{get;set;} // input text2 value from vf
public showlist(){
list<Quote__c> quo= [select Quote_Number_New__c from quote__c where Quote_Number_New__c=:inputtext1 ];
return list<Quote__C> quo.getrecords();
}
}
vfpage:
<apex:page showHeader="false" sidebar="False" controller="textInputsCon">
<apex:form >
Input Text1 <apex:inputText value="{!inputText1}"/>
Input Text2 <apex:inputText value="{!inputText2}"/>
<apex:commandButton value="list" action="{!showlist}"/>
<apex:pageBlock >
<apex:pageBlockTable value="{!Quote__c}" var="q">
<apex:column value="{!q.Quote_new_number__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Error: textInputsCon Compile Error: unexpected token: 'list' at line 6 column 13
i want to query the user input and get results in the same page.how can i do that can any one correct this error
public with sharing class textInputsCon {
public String inputText1{get;set;} // input text1 value from vf
public String inputText2{get;set;} // input text2 value from vf
public showlist(){
list<Quote__c> quo= [select Quote_Number_New__c from quote__c where Quote_Number_New__c=:inputtext1 ];
return list<Quote__C> quo.getrecords();
}
}
vfpage:
<apex:page showHeader="false" sidebar="False" controller="textInputsCon">
<apex:form >
Input Text1 <apex:inputText value="{!inputText1}"/>
Input Text2 <apex:inputText value="{!inputText2}"/>
<apex:commandButton value="list" action="{!showlist}"/>
<apex:pageBlock >
<apex:pageBlockTable value="{!Quote__c}" var="q">
<apex:column value="{!q.Quote_new_number__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Error: textInputsCon Compile Error: unexpected token: 'list' at line 6 column 13
i want to query the user input and get results in the same page.how can i do that can any one correct this error
Use this code.
public with sharing class textInputsCon {
public String inputText1{get;set;} // input text1 value from vf
public String inputText2{get;set;} // input text2 value from vf
public list<Quote__c> quo{get;set;}
public showlist(){
quo= [select Quote_Number_New__c from quote__c where Quote_Number_New__c=:inputtext1 ];
}
}
<apex:page showHeader="false" sidebar="False" controller="textInputsCon">
<apex:form >
Input Text1 <apex:inputText value="{!inputText1}"/>
Input Text2 <apex:inputText value="{!inputText2}"/>
<apex:commandButton value="show " action="{!showlist}" rerender=listPanel"/>
<apex:pageBlock id="listPanel">
<apex:pageBlockTable value="{!quo}" var="q" >
<apex:column value="{!q.Quote_new_number__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Hope this helps you.
Thanks
ShaT
All Answers
Use this code.
public with sharing class textInputsCon {
public String inputText1{get;set;} // input text1 value from vf
public String inputText2{get;set;} // input text2 value from vf
public list<Quote__c> quo{get;set;}
public showlist(){
quo= [select Quote_Number_New__c from quote__c where Quote_Number_New__c=:inputtext1 ];
}
}
<apex:page showHeader="false" sidebar="False" controller="textInputsCon">
<apex:form >
Input Text1 <apex:inputText value="{!inputText1}"/>
Input Text2 <apex:inputText value="{!inputText2}"/>
<apex:commandButton value="show " action="{!showlist}" rerender=listPanel"/>
<apex:pageBlock id="listPanel">
<apex:pageBlockTable value="{!quo}" var="q" >
<apex:column value="{!q.Quote_new_number__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Hope this helps you.
Thanks
ShaT
I have a selectlist of equal ,not equal to , less than ....how can i change logic in this query according to user input