The cap falls out and when I try to screw it back in it doesn't stay
Either the cap is damaged or the reservoir opening is bad and the dispenser would need to be replaced.
The rinse agent will not dispense. Will replacing the cap fix this?
Answer Raimond, Probably not, The cap is usually not the issue, it can be cleaned with hot, soapy water if you wish. The more common issue is coagulated rinse agent, or a defect in the dispenser solenoid linkage. You may have to replace the dispenser assembly W10224428, but you may want to remove it and drain it and allow it to soak in hot soapy water and remove the residual rinse agent from the dispenser.