0
votes

HI i am having an issue with drop down in ax 2012, i have 5 classes and i display them in the dropdown using their displaynames(i.e lookup of classes), but when i select on one of them and again click on dropdown the current value is not highlighted or cursor is not present on that value, cursor always points to the first value when i press drop down, it is not likely with the other dropdown in ax like enums the current value is highlighted when i press dropdown, please help me in resolving this issue thanks in advance.

dont have any data source on the form i am using edit method and lookup method for drop down here is the code i used please help me in solving this issue.

public void lookup() 
{
    List entityList;

    entityList = CsSysClassUtil::getImplementedClasses(classStr(CsPsqIInstructNavigator));

    CsSysClassUtil::createLookUp(this, entityList);
}

// this will display the selected value from the lookup in the field

    public edit ClassName  editProdOrderSearchDirection(
        boolean             _set,
        ClassName           _searchDirectionClassName)
{
    if (_set)
    {
        if (CsSysClassUtil::validateInterface(
                                _searchDirectionClassName,
                                classnum(CsPsqIInstructNavigator),
                                CsSysMessageType::Info))
        {
            gProdOrderSearchDirection = _searchDirectionClassName;
        }
    }

    return CsSysClassUtil::getClassDisplayName(className2Id(gProdOrderSearchDirection));
}

But when i again press the drop down the cursor is not highlighting the selected value or current value. its always high lighting the first value in the drop down. I want to high light the current value when drop down is clicked.(like it behaves with standard look up or enum look up)

following is the link for image of dialog

http://screencast.com/t/BNF6n3DkxKMc

In the above screen we can see value in the Search in (text control) is 'Next production order', but when drop down is clicked its highlighting 'current production order', i want to highlight 'Next production order' i.e value in the text control must be highlighted.

1
Can you share the code you are using? - 10p
Please show sourcee of the CsSysClassUtil::createLookUp. The lookup method should select current value from this. - Matej
public static client void createLookUp(FormStringControl _stringControl, List _interfaceList) { List list = new List(Types::Integer); Object formRun; #resappl ; formRun = ClassFactory::formRunClassOnClient(new Args(formstr(CsSysPicklist))); formRun.init(); formRun.choices(_interfaceList, 10893); //formRun.caption("@IFC533"); _stringControl.performFormLookup(formRun); } - user3226663
You must have a datasource in form CsSysPicklist, in which case - use Matej's answer. See axaptapedia.com/Lookup_Form for details. - 10p
@10p and matej Thanks for reply can't i do this without datasource on CsSysPickList form , becoz its our standard form used at several places modifying this will result in conflicts, please let me know if there is any other way of doing this. thanks both of you - user3226663

1 Answers

0
votes

You can call findValue on the FormDataSource.

FormDataSource fds = _form.dataSource(1);
fds.findValue(fieldNum(_table_, _field_), this.valueStr());