Using Xpage Control as an Embedded View Filter Key

I’ve embedded a view into an xpage - works great. What I want to do now is filter the view results using a Key. I’d like the key to be the text string in my xpage control ‘label1’. I can’t get this to work. If I hard-code in a value like ‘Abel’, the filtering works, this is the code:

<xp:dominoView var=“view2” viewName=“rolebyres”

keys="#{javascript:'Abel'}">

How do I substitute the text string in my control ‘label1’ into this code? Any suggestions please. JV

Subject: Is the Function currentDocument.getValue() appropriate?

Reviewing the literature, perhaps using the server side 'CurrentDocument.fetValue() function might be the ticket for this, using the document field name ‘ComputerName’ as the key:

<xp:dominoView var=“view2”

					keys="#{javascript:currentDocument.getValue(ComputerName)}">

</xp:dominoView>

This code generates an error:

Required property “viewName” for xp:dominoView is not present.

But am I at least on the correct path? Any comments appreciated. JV

Subject: Use getComponent(“foo”).getValue()

You are very close. This is what you need to use:

<xp:dominoView

var="view2"

databaseName="foo.nsf"

viewName="rolebyres">

<xp:this.categoryFilter><![CDATA[#{javascript:getComponent("label1").getValue()}]]></xp:this.categoryFilter>

</xp:dominoView>

Of course you don’t need to use a label (and maybe shouldn’t really). You can use a combobox or editable field, or value from a selected document. XPages gives a lot of flexibility.

hth --Graham