1
votes

I am having an issue with multiple custom controls on the same xpage and was wondering if anyone else was seeing the same issue.

Here is how to create the issue.

  1. Create a custom control with an edit box. In the onChange event of the edit box, simply get it's value and store it in a variable. Nothing more than that.

  2. Create an xPage and place a button on the xpage. Make the button do something with SSJS so you know it was pressed like setting a value of a field on the form.

  3. Place the custom control you created on the form more that once.

  4. Display the xpage and change the value of one of the input boxes on the xpage.

What was happening to me is that the button only works every other time. If the custom control is placed on the xpage only once then the button works every time. If the onChange event in the edit box is removed then the button works every time.

1
Post the example code and it's easier to help you.Fredrik Norling
Did you try to assign the value in your onChange event to different variables (e.g. use the client ID as key). It looks like a concurrency issue.stwissel
It was simply assigned a local value var v = getComponent("inputText1").getValue();. What is strange is the button event will work the "next" time you press it after you type something in the edit box. In other words type something, press button (does not work), press button again then it works. As long as you don't type something in the edit box again the button continues to work. It happens in both ie and ff.Bruce Stemplewski
Issue even seems to occur when there is no code in the onChange event just comments. "// Just a comment" causes the issue. The onChange event must be completely blank for the issue not to occur.Bruce Stemplewski

1 Answers

1
votes

This will only happen if you have SSJS in your onchange event that is peforming a full refresh and your button is peforming a partial refresh. If you let the onchange events partially refresh, it should work. Also, it looks like the onchange events are fired when you LEAVE the textbox, so when you change it, do not leave, and push the button, it doesn't work anymore as you said. But it did! It just fired the the full refresh the onchange event of the textbox and therefore 'skipped' the event from the button (because of the full refresh, the button onclick event will get a new id somehow).