on 04-17-2008 10:24 AM
Hi all,
I am using MDM.java API. The requirement is that the user will input more than one values separated by comma eg : AAA,BBB. The output will be the Search Results for AAA and BBB from MDM. Currently the application works fine if the user enters one value for search. How to approach the problem.
Points guaranteed!!!!
Regards
Avik
Thank You all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Avik,
You can use the StringTokenizer Class for solving this problem
String sre = "aaa,bbb,ccc";
StringTokenizer st = new StringTokenizer( sre, ",");
while( st.hasMoreTokens())
{
wdComponentAPI.getMessageManager().reportSuccess( st.nextToken());
}
This will get you the strings that are separated by the comma and you can perform the search accordingly
Regards
Vinod V
*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod.
I am trying to fetch the data from MDM. The SearchString to be entered by user is "String1,String2".
With reference to blog :
/people/andreas.seifried/blog/2006/03/26/performing-free-form-searches-with-mdm-java-api
I have tried the following. But this doesn't seem to work. Please help.
public void addSearchCriteriaWithComma(
FreeFormTableParameter fftp,
String fieldname,
String value,
int searchTypeSign) {
if (value != null) {
FreeFormParameterField searchField =
fftp.GetFields().New(
fieldname,
FreeFormParameterField.SEARCH_OPERATOR_OR);
StringTokenizer valueToken = new StringTokenizer(value,",");
// StringTokenizer valueToken = new StringTokenizer("7000318,7000324", ",");
while (valueToken.hasMoreTokens()) {
value = valueToken.nextToken();
searchField.GetFreeForm().NewString(value, searchTypeSign);
}
}
}
Hi avik,
Whats the result that its giving when you implement the code? One way that i feels to solve is by using thread for each string that are generated in while loop, there you have to pass the search string that is been generated and get the result..
I havn't tried threads in WebDynpro. Please try this way, as while loop won't be a matter when you use threads in this case.
Regards
Vinod V
*
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.