Welcome to the IBM Collaboration Solutions Community IQJam.
UsernamePassword
Reset Password | Register
   
Home | Leader Board | Tags | Help
How to get value from Repeater Control. 

Hi All,

I will be very thankful to you for your kind support and help.

Scenario is:

I have a repeater control on the Xpage and that repeater contorl contains two edit box named EditBox1 and EditBox2. At the bottom of this repeater contorl I have a save button which would create documents by extracting these two pair of edit box field. My data source for repeater control is @DbColumn which repeat these contorl 3times or 4times or based on the number of value returned by @DbColumn. Now my problem is that I am not able to extract these value from multiple edit boxes when it rendred to the browser. What Id should I used to get value of all boxes or how I can acheive these. Please help me.

I will be very thankful to you for your kind response.

With Regards,

Vikas K Sinha

Domino Development / XPages
Vikas Sinha - about 1 year ago |  |  | Viewed 661 times
File Name
test.jpg

There are 3 answers

0votes

Hi Vikas,

  The scope of row variable of a repeat control is within the repeat control only. You will not be able to access from outside it.

Alternatively you can set the variables to scoped variables (requestScope, viewScope or sessionScope) and get it outside your repeat Control.

Hope this helps.

Mervin



Mervin Thomas - 12 months ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


0votes

What you could do is the use the functionality the JSF framework ( on which xpages is build ). The context global can be used to retrieve the request ( getRequest() if im not mistaken ) . In this request exists a method ( getParameterMap()) which contains all the parameters that where send with the request.

Simple iterating over this map will return all the submitted values. This map contains ALL fields that where available at the time of the submit. So the fields generated by the repeater are also available. The only thing you would need to know are:

  1. The ID generated for the repeater by xPages ( something like <viewID>:<repeatID> use firebug to see the generated IDś).
  2. the ID's that where generated from the editboxes inside the repeat. These idś correspond with keys in the parameter map.

Simple reading the values and do a document.replaceItemValue("field",value). Would do the trick here. It is not as easy as you would expect with notes development but it is an option you can consider



jeroen somhorst - 10 months ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


0votes

I simulated something for you, please review solution.jpg, I will reply you accordingly.


File TypeSizeFile NameCreated On
image/jpeg 167 KB solution.jpg 8/18/11 2:11 PM

Atul Saxena - 9 months ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community