Custom values in a doc-based combo box?

  • Using the slog/clean/build approach, I’ve finally discovered my problem. It probably really is me, but I can point to code!

  • The combo box(s) I’m using must support values not on the doc-based list, so I have a selectItems that pulls values from a document, and a selectItem that pulls the current value from the document. The UI shows them all just like they belong there. So far so good.

  • BUT some of the documents do not have this field populated. When it’s not populated I get a NullPointerException stack trace at

javax.faces.model.SelectItem.setValue(SelectItem.java:277)

which I believe is where it’s trying to set the value on the independent selectItem to capture the current value in the combo box. Since there is no current value it can’t handle it.

  • I tried setting rendered to bypass this element, but the error still occurs. I tried setting loaded but it complains on build.

  • I tried putting a JS conversion in for value==null ? “” : value, but always gives “” even when a value is present.

  • I tried using @GetField(“field”) but it does nothing but complain that the syntax is incorrect, even though this near-trivial instance is indentical to the “example” in “help”.

  • How does one do this? Thanks for your time…