multiple-select

Retrieving the selected items from a multi-select ListView

微笑、不失礼 提交于 2019-12-22 01:36:21
问题 I am currently implementing a multi-select ListView for my android app. My aim is to retrieve the selected items from the ArrayAdapter associated with the ListView when clicking the search button. I am currently stumped on how to do this, I have found stuff online such as trying to set a MultiChoiceModeListener , but this does not seem to come up as an option in Eclipse . I am using Google API s(level 10), Android 2.3.3 equivalent. Here is the code I have so far: public class FindPlace

Django: How can I create a multiple select form?

十年热恋 提交于 2019-12-20 20:26:25
问题 I'm beginner in Django/Python and I need to create a multiple select form. I know it's easy but I can't find any example. I know how to create a CharField with a widget but I get confused of all the options inside fields.py. For example I don't know which one of the followings is best for a multiple select form. 'ChoiceField', 'MultipleChoiceField', 'ComboField', 'MultiValueField', 'TypedChoiceField', 'TypedMultipleChoiceField' And here is the form I need to create. <form action="" method=

Android ListView with multiple select and custom adapter

帅比萌擦擦* 提交于 2019-12-19 05:16:52
问题 I have a ListView with a custom adapter. The ListView allows multiple select, but somehow it's not recognising when an item is selected. I've already made the adapter items extend Checkable, but still the getCheckedItemPositions() returns an array of falses. I guess there's something fundamental I'm doing wrong, but I have been unable so far to find examples of multiple select ListViews where the adapter was not an ArrayAdapter using the default layout for multiple selects. Any help would be

allow new values with chosen.js multiple select

两盒软妹~` 提交于 2019-12-17 21:46:10
问题 I'm using the chosen.js plugin http://harvesthq.github.com/chosen/ with jQuery to allow the user to select multiple options from a select. However, I now want to be able to let them create values that aren't already present - any idea how to go about this? EDIT: something similar to SO's own tag selection/creation bar would be close to what I'm after Preferably without changing or editing the plugin, but will do if required. The code: HTML: <p>Select something</p> <select name="theSelect[]"

How can I send an array to php through ajax?

自闭症网瘾萝莉.ら 提交于 2019-12-17 18:35:23
问题 I want to send an array constructed in javascript with the selected values of a multiple select. Is there a way to send this array to a php script using ajax? 回答1: You can post back to your server with XML or JSON. Your javascript will have to construct the post, which in the case of XML would require you to create it in javascript. JSON is not only lighterweight but easier to make in javascript. Check out JSON-PHP for parsing JSON. You might want to take a look at Creating JSON Data in PHP

Grails: Load data on one ComboBox depending on another

本小妞迷上赌 提交于 2019-12-17 16:51:10
问题 Let's say I have a combobox with the options GENERAL, AIR, GROUND, and SEA <g:select name="group" from="${['GENERAL', 'AIR', 'GROUND', 'SEA']}" valueMessagePrefix="default.category" value="${tipoN}" /> And then another combobox that loads certain information depending whether you select GENERAL, AIR, GROUND, or SEA. Let's say GROUND has 3 options, FedEx, USPS, DHL , but AIR has complete different ones, AIRPLANE, JET, HOT AIR BALLOON . The name of the other <g:select> should be "commodity" I

Javascript Get Values from Multiple Select Option Box

江枫思渺然 提交于 2019-12-17 06:46:14
问题 This one is driving me nuts. It’s got to be something simple and stupid that I am overlooking. I have a multiple select box in a form. I am just trying to get the values that are selected. In my loop, if I use alert then I have no problem. As soon as try to concatenate the values I get the error ‘SelBranch[...].selected' is null or not an object <form name="InventoryList" method="post" action="InventoryList.asp"> <select name="SelBranch" class="bnotes" size="5" multiple="multiple"> <option

Zend Multiselect Element is posting only one selected values

陌路散爱 提交于 2019-12-14 02:33:45
问题 I am creating multiple select element like this and it is showed successfully on form: $element = new Zend_Form_Element_Multiselect('clinics'); $element->setLabel("Clinics"); $element->setAttrib( 'style','width: 240px' ); $element->setMultiOptions( array( '1'=>'clinic1', '2'=>'clinic2' ) ); After rendering above element it shows the following html in html source: <select name="clinics[]" id="clinics" multiple="multiple" style="width: 240px" size="5" class="required" tabindex="41"> <option

Selecting multiple correct answers from buttons

允我心安 提交于 2019-12-13 02:46:33
问题 Game screen of my application. Hello everyone, I am currently in the middle of developing my quiz app game, and its main mechanics is it's possible that there is one or more possible correct answers in each question. So far, I can only select one correct answer out of the choices given. private Answer getAnswerFromCursor (Cursor cursor){ Answer answer = new Answer(); answer.setAnswerId(cursor.getInt(FIELD_ID_ID)); answer.setQuestionId(cursor.getInt(FIELD_ID_QUESTIONID)); answer.setText(cursor

Best way to combine multiple advanced mysql select queries

送分小仙女□ 提交于 2019-12-12 16:55:06
问题 I have multiple select statements from different tables on the same database. I was using multiple, separate queries then loading to my array and sorting (again, after ordering in query). I would like to combine into one statement to speed up results and make it easier to "load more" (see bottom). Each query uses SELECT, LEFT JOIN, WHERE and ORDER BY commands which are not the same for each table. I may not need order by in each statement, but I want the end result, ultimately, to be ordered