How to know validation of which control is getting failed

Sometimes in XPage applications it happens that our code do not run due to validation errors.
It becomes really difficult to debug if the form contains too many fields. To simplify the debug process in this scenario I have written a code snippet which gives client id of the control for which validation is getting failed.

Lesson: Never Try to Justify

A a very beautiful story!! about Imam Al-Shafi’ie ..

While Imam Shafi’i was sitting with his students, a maid came to him and said : “O Imam ! how come you fornicate by night and then turn to a preacher by day ?!!”

The students of Imam Shafi’ looked at him waiting for him to deny her claim. The Imam just looked at her and told her :”how much do you want me to pay you (as a wage for that night)?”
His students became so furious; some of them started to yell, others stood up to leave the room.

The Imam told them:”consider me as a date which you eat its good part and then throw away its stone.”
The students didn’t like what he said.

Suddenly, a man came running to the maid telling her:”Your house is on fire and all your children are inside of it!”
All of them, including Ash-Shafi’i, run to the burning house. The Imam entered the house quickly and saved the children.

At that point, the maid confessed with a broken spirit:”the Jewish made me accuse you falsely to ruin your reputation in front of your students”
The students of the Imam looked at him wondering about the reason which stopped him from defending himself in front of them.

Ash-Shafi’I said:”If I had denied the accusation, you would have split into 2 groups : a group which would not believe me and another one which would believe me but would continue to have doubts about me. So, I just wanted to entrust all my affair to Allah!

*Lesson taken from that : when you are falsely accused, never try to justify yourself too much to people no matter how oppressed and wronged you felt. Entrust all your affairs to Allah because HE is The Knower of what is hidden from people..

XPages: Rendered Vs Loaded

Today I observed runtime error in one of my XPage. I investigated later and found that the error is occuring on a custom control which should not be rendered in this scenario. I have several custom controls added on my XPage and display only one custom control based on some condition, so I have computed the rendered property.
Now the question is, if the custom control is not rendered then why it is generating error?
I further investigated properties of the custom control and found there is a property “loaded”.

Rendered: it controls the visibility of the control, i.e., if it is true then the markup for this control will be added in the response.

Loaded: it controls the creation of control, i.e., if it is true then only the control is going to be created else it will not be created.

Coming to my problem, I moved my code from rendered to loaded property and everything is working fine. The custom control is not being created so there is no possibility of execution of any code inside that custom control.

Get list of XPages

Following code will return the list of all XPages available in the specified database:

Share network drive on rdesktop

If you want to share clipboard and map your local drive as server’s network drive, you can do this using rdesktop.

Once you get connected your home directory will be available on the server as network drive.