Rectangle 27 135

from Tkinter import Tk
from tkFileDialog import askopenfilename

Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing
filename = askopenfilename() # show an "Open" dialog box and return the path to the selected file
print(filename)

thank you very much

I got TypeError: 'module' object is not callable on Tk().withdraw() - any ideas?

I had to do root = Tk.Tk() then root.withdraw(). Now the open file dialog window does not close however.

user interface - Choosing a file in Python with simple Dialog - Stack ...

python user-interface dialog filechooser
Rectangle 27 1

This is happening because you have set up the DDL as target of your modal popup extender - so whenever target index is changed, the dialog is shown. The solution is to have an hidden button and make that a target control for modal popup extender - if your DDL has auto-postback as true then your server side code will check the selected index and popup the dialog.

From user experience perspective, unless you have UpdatePanel on page, this would mean on DDL change, page will refreshed and a dialog will be shown. You can also use modal pop-up javascript API to show/hide on DDL selected index change w/o doing post-back. For example,

$find('mpeMiles').show();

Thank you VinayC that is most helpful. Though what I am working on is a real project, it is also a training exercise and I have been instructed to avoid JS(for now). I have mpeMiles.Hide(); in the bind method of the listview, but still displays the panel static on the page

asp.net - ModalPopupExtender only show on Selected index changed event...

asp.net drop-down-menu modalpopupextender
Rectangle 27 2

I guess you want to pass the selected value from the dropdown to another server page using ajax and get the response and show that in the Dialog. This is how i will do that.

$(function(){

 $('a.login').click(function(){

     var selectedVal=$("#DropDownList1").val();
     var url="myserverpage.aspx?product="+selectedVal;

        var dialog = $("#dialog");
        if ($("#dialog").length == 0) {
            dialog = $('<div id="dialog" style="display:hidden"></div>').appendTo('body');
        }
        dialog.load(
            url,
            {}, // omit this param object to issue a GET request instead a POST request, otherwise you may provide post parameters within the object
            function (responseText, textStatus, XMLHttpRequest) {
                dialog.dialog({                       
                    close: function (event, ui) {                            
                        dialog.remove();
                    },
                    modal: true,
                    width: 460
                });
            }
        );
    }); 

});

And In myserverpage.aspx, Read the value from querystring product and return the relevant HTML markup you want to show to the user in the dialog. It will work if you have jQuery and jQuery UI loaded to your page properly.

The script will create a div for the popup itself on the fly. You don't need to add one page for that.

well i want to use one more drop down list within the dialog box and want to populate that with the parameter passed, so if camera[product1] is selected fill the dropdown with camera1 , camera2, camera3, vice versa , is that possible?

@MrA. Yes. pass the value as querystring to the server page, and read the sub categories from your database and then return the markup contains that sub category dropdown. For testing, you can just copy the url and test it in normal browser (without loading it into Dialog). some thing like localhost:yourpost/yourserverpage=product=3&someothervalle=3

thats exactly i want to acheive , passing a querystring and perform some check on query string then pass the list to dropdownlist on the dialog box

@MrA: Make sure you sanitize your querystring input before using that on a query. Otherwise you will be a victim of SQL injection. unixwiz.net/techtips/sql-injection.html

i will give it a try and keep u updated on it

asp.net - passing parameters to jqueryui dialog box - Stack Overflow

asp.net json jquery jquery-ui-dialog
Rectangle 27 2

I guess you want to pass the selected value from the dropdown to another server page using ajax and get the response and show that in the Dialog. This is how i will do that.

$(function(){

 $('a.login').click(function(){

     var selectedVal=$("#DropDownList1").val();
     var url="myserverpage.aspx?product="+selectedVal;

        var dialog = $("#dialog");
        if ($("#dialog").length == 0) {
            dialog = $('<div id="dialog" style="display:hidden"></div>').appendTo('body');
        }
        dialog.load(
            url,
            {}, // omit this param object to issue a GET request instead a POST request, otherwise you may provide post parameters within the object
            function (responseText, textStatus, XMLHttpRequest) {
                dialog.dialog({                       
                    close: function (event, ui) {                            
                        dialog.remove();
                    },
                    modal: true,
                    width: 460
                });
            }
        );
    }); 

});

And In myserverpage.aspx, Read the value from querystring product and return the relevant HTML markup you want to show to the user in the dialog. It will work if you have jQuery and jQuery UI loaded to your page properly.

The script will create a div for the popup itself on the fly. You don't need to add one page for that.

well i want to use one more drop down list within the dialog box and want to populate that with the parameter passed, so if camera[product1] is selected fill the dropdown with camera1 , camera2, camera3, vice versa , is that possible?

@MrA. Yes. pass the value as querystring to the server page, and read the sub categories from your database and then return the markup contains that sub category dropdown. For testing, you can just copy the url and test it in normal browser (without loading it into Dialog). some thing like localhost:yourpost/yourserverpage=product=3&someothervalle=3

thats exactly i want to acheive , passing a querystring and perform some check on query string then pass the list to dropdownlist on the dialog box

@MrA: Make sure you sanitize your querystring input before using that on a query. Otherwise you will be a victim of SQL injection. unixwiz.net/techtips/sql-injection.html

i will give it a try and keep u updated on it

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

asp.net - passing parameters to jqueryui dialog box - Stack Overflow

asp.net json jquery jquery-ui-dialog
Rectangle 27 1

When you click on a tab, JQuery simply hides all tab contents (div's) and shows the selected div. So you have to synchronize the dialog show/hide based on which tab you want to show the dialog.

Show the dialog(s), When the user click on the tab that has the dialog and close them when they navigate to other tabs.

select: function(event, ui) { ... }

A new possibility is available as of jQuery-UI 1.10: the appendTo option of the Dialog widget lets you specify which element the dialog widget gets appended to (default: <body>). If you append the dialog elements to a ui-tabs-panel div or any of its descendents, it will get hidden when the tab is hidden/deactivated.

Keep a jquery Dialog inside a tab - Stack Overflow

jquery jquery-ui jquery-ui-dialog jquery-ui-tabs
Rectangle 27 43

I suggest you create a jquery ajax function to post form data, then use the call back function to clear the form data. This way unless the user clicks the cancel button, the dialog is always showing.

<button class="AddUser">Add User</button>
<div id="AddUserForm"></div>
@model  Demo.Models.AddUserViewModel
<form id="myForm">
   <div id="AddUserForm">
       @Html.LabelFor(m => m.Name)
       @Html.TextBoxFor(m => m.Name)
    </div>
</form>
$('.AddUser').on('click', function () {
    $("#AddUserForm").dialog({
        autoOpen: true,
        position: { my: "center", at: "top+350", of: window },
        width: 1000,
        resizable: false,
        title: 'Add User Form',
        modal: true,
        open: function () {
            $(this).load('@Url.Action("AddUserPartialView", "Home")');
        },
        buttons: {
            "Add User": function () {
                addUserInfo();
            },
            Cancel: function () {
                $(this).dialog("close");
            }
        }
    });
    return false;
});
function addUserInfo() {
    $.ajax({
        url: '@Url.Action("AddUserInfo", "Home")',
        type: 'POST',
        data: $("#myForm").serialize(),
        success: function(data) {
            if (data) {
                $(':input', '#myForm')
                  .not(':button, :submit, :reset, :hidden')
                  .val('')
                  .removeAttr('checked')
                  .removeAttr('selected');
            }
        }
    });
}
public PartialViewResult AddUserPartialView()
{
    return PartialView("AddUserPartialView", new AddUserViewModel());
}

[HttpPost]
public JsonResult AddUserInfo(AddUserViewModel model)
{
    bool isSuccess = true;
    if (ModelState.IsValid)
    {
        //isSuccess = Save data here return boolean
    }
    return Json(isSuccess);
 }

If you want to show the error message when errors occurred while saving the data, you could change the Json result in AddUserInfo action like below:

[HttpPost]
public JsonResult AddUserInfo(AddUserViewModel model)
{
    bool isSuccess = false;
    if (ModelState.IsValid)
    {
        //isSuccess = Save data here return boolean
    }
    return Json(new { result = isSuccess, responseText = "Something wrong!" });
}

then add a div element in your partial view:

@model  MyParatialView.Controllers.HomeController.AddUserViewModel

<div id="showErrorMessage"></div>
<form id="myForm">
    <div id="AddUserForm">
        @Html.LabelFor(m => m.Name)
        @Html.TextBoxFor(m => m.Name)
    </div>
</form>

finally, the addUserInfo JS function should be like :

function addUserInfo() {
    $.ajax({
        url: '@Url.Action("AddUserInfo", "Home")',
        type: 'POST',
        data: $("#myForm").serialize(),
        success: function (data) {
            if (data.result) {
                $(':input', '#myForm')
                    .not(':button, :submit, :reset, :hidden')
                    .val('')
                    .removeAttr('checked')
                    .removeAttr('selected');
            } else {
                $("#showErrorMessage").append(data.responseText);
            }
        }
    });
}

Thanks for the clear solution, but i have one question though, how do you handle that if there is an error while saving into database, I have to show the pop up with errors occurred while saving in to database(Some thing like user already there).

Hi @Lin, I did the same as you expected, but the partial view is going to open in a new page is there any thing need to do, also added script files but same problem.

not sure why but $("#myForm").serialize() gives me an empty viewmodel

asp.net mvc - Render a partial view inside a Jquery modal popup on top...

asp.net-mvc jquery-ui
Rectangle 27 3

If it's a component:

In the VB6 IDE, press CTRL+T to bring up the Components dialog. Check the box next to Selected Items Only. Find one that says (missing) or some other error. If you click it in the list to select it, it should show the OCX/DLL file name underneath the list.

The same procedure needs to be done except you need to go to the Projects menu and then click References... to bring up the list of references. Find ones that are checked and say they are missing.

From either of these dialogs you can click a Browse... button to locate the actual OCX/DLL file(s) that you said you already installed, click OK, close all instances of the IDE, reopen the project and bring the References or Components dialog back up to see if it is resolved.

I opened the references window in my solution and found that a dll was missing.Hence i added it, closed the solution and reopened the project.The reference for the dll is now added in the project but im still getting the .log file error for the forms that are created in the project..

Error during load of log files in VB6 - Stack Overflow

vb6
Rectangle 27 7

Xcode / Preferences / Accounts - your apple id, is a member of the developer team? To the bottom right (of Accounts tab), under team name, it may default to "(your name) (Personal Team)", but there should also be another choice "(your team's name)". So if your team is named "The Awesome Team", then "The Awesome Team" should be selected under "Team Name", not your personal name.

UPDATE: How to "select the team name" has varied from version to version of Xcode. First step is to click on the team name. Then click on a button below it. In one version, that button said "Show Details..". As I write this, the button says "Download all profiles".

To verify that the desired team is still selected, you will have to quit Xcode, open it again, go to Preferences / Accounts again.

UPDATE #2: In newer versions of Xcode, it seems that the real problem is "Automatically Manage Signing" isn't making the desired choice. Find that, and turn it off, then select the desired certificate. Sagar Mody's answer explains a bit more.

If still not working for you, but works for someone else, might be worth asking them for screenshots of what they see in (1) Member Center in browser - Certificates, Provisioning Profiles, (2) Xcode / Preferences / Account, (3) "View Details" for their account. Worst case, ask them to temporarily change their password, and try THEIR account on your computer, verify you can get everything working if you log in as them. If you can do that, then there is something not set up right for your account. Try to find a difference in Member Center, or in those Xcode screenshots.

This "answer" only describes the problem, doesnt' provide a solution. So your first paragraph describe my situation, how do I fix it? How do I get my team name to be selected instead of my name? Down voting.

@Fernando - to select the team name, click on it, then click the link that says "Download All Profiles" (In earlier version, click on "View Details.." link). Depending on Xcode version / updates, might instead need to double-click the team name. For me, whichever one I've accessed last, stays active next time. [Editing this update into the answer also.]

Xcode - account already has valid iOS Distribution Certificate - Stack...

ios xcode
Rectangle 27 1

Well, this is a pretty old question, but nobody's said it, so I figured I'd at least mention what I just encountered. Make sure in your "Attach to Process" dialog, you have "Show processes from all users" selected. Until I did that, I could only see my .vshost.exe file in the list of processes.

.net - Debugging windows services - Stack Overflow

.net debugging windows-services
Rectangle 27 1

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.*;

public class TableCheckBox {

    private static final long serialVersionUID = 1L;
    private JTable table;
    private JFrame frame = new JFrame("Popup Table Editor");
    // I'm  reinvent the wheel see code for Popup Table Editor by @camickr
    private JDialog dialog = new JDialog(frame, "Edit Table data", true);
    private JPanel panel = new JPanel();
    private JLabel TypeLabel, CompanyLabel, SharesLabel, PriceLabel, BooleanLabel;
    private JTextField TypeTextField, CompanyTextField;
    private JFormattedTextField SharesTextField, PriceTextField;
    private JCheckBox BooleanCheckBox;
    private JButton saveButton = new JButton("Save changed to JTable");
    private Point location;
    private Object[] columnNames = {"Type", "Company", "Shares", "Price", "Boolean"};
    private Object[][] data = {
        {"Buy", "IBM", new Integer(1000), new Double(80.50), false},
        {"Sell", "MicroSoft", new Integer(2000), new Double(6.25), true},
        {"Sell", "Apple", new Integer(3000), new Double(7.35), true},
        {"Buy", "Nortel", new Integer(4000), new Double(20.00), false}
    };
    private DefaultTableModel model = new DefaultTableModel(data, columnNames) {
        private static final long serialVersionUID = 1L;

        @Override
        public Class getColumnClass(int column) {
            return getValueAt(0, column).getClass();
        }
    };

    public TableCheckBox() {
        table = new JTable(model);
        table.setPreferredScrollableViewportSize(table.getPreferredSize());
        table.getSelectionModel().setSelectionMode(
                ListSelectionModel.SINGLE_SELECTION);
        table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent e) {
                if (!e.getValueIsAdjusting()) {
                    System.out.println(table.getSelectedColumn());
                    System.out.println(table.getSelectedRow());
                }
            }
        });
        JScrollPane scrollPane = new JScrollPane(table);
        createPopupMenu();
        createDialog();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(scrollPane);
        frame.pack();
        frame.setLocation(150, 150);
        frame.setVisible(true);
    }

    private void createPopupMenu() {
        JPopupMenu popup = new JPopupMenu();
        JMenuItem myMenuItem1 = new JMenuItem("Edit Table Data");
        myMenuItem1.addActionListener(showingDialog());
        popup.add(myMenuItem1);
        MouseListener popupListener = new PopupListener(popup);
        table.addMouseListener(popupListener);
    }

    private void createDialog() {
        /*
         laid to private JPanel panel = new JPanel(); change layout to GBC, SprigLayout

         valid for follows JComponents

         private JLabel TypeLabel, CompanyLabel, SharesLabel, PriceLabel, BooleanLabel;
         private JTextField  TypeTextField, CompanyTextField;
         private JFormattedTextField SharesTextField, PriceTextField;
         private JCheckBox BooleanCheckBox;
         private JButton saveButton = new JButton("Save changed to JTable");
         */
        saveButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                //table.setValueAt(JTextField.getText, rowFromListSelectionLIstener, 
                //ColumnFromListSelectionListener + plusMinusCitibus)
                //table.setValueAt(JFormattedTextField. getValue 
                //or(((Number) textField2.getValue()).doubleValue());, 
                //rowFromListSelectionLIstener, ColumnFromListSelectionListener + plusMinusCitibus)
                hideDialog();//last code line
            }
        });
        dialog.add(saveButton, BorderLayout.SOUTH);
        dialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
        dialog.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                hideDialog();
            }
        });
        dialog.setPreferredSize(new Dimension(400, 300));// remove this code line
        dialog.pack();
    }

    private Action showingDialog() {
        return new AbstractAction("Show Dialog") {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println("dialog.setVisible(true)");
                //
                // copy value from JTable/XxxTableModel to JComponents placed in JPanel
                //   
                dialog.setVisible(false);
                //location = frame.getLocationOnScreen();
                int x = location.x - 10;
                int y = location.y + 50;
                dialog.setLocation(x, y);
                Runnable doRun = new Runnable() {
                    @Override
                    public void run() {
                        //dialog.setLocationRelativeTo(frame);
                        dialog.setVisible(true);
                    }
                };
                SwingUtilities.invokeLater(doRun);
            }
        };
    }

    private void hideDialog() {
        System.out.println("dialog.setVisible(false)");
        /*
         reset value for
         private JTextField  TypeTextField, CompanyTextField;
         private JFormattedTextField SharesTextField, PriceTextField;

         then after to call dialog.setVisible(false);
         */
        dialog.setVisible(false);//last code line
    }

    private class PopupListener extends MouseAdapter {

        private JPopupMenu popup;

        PopupListener(JPopupMenu popupMenu) {
            popup = popupMenu;
        }

        @Override
        public void mousePressed(MouseEvent e) {
            maybeShowPopup(e);
        }

        @Override
        public void mouseReleased(MouseEvent e) {
            if (table.getSelectedRow() != -1) {
                maybeShowPopup(e);
            }
        }

        private void maybeShowPopup(MouseEvent e) {
            if (e.isPopupTrigger()) {
                int row = table.rowAtPoint(e.getPoint());// get row that pointer is over                
                if (table.isRowSelected(row)) {// if pointer is over a selected row, show popup
                    Component comp = e.getComponent();
                    location = comp.getLocationOnScreen();
                    popup.show(e.getComponent(), e.getX(), e.getY());
                }
            }
        }
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                TableCheckBox frame = new TableCheckBox();
            }
        });
    }
}

I ran your code, In your code, cells are editable just by double clicking? ---> yes, is default and quite better for Compound JComponents (JComboBox, JSpinner, but I think that good for JTextArea e.i.) as TableCellEditor, you can to change, set this value XxxEditor.setClickCountToStart

Can you tell me that where is my mistake in my code that i got null for new name? ---> this is the same question like as to know numbers for lotto (Sunday), really no idea, I don't know, scelleton with idea could be works, may be a another issue, probably constructor is hardcoded, sticked to 1st JDialog, then value from rest of JDialog ended in universum, goes directly to the center to MilkyWay :-) everything is possible, you need to debug that

@Sajjad check his constructor for the JDialog: new JDialog(frame, "Edit Table data", true); Do you see that last parameter that is true? This is to create a modal dialog which is also what the other answer/comments suggested to you.

java - Initialize variable with constructor - Stack Overflow

java swing
Rectangle 27 1

public class Example1Activity extends Activity {
    private static final int ID_ADD = 1;
    private static final int ID_ACCEPT = 2;
    private static final int ID_UPLOAD = 3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.example1);

        ActionItem addItem      = new ActionItem(ID_ADD, "Add", getResources().getDrawable(R.drawable.ic_add));
        ActionItem acceptItem   = new ActionItem(ID_ACCEPT, "Accept", getResources().getDrawable(R.drawable.ic_accept));
        ActionItem uploadItem   = new ActionItem(ID_UPLOAD, "Upload", getResources().getDrawable(R.drawable.ic_up));

        //use setSticky(true) to disable QuickAction dialog being dismissed after an item is clicked
        uploadItem.setSticky(true);

        final QuickAction mQuickAction  = new QuickAction(this);

        mQuickAction.addActionItem(addItem);
        mQuickAction.addActionItem(acceptItem);
        mQuickAction.addActionItem(uploadItem);

        //setup the action item click listener
        mQuickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
            @Override
            public void onItemClick(QuickAction quickAction, int pos, int actionId) {
                ActionItem actionItem = quickAction.getActionItem(pos);

                if (actionId == ID_ADD) {
                    Toast.makeText(getApplicationContext(), "Add item selected", Toast.LENGTH_SHORT).show();
                } else {
                    Toast.makeText(getApplicationContext(), actionItem.getTitle() + " selected", Toast.LENGTH_SHORT).show();
                }
            }
        });

        mQuickAction.setOnDismissListener(new QuickAction.OnDismissListener() {
            @Override
            public void onDismiss() {
                Toast.makeText(getApplicationContext(), "Ups..dismissed", Toast.LENGTH_SHORT).show();
            }
        });

        Button btn1 = (Button) this.findViewById(R.id.btn1);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mQuickAction.show(v);
            }
        })

        Button btn2 = (Button) this.findViewById(R.id.btn2);
        btn2.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                mQuickAction.show(v);
                mQuickAction.setAnimStyle(QuickAction.ANIM_GROW_FROM_CENTER);
            }
        });
    }
}

android - PopupWindow - not working on a few devices - Stack Overflow

android popupwindow android-popupwindow
Rectangle 27 31

One thing you can do is get rid of all those onclick attributes and do it the right way with bootstrap. You don't need to open them manually; you can specify the trigger and even subscribe to events before the modal opens so that you can do your operations and populate data in it.

I am just going to show as a static example which you can accommodate in your real world.

On each of your <tr>'s add a data attribute for id (i.e. data-id) with the corresponding id value and specify a data-target, which is a selector you specify, so that when clicked, bootstrap will select that element as modal dialog and show it. And then you need to add another attribute data-toggle=modal to make this a trigger for modal.

<tr data-toggle="modal" data-id="1" data-target="#orderModal">
            <td>1</td>
            <td>24234234</td>
            <td>A</td>
  </tr>
  <tr data-toggle="modal" data-id="2" data-target="#orderModal">
            <td>2</td>
            <td>24234234</td>
            <td>A</td>
        </tr>
  <tr data-toggle="modal" data-id="3" data-target="#orderModal">
            <td>3</td>
            <td>24234234</td>
            <td>A</td>
  </tr>

And now in the javascript just set up the modal just once and event listen to its events so you can do your work.

$(function(){
    $('#orderModal').modal({
        keyboard: true,
        backdrop: "static",
        show:false,

    }).on('show', function(){ //subscribe to show method
          var getIdFromRow = $(event.target).closest('tr').data('id'); //get the id from tr
        //make your ajax call populate items or what even you need
        $(this).find('#orderDetails').html($('<b> Order Id selected: ' + getIdFromRow  + '</b>'))
    });
});

@PSL. This is a very helpful example. Thank you. Instead of greying out the parent completely. How to change color of the row or add a border line color to the specific cell, indicating that the modal was invoked for the specific cell. So that the user knows modal refers to which row ? Not sure, if this already been addressed or needs a special Q. Any help is appreciated. Thanks

@PSL, does not need to be specific cell. Highlighting the complete row in a way that user is aware that he is working with the modal of the specific row data. Let me know if it has to be a separate Q SO. I can work on creating one. Thanks

javascript - How can i show data using a modal when clicking a table r...

javascript jquery ruby-on-rails twitter-bootstrap
Rectangle 27 1

The problem here there is no way to have long click listener as of 3.1.36.

A hackish way would be to have transparent view over your map fragment with OnTouchListener attached, where you save touch down event time and return false.

If later you get your GoogleMap.OnMarkerClickListener.onMarkerClick called, you may decide if this was long or normal click.

For a proper way we would need to have OnMarkerLongClickListener in the API, for which you can file a feature request on gmaps-api-issues.

When you have one of these, you can just show a dialog with options, but as CommonsWare suggests, it's not the prettiest way. I suggest making marker selected by changing the icon and showing actions, but it's your choice.

android - How can I show context menu when a marker is long clicked? -...

android contextmenu google-maps-markers google-maps-android-api-2
Rectangle 27 1

The problem here there is no way to have long click listener as of 3.1.36.

A hackish way would be to have transparent view over your map fragment with OnTouchListener attached, where you save touch down event time and return false.

If later you get your GoogleMap.OnMarkerClickListener.onMarkerClick called, you may decide if this was long or normal click.

For a proper way we would need to have OnMarkerLongClickListener in the API, for which you can file a feature request on gmaps-api-issues.

When you have one of these, you can just show a dialog with options, but as CommonsWare suggests, it's not the prettiest way. I suggest making marker selected by changing the icon and showing actions, but it's your choice.

android - How can I show context menu when a marker is long clicked? -...

android contextmenu google-maps-markers google-maps-android-api-2
Rectangle 27 0

Why don't you use the example in the Primefaces showcase of instant row selection, where the selected row is displayed in a dialog? If you really need a button, then you can use a commandbutton to set the selectedItem in the backing bean and an oncomplete to show a dialog in the same way

jsf 2 - each column needs to be uniquely identified - St...

jsf-2 primefaces
Rectangle 27 0

private static final int PICK_FILE = 101;

    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("application/pdf");
    intent.addCategory(Intent.CATEGORY_OPENABLE);

    try {
        startActivityForResult(Intent.createChooser(intent, "Select a File"), PICK_FILE);
    } catch (android.content.ActivityNotFoundException ex) {
        // Potentially direct the user to the Market with a Dialog
        Toast.makeText(this, "Please install a File Manager.",
                Toast.LENGTH_SHORT).show();
    }
@Override
    public void onActivityResult(int reqCode, int resultCode, Intent data) {
    super.onActivityResult(reqCode, resultCode, data);

    switch (reqCode) {

        case PICK_FILE:
            if (resultCode == RESULT_OK) {
                // Get the Uri of the selected file
                Uri uri = data.getData();

                // Get the path
                String path = getPath(mContext, uri);
                Log.d(TAG, "Path: " + path);
                if (path != null && path.contains(".pdf")) {

                } 
            }
            break;
        }
    }
public String getPath(Context context, Uri uri) {
        if ("content".equalsIgnoreCase(uri.getScheme())) {
            String[] projection = {"_data"};
            Cursor cursor;

            try {
                cursor = context.getContentResolver().query(uri, projection, null, null, null);
                assert cursor != null;
                int column_index = cursor.getColumnIndexOrThrow("_data");
                if (cursor.moveToFirst()) {
                    return cursor.getString(column_index);
                } 
                cursor.close();
            } catch (Exception e) {
                // Eat it
            }
        } else if ("file".equalsIgnoreCase(uri.getScheme())) {
            return uri.getPath();
        }
        return null;
    }

android - Pick a pdf and upload to server - Stack Overflow

android
Rectangle 27 0

private static final int PICK_FILE = 101;

    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("application/pdf");
    intent.addCategory(Intent.CATEGORY_OPENABLE);

    try {
        startActivityForResult(Intent.createChooser(intent, "Select a File"), PICK_FILE);
    } catch (android.content.ActivityNotFoundException ex) {
        // Potentially direct the user to the Market with a Dialog
        Toast.makeText(this, "Please install a File Manager.",
                Toast.LENGTH_SHORT).show();
    }
@Override
    public void onActivityResult(int reqCode, int resultCode, Intent data) {
    super.onActivityResult(reqCode, resultCode, data);

    switch (reqCode) {

        case PICK_FILE:
            if (resultCode == RESULT_OK) {
                // Get the Uri of the selected file
                Uri uri = data.getData();

                // Get the path
                String path = getPath(mContext, uri);
                Log.d(TAG, "Path: " + path);
                if (path != null && path.contains(".pdf")) {

                } 
            }
            break;
        }
    }
public String getPath(Context context, Uri uri) {
        if ("content".equalsIgnoreCase(uri.getScheme())) {
            String[] projection = {"_data"};
            Cursor cursor;

            try {
                cursor = context.getContentResolver().query(uri, projection, null, null, null);
                assert cursor != null;
                int column_index = cursor.getColumnIndexOrThrow("_data");
                if (cursor.moveToFirst()) {
                    return cursor.getString(column_index);
                } 
                cursor.close();
            } catch (Exception e) {
                // Eat it
            }
        } else if ("file".equalsIgnoreCase(uri.getScheme())) {
            return uri.getPath();
        }
        return null;
    }

android - Pick a pdf and upload to server - Stack Overflow

android