When the property sued for is in the possession of the plaintiff and the action is dismissed, the court shall cause a jury to assess the alternate value of the property and also the value of the hire or use thereof during the time it was in the possession of the plaintiff and shall enter judgment for the defendant for the recovery of the property, or its alternate value, and damages for the use or hire thereof.
Ala. Code § 6-6-257 (1975)