Я столкнулся с проблемой доступа к UI component
(button
) на странице в методе onPageLoad()
. Я использую технологию ADF с JDveloper 11.1.2.3, пример использования:
Я пытаюсь отключить или включить кнопку при загрузке страницы на основе информации, поступающей из базы данных. в моей ситуации я выполняю запрос, который проверяет, есть ли в базе данных сохраненный файл; если есть файл, должна быть включена кнопка для загрузки, которая позволяет пользователю загружать этот файл, в противном случае кнопка загрузки должна быть отключена. Я попробовал следующий код в onPageLoad()
методе:
public void onPageLoad() {
// loading Previous file so the user have the option to download
// if there is privous file stored in db
if ((BlobDomain)tempVO.first().getAttribute("File1") != null) {
System.out.println("ther is file stored in db from onPage load");
this.downloadButton.setDisabled(false);
}
else {
// if there is no file stored the download option should be disapled
System.out.println("no file stored in db from onPage load");
this.downloadButton.setDisabled(true);
}
и я получил эту ошибку после выполнения предыдущего кода:
<UIXRegion> <_logIllegalContextChangeMessage> ADF_FACES-10026:During the processing of the region component, either a context change was not found or it did not match the instance set up by the current component. Expected oracle.adf.view.rich.component.fragment.UIXRegion$RegionContextChange but found UIXCollection.CollectionComponentChange[Component class: oracle.adf.view.rich.component.rich.data.RichTable, component ID: t1].
<RichExceptionHandler> <_logUnhandledException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null