Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7790225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:31:29+00:00 2026-06-01T21:31:29+00:00

I have been fiddling with a few lines of code for two days now

  • 0

I have been fiddling with a few lines of code for two days now and for some reason I cannot get it running.

What I want:

A user selects a relation from a combobox and subsequently must select a person from a list of persons filtered by the first combobox. If there is only one person, it must be selected outright. If it has more than one, I want the combobox to expand and of course show the list of retrieved persons. Sounds pretty simple.

The onRelationContactSelect() is code which is normally executed when a person is selected. Since the select event isn’t triggered when setting a value manually, I simply call it by hand. I have the code in the callback of the load event to ensure the data is retrieved from the server. That is required to expand in the first place or select a record.

The problem:

When I have one record (records.length == 1) everything works like a charm. When I have more than 1 record, the combobox contactCombo fails to expand. I debugged quite a bit through the ExtJs internal code and the reason is that is has no focus. No matter what I try with calling contactCombo.focus(), it does not focus. Therefore it won’t expand. To make it even more annoying I can expand another combobox with the following code:

function onRelationContactSelect() {
categorieStore.load({ callback: function(r, options, success) {
    //debugger;
    //categorieCombo.focus();
    //categorieCombo.expand();
}});
categorieCombo.focus();
categorieCombo.expand();

}

As can be seen I call focus() and expand() outside of the callback but the mode of categorieStore is ‘local’. The data in categorieStore is static but still retrieved from the server.

The code:

function onRelatieSelect() {
contactStore.baseParams = {"relatieId": relatieCombo.value };
contactStore.load({callback: function(records, options, success) {
    if(records.length == 1) {
        contactCombo.setValue(records[0].get('Id'));
        onRelationContactSelect();
    } else {
        contactCombo.clearValue();
        contactCombo.focus();
        contactCombo.expand();
    }
}}); 

openTicketRelationLabel.show();
gridTicketRelatie.show();
ticketRelatieStore.load({ params: {relatieId:relatieCombo.value}});
SetRelatieInfo();
SetContractsInfo();
setSfHoursOsab();
showRelationNotifications(relatieCombo.value);
}

I have tried for ages, but it seems I simply cannot focus a combobox from within the callback handler and outside of the callback handler I have no data yet.

Can anybody please help me out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:31:31+00:00Added an answer on June 1, 2026 at 9:31 pm

    After sandboxing two different comboboxes I found the solution.

    The solution turned out to be weird but simple:

    categorieCombo.on('select', function() {
    subcategorieCombo.focus();
    subcategorieStore.load({ callback: function(r, options, success) {
        subcategorieCombo.focus();
        subcategorieCombo.expand();
    } });
    

    Focus before the load.

    Focus again in the callback of the load.

    The only dissatisfying about this solution except from needing to focus twice is that I have no clue whatsoever why this works, but it solved the problem for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been fiddling a bit with android the last few days. I have
I have been fiddling with JMS Virtual topics. I want to get the example
I Have been fiddling with this for hours. I can not get my text
I have been tasked with refactoring some components that used xmlbeans to now make
I have been fiddling around with settings for a while, and cannot seem to
I am just learning C# (have been fiddling with it for about 2 days
I've been fiddling with this HTML and javascript for an hour or two now...and
I've been fiddling with some ASP.NET MVC3 solution structures and I have settled on
I have been fiddling with ormlite on android. It's early days and so far
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.