I have a parameter that is always giving me a null value. I tried the assignto tag, to no avail, now I am trying to retrieve the parameters. I am still getting a null value.
Attached below is the apex class and the VF code.
<apex:pageBlockTable id="ORDER_TABLE" value="{!ordList}" var="ord" style="table">
<apex:column >
<apex:facet name="header">Order Name</apex:facet>
<apex:outputText value="{!ord.Name}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Order Date</apex:facet>
<apex:outputText value="{!ord.OrdDateTime__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Order Total</apex:facet>
<apex:outputText value="{!ord.Order_Total__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Status</apex:facet>
<apex:outputText value="{!ord.Status__c}"/>
</apex:column>
<apex:column >
//This is the important section
<apex:facet name="header">Order Details</apex:facet>
<apex:commandButton id="ordDetails" value="Details" action="{!getDetails}" rerender="out">
<apex:param name="date" value="{!ord.OrdDateTime__c}" assignTo="{!orderDate}"/>
</apex:commandButton>
</apex:column>
</apex:pageBlockTable>
//The important section ends here
<apex:commandButton action="{!getUserOrders}" rerender="ORDER_TABLE" value="GET MY LIST!" />
</apex:pageBlock>
</apex:form>
<apex:form >
<apex:outputpanel id="out">
<apex:pageBlock >
<apex:pageBlockTable id="Detail_Order" value="{!detOrd}" var="det" style="table">
<apex:column >
<apex:facet name="header">Order Name</apex:facet>
<apex:outputText value="{!det.ItemSKU__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Order Date</apex:facet>
<apex:outputText value="{!det.ItemDescription__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Order Total</apex:facet>
<apex:outputText value="{!det.Quantity__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:outputpanel>
APEX
public List<UserOrder__c> ordList {get; set;}
public List<Order__c> detOrd {get; set;}
public String orderDate {get; set;}
public void getUserOrders() {
String userName = UserInfo.getUserID();
List<UserOrder__c> ords = [
select Name, UserID__c, OrdDateTime__c, Order_Total__c, Status__c
from UserOrder__c
where UserID__c =: userName
];
// Pass out the value
ordList = ords;
}
//This is the important section
public void getDetails() {
System.debug('kutta');
String userName = UserInfo.getUserID();
orderDate = ApexPages.currentPage().getParameters().get('date')
System.debug(orderDate); //this is null
List<Order__c> ord = [
select UserID__c, ItemSKU__c, ItemDescription__c, Quantity__c
from Order__c
where USERID__c =: userName
];
detOrd = ord;
}
//Important section ends here