This is an appeal from .an order of the district court denying the plaintiffs’ petition for an award of attorneys’ fees. The original action was brought pursuant to 42 U.S.C. § 1983. The plaintiffs contend that they are the prevailing parties and are therefore entitled to reasonable attorneys’ fees under 42 U.S.C. § 1988.1
The underlying action here arises from appellants’ suit seeking declaratory relief and preliminary and permanent injunctive relief for violations arising from the unlawful administration of the Kansas Medicaid program. Specifically, the plaintiffs claimed that the methodology used by the defendants, which became effective on October 1, 1990, did not meet the requirements of 42 U.S.C. § 1396a(a)(13)(A).
On December 31, 1990, the district court issued a preliminary injunction enjoining the defendants from implementing and maintaining the October 1,1990, Medicaid rates. The defendants filed their notice of appeal on January 22,1991, and perfected the appeal to this court. On March 4, 1991, the plaintiffs filed a motion to add an additional party plaintiff and for class certification. The district court granted the motion and a second amended complaint was filed on November 1, 1991.
On March 12, 1992, this court vacated the preliminary injunction on the grounds that the two plaintiff associations lacked standing to sue as representatives of their members. Kansas Health Care Ass’n v. Kansas Dept. of Social and Rehabilitation Services, 958 F.2d 1018 (10th Cir.1992). On July 20, 1992, the district court granted the defendants’ motion to dismiss, 794 F.Supp. 356, and subsequently denied the plaintiffs’ motion for attorneys’ fees, 826 F.Supp. 389, which is the subject of this appeal.
A plaintiff must be a “prevailing party” to recover an attorney’s fee under § 1988. A plaintiff may prevail in the absence of a judicial determination or full litigation. Maher v. Gagne, 448 U.S. 122, 129, 100 S.Ct. 2570, 2574, 65 L.Ed.2d 653 (1980). The test for determining whether a plaintiff is a prevailing party when there has been no adjudication was recently set forth in J & J Anderson Inc. v. Town of Erie, 767 F.2d 1469, 1475 (10th Cir.1985), and contains two elements which must be satisfied. The plaintiff must demonstrate that his lawsuit is linked causally to the relief obtained, i.e. the suit must be a “substantial factor or a significant catalyst” in prompting the defendants to act or cease their behavior. He must also demonstrate that the defendant’s conduct in response to the lawsuit was required by the Constitution or federal law, i.e. the defendant’s actions must be legally required.
The first element in an analysis of whether the plaintiff is a prevailing party, involves a factual inquiry; whether the lawsuit caused the defendant to act. The trial court is in the best position to evaluate this issue because it has dealt with the parties and can evaluate the strengths and weaknesses of the case. If the “prevailing party” issue turns on the first element, then the appellate court should apply the clearly erroneous standard of review. The second element primarily requires legal analysis, although the facts certainly bear on the outcome. Because this second element stresses legal analysis, if the “prevailing party” issue is resolved by whether a defendants’ actions are legally required, then de novo review is appropriate. Supre v. Ricketts, 792 F.2d 958, 962 (10th Cir.1986); Nadeau v. Helgemoe, 581 F.2d 275 (1st Cir.1978).
The plaintiffs contend that they were the prevailing parties under both standards outlined above because they obtained a judicial determination on the merits when the court entered its order for a preliminary *1054injunction on December 31, 1990, and are, therefore, prevailing parties. They further contend that the implementation of TN-91-09 provided the plaintiffs with some of the relief they sought and the preliminary injunction was the factor in prompting the defendants to implement the amendment. In addition, they assert that the implementation of the new state plan amendment was required by law because the court found the reimbursement rates of the challenged amendments were inadequate, meeting the test set forth in Supre and Nadeau.
In a well reasoned opinion, the district court denied the plaintiffs’ petition for attorneys’ fees, holding that the Tenth Circuit has adopted a two part test:
The plaintiff must demonstrate that his lawsuit is linked causally to the relief obtained, i.e. the suit must be a ‘substantial factor or a significant catalyst’ in prompting the defendants to act or cease their behavior. He must also demonstrate that the defendant’s conduct in response to the lawsuit was required by the Constitution or federal law, i.e. the defendant’s actions must be legally required. Supre v. Ricketts, 792 F.2d 958, 962 (10th Cir.1986) (quoting J & J Anderson, Inc. v. Town of Erie, 767 F.2d 1469, 1475 (10th Cir.1985)). This test was first set forth in Nadeau v. Helgemoe, 581 F.2d 275 (1st Cir.1978). The Tenth Circuit stated:
The purpose of the Nadeau test is to ensure, in cases where a concession of defeat might be inferred from defendant’s conduct, that the conduct was actually brought about by the lawsuit. Attorney’s fees should be awarded only when the suit brought about such conduct, and not when the defendant acted supererogatorily. Dahlem v. Board of Educ. of Denver Public Schools, 901 F.2d 1508, 1512, n. 3 (10th Cir.1990).
Kansas Health Care Ass’n v. Kansas Dept. of Social and Rehabilitation Services, 826 F.Supp. 389, 390 (D.Kan.1993).
The district court held that the plaintiffs could not succeed as the prevailing parties on the basis of the Nadeau test, finding that the defendants’ conduct was not required by law, the second prong of the test. On this issue, the court said:
The Court, however, cannot find that the defendants’ conduct was required by law. After the court’s order was vacated, the defendants had every legal right to seek recoupment from the plaintiffs. The decision not to seek recoupment was more likely the result of economic factors, as stated in Secretary Whiteman’s affidavit, than litigation strategy. Thus, the relief obtained by the plaintiffs remained in place through the gratuitous actions of the defendants, not because of a legal requirement. To draw any other conclusion would be to assume facts not before the court.
Id. at 391.
We agree with the district court’s decision. As the district court said, this circuit has adopted a two-prong test in determining whether a plaintiff is entitled to attorney’s fees. First, the suit must be a substantial factor, or a significant catalyst, in prompting the defendants to act or cease their behavior, and second, the defendants’ conduct must have been required by federal law. In other words, the defendants’ actions must be legally required. Supre, 792 F.2d at 962; Collins v. Romer, 962 F.2d 1508, 1514 (10th Cir.1992); Luethje v. Peavine School Dist. of Adair County, 872 F.2d 352, 354 (10th Cir.1989); Nadeau, 581 F.2d 275; see Stewart v. Donges, 979 F.2d 179, 182 (10th Cir.1992); Foremaster v. City of St. George, 882 F.2d 1485, 1488 (10th Cir.1989); MacLaird v. Werger, 723 F.Supp. 617 (D.Wyo.1989); Bethany Medical Center v. Harder, 693 F.Supp. 968, 981 (D.Kan.1988). See also Hoyt v. Robson Companies, Inc., 11 F.3d 983 (10th Cir.1993); Arkla Energy Resources v. Roye Realty and Developing, 9 F.3d 855 (10th Cir.1993).
While it is true that the plaintiffs prevailed in the district court on the issues of the reimbursement to the nursing facilities, the analysis does not stop there. In addition, the defendants’ actions must have been legally required. When this court vacated the district court’s order, holding that the plaintiffs have no standing, that decision went to the heart of the district court’s jurisdiction and *1055the defendants’ conduct was not required bylaw. In fact, as the district court observed, the defendants had every legal right to seek recoupment from the plaintiffs. The fact that they did not seek recoupment does not change the analysis.
The plaintiffs make much of certain language contained in a concurring opinion in Supre v. Ricketts, 792 F.2d at 964. The plaintiffs’ position is that requiring the plaintiffs to show that they would have prevailed on the merits is merely a showing that the defendants’ conduct was not “a wholly gratuitous response to an action that in itself was frivolous or groundless.” Apparently, the plaintiffs derive their position from the following language:
The two elements of Nadeau were thus approved by this circuit. The term “gratuitous conduct” acquired a definition by our eases (as well as by Nadeau as an action not required by law[) ]. In J & J Anderson we held that regardless of the result of the lawsuit it must be determined whether the suit “as a matter of law, involved the vindication of rights secured to the plaintiff by the Constitution.” We there quoted from Williams v. Leatherbury, 672 F.2d 549 (5th Cir. [1982]), as to the causal connection requirement and then significantly emphasized the following from Leatherbury, “and that defendant’s conduct was required by law, i.e., not a wholly gratuitous response to an action that in itself was frivolous or groundless.”
Supre, 792 F.2d at 964 (Seth, J., concurring).
From this language, the plaintiffs conclude that the “required by law” prong of the catalyst test is, in essence, a showing that the defendants’ response was necessarily to an action that in itself was frivolous or groundless. We disagree with the plaintiffs’ reading of the court’s language in that case. The essential part of that language is “that the defendants’ conduct was required by law.” The court’s reference to “a wholly gratuitous response to an action that in itself was frivolous or groundless” is obviously intended as only one example of the type of conduct referred to by the court. In this case, the defendants’ conduct clearly was not required by law, since this court held that the plaintiffs had no standing to sue. The effect of that decision was to render the decision of the district court a nullity. As the district court correctly pointed out, when this court found that the plaintiffs did not have standing to sue, the district court’s preliminary injunction order became void, as if it had never existed. Thus, the parties were in exactly the same position after the reversal as they were on the day the lawsuit was filed. At a minimum, to be considered a prevailing party within the meaning of § 1988, the plaintiff must be able to point to a resolution of the dispute which changes the legal relationship between itself and the defendant. Texas Teachers v. Garland School District, 489 U.S. 782, 792-793, 109 S.Ct. 1486, 1493-1494, 103 L.Ed.2d 866 (1989); Hewitt v. Helms, 482 U.S. 755, 760-761, 107 S.Ct. 2672, 2675-2676, 96 L.Ed.2d 654 (1988). The touchstone of the prevailing party inquiry must be the material alteration of the legal relationship of the parties in a manner which congress sought to promote in the fee statutes. Texas Teachers v. Garland School District, 489 U.S. at 793, 109 S.Ct. at 1494. As the First Circuit said in Nadeau:
Even if plaintiffs can establish that their suit was causally related to the defendants’ actions which improved their condition, this is only half of their battle. The test they must pass is legal as well as factual. If it has been judicially determined that defendants’ conduct, however beneficial it may be to plaintiffs’ interests, is not required by law, then defendants must be held to have acted gratuitously and plaintiffs have not prevailed in a legal sense. See Taylor v. Safeway Stores, Inc., 524 F.2d 263 (10th Cir.1975).
Nadeau, 581 F.2d at 281; see also Pearson v. Western Elec. Co., 542 F.2d 1150, 1153 (10th Cir.1976). Here the defendants’ conduct was not required by law however beneficial it may have been to the plaintiffs’ interests.
After finding that this court’s order rendered its order void, the district court concluded that the defendants had every legal right to seek recoupment from the plaintiffs. The district court found that the defendant did not seek recoupment as a result of economic factors rather that litigation strategy *1056and thus the relief obtained remained in place through the gratuitous actions of the defendants, not because of a legal requirement.
In the final analysis, we can only conclude that no matter how one stretches the status of “prevailing party”, no change in the legal relationship of the parties was effected by the plaintiffs’ actions in this case.
For the reasons stated, the judgment of the district court is affirmed.
. 42 U.S.C. § 1988 states: In any action or proceeding to enforce a provision of sections 1981, 1981a, 1982, 1983, 1985, and 1986 of this title, ... the court, in its discretion, may allow the prevailing party, other than the United States, a reasonable attorney’s fee as part of the costs.