0
votes

my co-workers and I are reworking our application so that it uses java beans instead of domino documents as data sources. The documents are entirely handled inside the java classes and we only refer to the beans inside the XPages and custom controls.

We can create and edit documents fine, but in case we just want to display the data there's a problem: All fields in the XPage containing bean properties are in edit mode, but for security reasons we need them to be in read mode.

Now, with domino documents we could easily switch between those modes, because the documents "know" in what kind of mode they are in, but there seems to be no such thing for java beans - at least in XPages (there's very little documentation or examples for this anyway - as far as I know).

I don't have that much experience in JSF so I'm a little bit stuck here.

Regards, Sarah

1

1 Answers

1
votes

What could be a solution is to add viewScope variables which are used to control the 'mode' of the bean. In your controls you then could toggle the 'readonly' property based on this viewscope var.

Another solution would be to add this property to your bean ( isEditable()) and let the readonly property be managed by this property of the bean itself.