I am hoping that someone can offer me some helpful advice with repeat controls.
I am developing a basic little “shopping cart”-type custom control, where each row of the cart is represented by a line from a view. I have the repeat control setup properly, and the products appear exactly as I want them.
I have also added an edit box into the repeat control. This will allow the visitor to add the number of units they wish to order before clicking the “add to cart” button.
I have all of the necessary logic built to accumulate the items added to the cart in a sessionScope variable (thanks very much to Declan Sciolla-Lynch and his article on this here: Advanced XPages : Extending the sessionScope to store a hashmap | Dec's Dom Blog).
However, I am trying to determine how to reference the edit box on each row using server-side script. For instance, I can get a handle on the represented document ID by using the code: “var thisDocID = rowData.getUniversalID();”. I now need to get a handle on the associated edit box with an ID of “inputText1”.
I’ve also been toying with the idea of displaying a dialog box to collect the qty (instead of an individual edit box on each row), and have been using Declan’s blog as well as Jeremy Hodge’s examples over on the XPage Blog (サッカー ユニフォーム 安い – xpagesblog.com | 安いジャージを買う。 21.99 という安いジャージ。 ファンに最高のコレクションを提供します。 安心してお買い物をしてください。) to give this a go using client-side script. Can anyone comment on the best method of achieving this? I’m sure many have gone down this path before - Is there anything I should really watch out for/avoid? This is going to be quite a small “store” so volume is not really an issue for me. However, I’d like to stick with “best practices” so that my solution can scale should I need to migrate the logic into a larger project.
I hope that is descriptive enough to allow someone much more experienced than I to give me a nudge in the right direction.
Thanks very much for any assistance that you may be able to provide!
T.