XPages and Show Single Category in View Control question

In xPages, I’m struggling in trying to figure out how to achieve the traditional “form with embedded view” look and feel. I know Repeat controls and all that are probably the way to go as that is what most examples seem to steer to but I want to try and walk before I run.

I have a very simple xPage for a Company. I have a button that allows me to create “contacts” as response documents. These contacts are created correctly as responses.

I’ve dropped a view for the contacts on the xPage and I’m at this point simply trying to show the contacts for the selected company.

I’m not married to using responses, I typically don’t in client development. I typically pre-poulate a key from the main document to the “child” document and use that. But I haven’t figured that out in xPages yet so I’m trying to start small.

The view is categorized. First column is @text($ref). This is the UNID of the parent correct?

I can find the categoryFilter of the View Control. In the help I see my “companyDoc” and properties for getParentID() and getNoteID() but that doesn’t help me because that’s for the main document.

I’m not sure what to do next? I need to get a handle on the view row somehow I assume. My view is called “vContacts” and the var for the view is “vContacts”. I tried vContacts.getParentID() and that errored out.

Anyway - I’m just trying some simple things to get my feet wet. Any advise would be appreciated.

Thanks!!!

Subject: All what you’re trying to do should be do able with categoryFilter

Though working with the View Panels can be restrictive but there should be ways around these.Try setting the categoryFilter on the view panel to a scoped variable and when you open a document this variable would be set.

So you should be able to open a parent document and then have a view panel that’ll only display it’s responses.

Subject: Working now!!!

Paul,

Thanks or the scoped variables suggestion. That got me what I was looking for!! I ended up using viewScope. Which I believe just lives for the duration of the page.

Good or bad I was at least able to achieve what I wanted. I’ll clean up what I did and make a blog posting or wiki page.

Thanks again!!!