2013-07-01 4 views
0

현재 oracle adf 태스크 플로우 및 region에서 작업 중이며 페이지로드시 일부 UI 구성 요소를 업데이트하고이를 위해 기본으로 메소드 호출 활동을 사용하려고합니다. 문제점은 다음 null 값을 받고 오전 메서드 호출을 실행하는 콩 내 코드입니다. 페이지로드시 UI 구성 요소 작성

package view; 

import javax.faces.component.UIViewRoot; 
import javax.faces.context.FacesContext; 

import oracle.adf.view.rich.component.rich.output.RichOutputText; 

public class testBean { 
    public testBean() { 
    } 

    public String testMethod() { 
     // Add event code here... 



     FacesContext facesContext = FacesContext.getCurrentInstance(); 
     UIViewRoot root = facesContext.getViewRoot(); 


     RichOutputText text = (RichOutputText)root.findComponent("r1:ot1"); 

     text.setValue("Adding text on run time"); 

     return "product"; 

    } 
} 

뷰 활동이 개시되지 않는 것이다 프래그먼트 product.jsff OT1와 함께 출력 텍스트가 null 복귀 때문이다 수있다 널 나 복귀 설정치

방법.

답변

0

값 설정을 구현하는 더 좋은 방법은 bean의 속성을 textValue라고 말한 다음 ot1의 value 속성을 bean의 속성과 바인딩하는 것입니다.

class TestBean{ 
    private String textValue; 

    public String testMethod() { 
    textValue = "Adding text on run time"; 
    } 

    public String getTextValue(){ 
    return textValue; 
    } 
} 

귀하의 JSPX은 다음과 같습니다

<af:outputText id="ot1" value=#{beanName.textValue}" /> 
+0

당신이 얘기하는 방법도 정확하지만 문제는 내가 경계 taskflow.Any 방법으로 함께 일하고 내 또 다른 질문은 제가 발생하고 있다는 점이다 Ui 동적으로 런타임에하지만 문제는 UI 구성 요소를 클릭 할 수없고 UI 구성 요소를 클릭 할 수 없다는 것입니다. 코드는 다음과 같습니다. –

+0

새 쿼리를 시작하면 신속하게 답변을 얻는 데 도움이됩니다. – MohamedSanaulla

관련 문제