It is a longstanding unsolved problem to characterize the optimal feedbacks for general SLQs (i.e., stochastic linear quadratic control problems) with random coefficients in infinite dimensions; while the same problem but in finite dimensions was just addressed very recently. This paper is devoted to giving a solution to this problem under some assumptions which can be verified for interesting concrete models. More precisely, under these assumptions, we establish the equivalence between the existence of optimal feedback operator for infinite dimensional SLQs and the solvability of the corresponding operator-valued, backward stochastic Riccati equations. A key contribution of this work is to introduce a suitable notion of solutions (i.e., transposition solutions to the aforementioned Riccati equations), which plays a crucial role in both the statement and the proof of our main results.