I am trying to populate the dropdown list in CAF from a document list in web service. It is working fine if the document list contains only one field in it. If the document list contains more than one field in it then how can I achieve this?
Additionally, after selecting a value in the drop-down list, it should dynamically populate other text field in the page with the other corresponding field(with respect to the field selected in the drop-down) in the document list.
Hi
From the list you can generate a “Group of Options from List/Array or Table” that you use in the “Options Group” in the dropdown. You can configure label and value of that provider with the different fields of your list.
To achieve the second part, you may use a Raise On Change control to “raise” an Async Hidden Command, or a Custom Value Change Listener. In the bound java method you can do what you need to.
Thanks for the reply. I have created Result Provider for the output>Result in the web service and assigned that result provider to the Option Group, its working fine. But by default it is taking the first field in that list.
The result document list contains about 10-12 fields in it. Need to show one filed(not the first field) in the drop-down label(View in drop-down) and need to assign some other field in the value(Actual value to pick-up).
I have selected the one told by you and not the one mentioned by me earlier. After creating the provider, I have options like Source Array, Source list, etc… But no where its showing the field names that I want to select. I m directly providing the Result provider in the value field of Option group, in this it is taking the first field by default, but i need to configure some other other than the first one.
That has been achieved. The selection of the field should be done in the Data Binding property of the Result Provider. There are two fields “Label Expression” and “Value Expression” in the Result provider, we need to change the value to the field that we want from the list.
Did you make “Auto Refresh” true like I mentioned in the doc for your “Get Process List”? If you set it to TRUE and still not working then either call your webservice connector inside “Initialize” action if you want it to be called only when application is loaded or create a BeforeRenderResponse method and call your webservice inside it to fetch results whenever page is rendered.
I cross checked ‘AutoRefresh’ option. given as true.
i am getting error as 'Failed to evaluate binding expression: “#{ByDateRangeDefaultviewView.getProcessList.result.getProcessListResponse.processList}” ’
when i am loading page.
here my page is on one of ‘Toggle Tabs’.
I tryed to add my WS response in Intialize method as
/ getProcessList.refresh(); but still no luck and error on screen as ‘java.lang.NullPointerException’ (don’t know why :()
And i called beforerender methods as
protected void beforeRenderResponse() {
// TODO Auto-generated method stub
this one giving error as [POP.001.0002] A “javax.portlet.PortletException” occurred with the Message “at com.webMethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:503)”