Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

faching problem with component reference

3174772Oct 19 2016 — edited Oct 19 2016

Hi,

I am using jdev 12.2.1 version. To get the component id, i was using type RichInputListOfValues , but i want to replace it with componentreference, to get the component id, and after that i was making the id null.

The previous code is like this:

public void JobresetInputText(ActionEvent actionEvent) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    UIViewRoot root = facesContext.getViewRoot();
   
   

RichInputListOfValues inputText1 = (RichInputListOfValues) root.findComponent("inputListOfValues2");

inputText1.setValue("");

Now I want to replace RichInputListOfValues to componentreference type.

private ComponentReference JobFieldsClear;

public void setJobFieldsClear(RichInputListOfValues JobFieldsClear) {
    this.JobFieldsClear =ComponentReference.newUIComponentReference(JobFieldsClear);
}

public RichInputListOfValues  getJobFieldsClear() { 
    return JobFieldsClear == null ? null : (RichInputListOfValues) JobFieldsClear.getComponent();

}

public void JobresetInputText(ActionEvent actionEvent) {
    // Add event code here...
    FacesContext facesContext = FacesContext.getCurrentInstance();
    UIViewRoot root = facesContext.getViewRoot();
    JobFieldsClear inputText1 = (JobFieldsClear)root.findComponent("inputListOfValues2");
   
    inputText1.setValue("");
   
}

Its giving me error with JobFieldsclear not found.. Can't i use directly JobFieldsclear instead of RichInputListOfValues? Please advise me

Regards

Chinmayee

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 16 2016
Added on Oct 19 2016
5 comments
253 views