Date Range Input - Date-Range Picker .object.dataRange model

Hi,

I am trying to add the com.webMethods.caf.faces.data.object.DateRange model to my portlet. This is to allow users to specify a start and stop date to limit the search. Much like one does when searching through process instances in mywebMethods server.

My problem however is I can not figure out how to get the values from the portlet passed to my IntegrationServer? Do I need to write some custom java code behind the scene?

All I need is to get the string from the picker passed to the underlying service being calling, once that’s done I can fix the rest on the IS side where I understand what to do :smiley:


Thor Ingham

Hi Thor,
You would have to use a property of type DateRange for this control. Have a look at
[url]http://www.ajax-softwareag.com/articles/Y4LCDN/Caf-7-1-1JavaDocs/com/webmethods/caf/faces/data/object/DateRange.html[/url]
for some more info on it.

Being more precise… You can directly bind the “date” and “fixed range” properties to your IS service input parameters.
If the user has selected one of the “relative ranges”, then you will need to set the input parameters to “DateRange.calculateStart()”, “DateRange.calculateEnd()” in the java code.

best regards
Javier

May be I am answering too late , but the question is still relevant.
Hope this may help somebody at somepoint.

So, here what I did to map the input Data from the DateRange input control to the two String fields

  1. DateFrom
  2. DateTo

Go to the bindings view , portlet bean and create a new property(say dateRangeInput) , select the data type as
“com.webMethods.caf.faces.data.object.DateRange dateRangeInput”

Bind the value from the DateRangeInput control to the variable created.

Created a action say Search and added the below code to the search action :-


	public String search()
	{
	
	DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	DateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	String D1 = formatter.format(this.getDateRangeInput().calculateStart());
	String D2 = formatter.format(this.getDateRangeInput().calculateEnd());
	
	if(D1.equals("292269055-12-02"))
		this.getxxxxxx().getParameters().getxxxxxxx().getxxxxxxx().setDateFrom(null);
	else 
		this.getxxxxxx().getParameters().getxxxxxxx().getxxxxxxx().setDateFrom(formatter1.format(this.getDateRangeInput().calculateStart()));	
	if(D2.equals("292278994-08-17"))
		this.getxxxxxx().getParameters().getxxxxxxx().getxxxxxxx().setDateTo(null);
	else 
		this.getxxxxxx().getParameters().getxxxxxxx().getxxxxxxx().setDateTo(formatter1.format(this.getDateRangeInput().calculateEnd()));
	
    this.webServicexxxx().refresh();
	return OUTCOME_OK;
	
	}

And now you can the search action whereever you were calling the webservice refresh() action.

2 Likes

Hi , Can you please provide documentation link for caf controls. i am specifically looking for ‘Date range input’ control for 10.5.

I am trying to achieve these 2 aspects and any guidance will be highly appreciated

  1. Default set current day in the control then ‘ALL’.
  2. Disable the dates which are say 6 months old so that user can’t select them.