Sayyiduna Jabir bin Atik (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) came to visit Abdullah bin Thabit (may Allah be pleased with him), and he (peace and blessings be upon him) saw that death had overcome him. He (peace and blessings be upon him) called out to him, but he did not answer. Then the Messenger of Allah (peace and blessings be upon him) said 'Inna lillahi wa inna ilayhi raji'un' (Indeed, we belong to Allah and to Him we shall return), and said: "O Abu al-Rabi', we have been overcome concerning you." Then the women cried out and wept, and Ibn Atik (may Allah be pleased with him) began to quieten them. The Messenger of Allah (peace and blessings be upon him) said: "Leave them; when it becomes due, let no weeping woman weep." They said: O Messenger of Allah (peace and blessings be upon him)! What is its becoming due? He (peace and blessings be upon him) said: "When he dies."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7153
Sayyiduna Anas bin Malik (may Allah be pleased with him) said: When the Messenger of Allah (peace and blessings be upon him) returned from Uhud, he heard the women of the Ansar weeping, and he (peace and blessings be upon him) said: "But Hamzah (may Allah be pleased with him) has no women to weep for him." This reached the women of the Ansar, and they began weeping for Sayyiduna Hamzah (may Allah be pleased with him). He (peace and blessings be upon him) slept, then woke up while they were still weeping, and he (peace and blessings be upon him) said: "Woe to you! Are you still weeping? Let them be silent, and let them not weep over anyone who dies after today."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7154
Sayyiduna Ibn Umar (may Allah be pleased with them both) said: When the Messenger of Allah (peace and blessings be upon him) returned from the Battle of Uhud, he (peace and blessings be upon him) heard the women of Banu Abd al-Ashhal weeping over their dead, and he (peace and blessings be upon him) said: "But Hamzah (may Allah be pleased with him) has no one to weep for him." Then the women of the Ansar came and began to weep over Sayyiduna Hamzah (may Allah be pleased with him). He (peace and blessings be upon him) slept, then woke up while they were still weeping, and he (peace and blessings be upon him) said: "Woe to them! They are still weeping. Tell them to go back, and let them not weep over anyone who dies after today."
"And let them not weep over anyone who dies after today": if he meant it in general, it is like what is in the hadith of Ibn Atik (may Allah be pleased with him): "When it becomes due, let no weeping woman weep." It is also possible that what is meant is the martyrs of Uhud, as if he (peace and blessings be upon him) said: "What you have wept over them is enough for you." Permission has been reported for weeping after death with the tears of the eye and the grief of the heart, so the hadith of Sayyiduna Jabir bin Atik (may Allah be pleased with him) is to be understood as referring to what is preferable, and Allah knows best.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7155