Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Scout/Overview/FAQ"

m (category)
(Where do I load data into a TablePage?)
Line 7: Line 7:
 
*Parameter SearchFilter of execLoadTableData carries the FormData instance used as search constraints
 
*Parameter SearchFilter of execLoadTableData carries the FormData instance used as search constraints
 
*The search constraints are translated into the target service's query language. In case of SQL, it makes use of the '''FormDataStatementBuilder''' and in case of web services the properties are copied into the bean structure required by the target web service.
 
*The search constraints are translated into the target service's query language. In case of SQL, it makes use of the '''FormDataStatementBuilder''' and in case of web services the properties are copied into the bean structure required by the target web service.
 +
 +
=== How do I allow additional date formats in date fields? ===
 +
Create an <code>AbstractExtendedDateField</code> based on <code>AbstractDateField</code> and override <code>createDateFormatsForParsing(String)</code>:
 +
 +
<pre>
 +
public abstract class AbstractEnglishDateField extends AbstractDateField{
 +
 +
  public AbstractEnglishDateField(){
 +
  }
 +
 +
  @Override
 +
  protected List<DateFormat> createDateFormatsForParsing(String text){
 +
    List<DateFormat> list=super.createDateFormatsForParsing(text);
 +
    //add custom patterns only valid in english locales
 +
    if(Locale.getDefault().getLanguage().equals("en")){
 +
      list.add(new SimpleDateFormat("M / d / yy"));
 +
      list.add(new SimpleDateFormat("MMM d,yyyy"));
 +
      list.add(new SimpleDateFormat("MMMM d,yyyy"));
 +
      list.add(new SimpleDateFormat("yyyy/M/d"));
 +
      list.add(new SimpleDateFormat("yyyy / M / d"));
 +
      list.add(new SimpleDateFormat("dd.MM.yyyy"));
 +
    }
 +
    return list;
 +
  }
 +
}
 +
</pre>
  
 
== Server ==
 
== Server ==

Revision as of 01:11, 25 May 2010

Scout

Client

Where do I load data into a TablePage?

  • override method AbstractPageWithTable.execLoadTableData(SearchFilter filter) where you call an outline service operation that returns a Object[][] field
  • Parameter SearchFilter of execLoadTableData carries the FormData instance used as search constraints
  • The search constraints are translated into the target service's query language. In case of SQL, it makes use of the FormDataStatementBuilder and in case of web services the properties are copied into the bean structure required by the target web service.

How do I allow additional date formats in date fields?

Create an AbstractExtendedDateField based on AbstractDateField and override createDateFormatsForParsing(String):

public abstract class AbstractEnglishDateField extends AbstractDateField{

  public AbstractEnglishDateField(){
  }

  @Override
  protected List<DateFormat> createDateFormatsForParsing(String text){
    List<DateFormat> list=super.createDateFormatsForParsing(text);
    //add custom patterns only valid in english locales
    if(Locale.getDefault().getLanguage().equals("en")){
      list.add(new SimpleDateFormat("M / d / yy"));
      list.add(new SimpleDateFormat("MMM d,yyyy"));
      list.add(new SimpleDateFormat("MMMM d,yyyy"));
      list.add(new SimpleDateFormat("yyyy/M/d"));
      list.add(new SimpleDateFormat("yyyy / M / d"));
      list.add(new SimpleDateFormat("dd.MM.yyyy"));
    }
    return list;
  }
}

Server

Scout SDK



Back to Scout

Back to the top