1

I'm passing a doc datasource into a Custom Control using a property defintion named docDatasource and set to a datatype com.ibm.xsp.model.domino.DominoDocumentData. Just by chance I stumbled upon an editor type named "Datasource Picker". Sounded promising, so I set it to use for m prop definition.

Upon binding the CC into my Xpage - where my doc DS is defined - I indeed can use the picker to choose my datasource ,just as I had expected. But then building the Xpage code I receive an error saying

The value of the property docDatasource cannot be primitive.

So obviously the datatype and the editor don't go along well. There's no harm done really, but I'm curious to learn what else this editor could be used for.

Lothar Mueller
  • 2,528
  • 1
  • 16
  • 29

2 Answers2

1

What to do with name of the data source passed to custom control parameter: retrieve its object by simple binding #{requestScope[compositeData.docDatasource]}.

That will return your data source and you can use this binding where needed. Or store it inside local variable and use it instead.

Frantisek Kossuth
  • 3,524
  • 2
  • 23
  • 42
  • Good point but that's regarding the usage of the cc param INSIDE the CC. Problem seems to be the combination of the data type (expecting an object) and the selection editor (passing the object's name as String). And that causes a compiler error as soon as I embed the CC into my Xpage. - Obviously I have to either use the datatype and pass the datasource object using SSJS, OR I use the editor, define the param as String and then process it as recommended by you; anyways; I think I'll close this as it no longer is a real problem. As always, thanks for your input! – Lothar Mueller Jul 24 '15 at 10:11
0

I dont know where you went wrong.

Here is xpage source:

 <xp:this.data>
    <xp:dominoDocument var="document1" formName="asdf"  action="openDocument" documentId="08f6"/>
</xp:this.data>
<xc:doccc dds="#{javascript:document1}"/>

and custom control:

<xp:label id="label1">
    <xp:this.value><![CDATA[#{javascript:compositeData.dds.getItemValueString("fl_name");}]]></xp:this.value>
</xp:label>

with custom control property named dds, type com.ibm.xsp.model.domino.DominoDocumentData and editor DataSourcePicker.

Ermo
  • 91
  • 1
  • 7
  • Probably you got me wrong: utilizing the editor my data source's name is passed into the CC as a string; source code looks like this: - . Doing this I end up with the above mentioned compiler error. Of course I can compute the value, as in - , and this is what I do right now. - Question is: what do I need the special editor for if I compute the property? – Lothar Mueller Jul 21 '15 at 21:27