Skip to Content

Set focus in a matrix

Hi expert

I search your help for a case with a matrix , chooselist and focus

I explain

I have an UDO and when i click on the first editable column of my matrix (who setbound with a children table) i have a choose list (It's correct)

i select a value on my choose list and click on the button select or i double click on the value

My problem follow.

on the issue of my choose list , the focus is not on the next column of my matrix but it is on a field of the header of my form.

Have you an idea to set the focus on the next column when issue of the choose list

I have seen the vent but i do't see what is the good event to catch

I wait for your help

regards

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2013 at 01:10 PM

    Hi Jean,

    you can try it. I have used same for following event

    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST && pVal.ItemUID == "matCrtBtS" && (pVal.ColUID == "V1"))

    {

    try

    {

    oForm = clsAddOn.LDNA_Application.Forms.GetForm(pVal.FormTypeEx, pVal.FormTypeCount);

    SAPbouiCOM.DBDataSource oDBS_Details;

    oDBS_Details = oForm.DataSources.DBDataSources.Item("@CBF_CBS1");

    oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pVal;

    sCFL_ID = oCFLEvento.ChooseFromListUID;

    oForm = clsAddOn.LDNA_Application.Forms.Item(pVal.FormUID);

    oCFL = oForm.ChooseFromLists.Item(sCFL_ID);

    oDataTable = oCFLEvento.SelectedObjects;

    if (oDataTable != null)

    {

    oMat = oForm.Items.Item("matCrtBtS").Specific;

    oMat.GetLineData(MatCurrentRowFmr);

    oDBS_Details.SetValue("U_FarmrCd", oDBS_Details.Offset, oDataTable.GetValue("CardCode", 0));

    oDBS_Details.SetValue("U_FarmrNm", oDBS_Details.Offset, oDataTable.GetValue("CardName", 0));

    oMat.SetLineData(MatCurrentRowFmr);

    oMat.Columns.Item("V6").Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular);

    if ((MatCurrentRowFmr) == oMat.VisualRowCount)

    {

    SAPbouiCOM.DBDataSource dbData = default(SAPbouiCOM.DBDataSource);

    dbData = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item(1);

    dbData.Clear();

    oMat.AddRow(1, pVal.Row + 1);

    }

    if (oForm.Mode != SAPbouiCOM.BoFormMode.fm_ADD_MODE)

    oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;

    for (int i = 1; i <= oMat.VisualRowCount; i++)

    oMat.Columns.Item("V_-1").Cells.Item(i).Specific.Value = i;

    }

    }

    catch (Exception ex)

    {

    BubbleEvent = false;

    clsAddOn.LDNA_Application.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, true);

    return;

    }

    }

    - regards

    vikas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2013 at 12:26 PM

    Hi Jean,

    Can you just try this :

    oMatrix.Columns.Item("col_0").Cells.Item(oMatrix.VisualRowCount).Click(BoCellClickType.ct_Double, 0);

    Hope it helps...

    Thanks & Regards

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Ankit

      I have try your code :

      oMat.Columns.Item("col_2").Cells.Item(Lignerec).Click(SAPbouiCOM.BoCellClickType.ct_Double, 0)

      it's work but i have a status message error "Internal error 6001 message 131-183" in screen down

      The focus is now in my next column ( correct) but why this message?

      have you an idea?

      do you want my for this sequence?

  • Posted on Dec 03, 2013 at 03:13 PM

    Hi Jean Marc,

    I would set the focus in the afterchoosefromlist just after setting the value in your column.

    Regards

    Ad

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.