Hello All,
I had a Query Form,
I create a radio button for user to selected filter.
When user choose radio button 1 : filter the SalesQuotationTable's CustAccount.
When user choose radio button 2 :filter the SalesQuotationLine's ItemId.
but I can't change the filter between SalesQuotationTable's CustAccount and SalesQuotationLine's ItemId.
always filter the SalesQuotationLine's ItemId even choose the radio button1.
Please help and thanks a lot.
==================================
My code:
1. radio button1:
public boolean modified()
{
boolean ret;
ret = super();
SalesQuotationTable_1_ds.executeQuery();
return ret;
}
2.radio button2:
public boolean modified()
{
boolean ret;
ret = super();
SalesQuotationTable_1_ds.executeQuery();
return ret;
}
3. button
void clicked()
{
super();
SalesQuotationTable_1_ds.executeQuery();
SalesQuotationTable_1_ds.research();
SalesQuotationTable_1_ds.reread();
}
4. Form:
public class FormRun extends ObjectRun
{
QueryFilter queryFilter;
}
5. DataSource: SalesQuotationTable_1
init:
public void init()
{
super();
if (Option.selection() == 0)
{
queryFilter = SalesQuotationTable_1_ds.query().addQueryFilter(SalesQuotationTable_1_ds.queryBuildDataSource(),"CustAccount");
}
else if (Option.selection() == 1)
{
queryFilter = SalesQuotationLine_1_ds.query().addQueryFilter(SalesQuotationLine_1_ds.queryBuildDataSource(),"ItemId");
}
ProdId.visible(false);
}
executeQuery():
public void executeQuery()
{
this.query().dataSourceName(SalesQuotationTable_1_ds.name()).clearRange(fieldnum(SalesQuotationTable, CustAccount));
this.query().dataSourceName(SalesQuotationLine_1_ds.name()).clearRange(fieldnum(SalesQuotationLine, ItemId));
if (Option.selection() == 0)
{
this.query().dataSourceName(SalesQuotationTable_1_ds.name()).addRange(fieldnum(SalesQuotationTable, CustAccount))
.value(queryValue(queryFilter.value (element.design().controlName("CNum").valueStr())));
// queryFilter.value (element.design().controlName("CNum").valueStr());
}
else if (Option.selection() == 1)
{
this.query().dataSourceName(SalesQuotationLine_1_ds.name()).addRange(fieldnum(SalesQuotationLine,ItemId))
.value(queryValue(queryFilter.value (element.design().controlName("ProdId").valueStr())));
//queryFilter.value (element.design().controlName("ProdId").valueStr());
}
super();
}
*This post is locked for comments