AutoCompleteTextView modify for auto selected first search text with out click [migrated]

    public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main );


        List list = new ArrayList<>();

        list.add( "1-Colombo" );
        list.add( "2-MALIGAWATTA" );
        list.add( "3-KELANITHISSA" );
        list.add( "4-4-KANUWA" );
        list.add( "5-THORANA-HANDIYA" );
        list.add( "6-KELANIYA-UNI" );
        list.add( "7-KIRIBATHGODA" );
        list.add( "8-MAHARA-HANDIYA" );
        list.add( "9-KADAWATHA" );
        list.add( "10-GONAHENA-HANDIYA" );

        AutoCompleteTextView searchAutoComplete = (AutoCompleteTextView) findViewById( R.id.start );
        ArrayAdapter newsAdapter = new ArrayAdapter( this, android.R.layout.simple_dropdown_item_1line, list );
        searchAutoComplete.setAdapter( newsAdapter );
        searchAutoComplete.setThreshold( 1 );

        searchAutoComplete.setOnItemClickListener( new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView parent, View view, int position, long id) {

                Toast.makeText( MainActivity.this, "Hi" + position, Toast.LENGTH_SHORT ).show();
            }
        } );
    }
}

How can we modify this AutoCompleteTextView for automatically select first search value without click it.??

Any Idea

AutoCompleteTextView modify for auto selected first search text with out click

    public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main );


        List list = new ArrayList<>();

        list.add( "1-Colombo" );
        list.add( "2-MALIGAWATTA" );
        list.add( "3-KELANITHISSA" );
        list.add( "4-4-KANUWA" );
        list.add( "5-THORANA-HANDIYA" );
        list.add( "6-KELANIYA-UNI" );
        list.add( "7-KIRIBATHGODA" );
        list.add( "8-MAHARA-HANDIYA" );
        list.add( "9-KADAWATHA" );
        list.add( "10-GONAHENA-HANDIYA" );

        AutoCompleteTextView searchAutoComplete = (AutoCompleteTextView) findViewById( R.id.start );
        ArrayAdapter newsAdapter = new ArrayAdapter( this, android.R.layout.simple_dropdown_item_1line, list );
        searchAutoComplete.setAdapter( newsAdapter );
        searchAutoComplete.setThreshold( 1 );

        searchAutoComplete.setOnItemClickListener( new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView parent, View view, int position, long id) {

                Toast.makeText( MainActivity.this, "Hi" + position, Toast.LENGTH_SHORT ).show();
            }
        } );
    }
}

How can we modify this AutoCompleteTextView for automatically select first search value without click it.??

Any Idea

Populating Datatable text field filter with value selected from HTML Form WP drop-down onkeyup in SPO

QUESTION
Is it possible to populate a datatable’s text field with the value selected in an HTML From WP using onkeyup?

DESIRED OUTCOME
Upon selecting a value from the dropdown menu in an HTML Form WP using an onkeyup action, I would like that value to be automagically passed to the text field of a datatable, prompting that datatable’s results to be filtered by the value in the HTML Form WP.

INFO
I have both an HTML Form WP and a Script Editor WP on my page.

  1. The HTML Form WP serves as a filter. When the user begins typing the name of a Country into the text field, matching results from the list:‘Countries’ begin to populate. When the user selects a country/item from the autocomplete list, the filter value is set onkeyup

    • sync: function occurring when the user selects a Country Name from ‘tags’
    • tags: text field for the HTML Form WP with autocomplete
  2. The Script Editor contains a datatable with a textbox and a button. When the button is pushed, the HTML Form WP filter value (name of a Country) is passed to the text field the datatable, and the datatable list is populated with Major Cities found in that Country, based on another list called ‘MajorCities’

    • btnShowInfo: datatable button, when pressed populates MyCountries with tags
    • MyCountries: text field for the datatable pulling from the SPO list ‘MajorCities’
    • LoadMajorCities: function that is triggered after btnShowInfo is clicked

SCRIPT
This is the script in the HTML Form WP…

This is the script in the Datatable…

Thanks in advance!

(Lightning) How do I get the selected value from a Select dropdown list & send it to a method?

I’m trying to implement a single option select dropdown list for my component, and I’ve gotten as far as displaying the data members and the correct values for them. However, I can’t find any example within the SLDS website that gives me an idea of how to get this value out. I’m still new to working with Lightning(and front-end in general).

Here’s the code I’ve written:






How would I get the chosen option data and pass it into my controller?

Views block doesn’t appear on page if only media-type content is selected

I’ve created a view block that has a contextual filter with a Content ID from URL. The view is only to appear on my content types if the field_aside_content has any data in it. This field is just a paragraph reference type to a selected number of custom paragraphs that are to appear in the aside region of my page.

My problem is if I only select a media paragraph type in this content, the block doesn’t display on the page. If I then select a paragraph type that is text-based, then the block displays both the media and text content. If I remove the image, the text shows fine on its own.

What I’ve noticed is that the only time this block doesn’t seem to show up on the page is when I select a media-type of paragraph. My image, video, map and slider paragraph types won’t show up on their own unless they’re accompanied by some sort of text-based paragraph type or if a menu or some other block is already in the aside that this block shows up in.

It’s weird too because if I check the preview of the page when I’m editing the view, it shows the media content showing up, it just doesn’t seem to actually show on the published page.

Does anyone have any idea as to what is happening here?

I’ve also attached a screenshot of my view settings below to show what I’ve done in case something needs to be tweaked here:
View settings

Open the object attribute dialog for a selected feature with the Python QGIS API

I want to open the attribute dialog programmatically for a selected feature. I need to achieve the same effect as if the user clicks on the “object identify” action ( CTRL + SHIFT + I).
I searched the QGIS API docs for QGIS 3.2 but I was unable to find a solution.

I found the classes QgsAttributeFormInterface and QgsMapToolIdentifyFeature, but I was not able to use them in a useful way.
I also tried to trigger the action from the toolbar, but I guess I need some kind of click event with x,y coordinates for this to work.

Does anyone know if you can open the attribute dialog from a plugin programmatically?

Andi

How to make “New” appear in the contextual menu when a file is selected?

When a file is selected in the Windows 7 Explorer, the contextual menu doesn’t show the “New” element:

enter image description here

How to force the “New” menu/submenu to appear even if a file is selected?

This would make the solution from How to create a new text document (TXT) file by a Hotkey? work even if a file has focus.