In a standard search page, there are say 4 fields. 1 Go and 1 clear button.
When we hit Go, the query that runs is :
where po_number = :1
If we have values in field2, then the where clause gets appended by
AND po_line = :2 and so on.
Now I add another field through personalization and extend the CO to append the VO query:
vo.setWhereClause("xyz = :1");
vo.setWhereClauseParams(null); // Always reset
But it gives an error, wrong index, as the index 1 is already used._Here_ is the issue.
How will I know which index number it will get. If I select 1 param, the index will be :1 if I select 1 more it will be :2.
So when I add a new field and pass it to view where clause, what is the best technique_ to handle the index, so that it automatically takes the next incremented value.
Explanation with an example will be highly appreciated.
If you don't wish to use positional parameter, I think you can go with Named Parameters and then use setNamedWhereClauseParam in VO. This way you need not worry about existing position parameter index. I haven't used this, so not sure of any impacts. Refer to the JDev guide to understand the named parameters and possible issues.
I din't find anything like 'setNamedWhereClauseParam' in jdev guide. In some of the forums it is said, setNamedWhereClauseParam is applicable to adf and not oaf. Am not sure how much that is authentic.
If anyone has any working code in oaf, it will be very much helpful.