I am trying to pass a String field from VFPage to an Apex custom controller class and use this field to add to a list . Can you help with the problem (string value is not passing to the list, it is always null) What am I missing?
Visualforce code
<apex:pageBlockSectionItem>
<apex:outputLabel Value="Scan Item">
<apex:inputtext Value="{!scans}">
</apex:pageBlockSectionItem>
<apex:commandButton value="Go" action="{!getscan}">
<apex:pageBlockSection>
Apex Class Code
public string scans {get; set;}
public string namestr = Apexpages.currentPage().getParameters().get('scans');
public PageReference getscan() {TAList.add(New Document_Detail__c(Document__c = cID,apply_tax__c=TRUE, sitem__c = namestr, item_qty__c=1, Transaction_Type__c = 'Regular'));
return null;}
sitem__c is always null (namestr is not getting value from scans)
Any pointers , greatly appreciated
thanks,
Eug