Xpages error when trying to access edit mode in client notes

I am trying to open some kind of document. from viewPanel inside client notes. The application also works on the Internet.

When I open the document. in read mode, and then click the "Edit" button:

<xp:button value=" Editare" id="buttonEdit" rendered="#{javascript:!currentDocument.isEditable()}" > <xp:eventHandler event="onclick" submit="true" refreshMode="complete"> <xp:this.action> <xp:changeDocumentMode mode="edit" var="Contr"></xp:changeDocumentMode> </xp:this.action> </xp:eventHandler> </xp:button> 

I get the following error:

An exception

java.lang.String is incompatible with javax.faces.model.SelectItem

this only happens in the notes client.

From the stack trace:

  com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(Unknown Source) com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(Unknown Source) com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(Unknown Source) com.ibm.xsp.renderkit.html_basic.MenuRenderer.encodeEnd(Unknown Source) .... .... 

After deleting one combo, I noticed that there was an error on this, the values โ€‹โ€‹of which:

 var a = [].concat(@Unique(@DbColumn(dbname, "vwA", 0))).sort(); var b = @Unique(@DbColumn(@DbName(),"vwB",0)); return a.concat(b); 

Any ideas why and how I can fix this problem?

+2
source share
2 answers

It is very likely that the error comes from your SSJS dbname variable. Double check what value is set for this variable.

I get the same java.lang.String incompatible with javax.faces.model.SelectItem error java.lang.String incompatible with javax.faces.model.SelectItem if dbname is a string instead of an array .

+3
source

Unfortunately, stack traces do not help me isolate the error. However, I can guess that your problem is that the selectItems (plural) value is set as a string, and not something with multiple values. The selectItem (singular) element may contain a string as a value, but not selectItems (plural).

So, this selectItems set for combobox is valid:

 <xp:selectItems> <xp:this.value><![CDATA[#{javascript:applicationScope.globalSettings.allCurrencies}]]></xp:this.value> </xp:selectItems> 

Like this one:

 <xp:comboBox id="emailTypeCB1" value="#{newOrgDoc.EMailType}"> <xp:this.defaultValue><![CDATA[#{javascript:var keywordChoices = new TS_Keywords(); var tmp = keywordChoices.Lookup("Contact / email types", true); return keywordChoices.getDefaultValue();}]]></xp:this.defaultValue> <xp:selectItem itemLabel="-- choose --" id="selectItem14"> </xp:selectItem> <xp:selectItems id="selectItems12"> <xp:this.value><![CDATA[#{javascript:return new TS_Keywords().Lookup("Contact / email types", true);}]]></xp:this.value> </xp:selectItems> </xp:comboBox> 

But, if I tried this, it would not work if viewScope.myChoices was a string, and not something with multiple values:

 <xp:comboBox id="emailTypeCB1" value="#{newOrgDoc.EMailType}"> <xp:selectItems id="selectItems12"> <xp:this.value><![CDATA[#{javascript:viewScope.myChoices;}]]></xp:this.value> </xp:selectItems> </xp:comboBox> 

I would suggest that the difference is not only that you opened it in XPiNC and in the browser, but in each of them the value was set differently - as a result, when you were in Notes.

0
source

Source: https://habr.com/ru/post/1201814/


All Articles