Search Results

Search found 13450 results on 538 pages for 'recent items'.

Page 18/538 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Deleting items from a ListView using a custom BaseAdapter

    - by HXCaine
    I am using a customised BaseAdapter to display items on a ListView. The items are just strings held in an ArrayList. The list items have a delete button on them (big red X), and I'd like to remove the item from the ArrayList, and notify the ListView to update itself. However, every implementation I've tried gets mysterious position numbers given to it, so for example clicking item 2's delete button will delete item 5's. It seems to be almost entirely random. One thing to note is that elements may be repeated, but must be kept in the same order. For example, I can have "Irish" twice, as elements 3 and 7. My code is below: private static class ViewHolder { TextView lang; int position; } public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.language_link_row, null); holder = new ViewHolder(); holder.lang = (TextView)convertView.findViewById(R.id.language_link_text); holder.position = position; final ImageView deleteButton = (ImageView) convertView.findViewById(R.id.language_link_cross_delete); deleteButton.setOnClickListener(this); convertView.setTag(holder); deleteButton.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.lang.setText(mLanguages.get(position)); return convertView; } I later attempt to retrieve the deleted element's position by grabbing the tag, but it's always the wrong position in the list. There is no noticeable pattern to the position given here, it always seems random. // The delete button's listener public void onClick(View v) { ViewHolder deleteHolder = (ViewHolder) v.getTag(); int pos = deleteHolder.position; ... ... ... } I would be quite happy to just delete the item from the ArrayList and have the ListView update itself, but the position I'm getting is incorrect so I can't do that. Please note that I did, at first, have the deleteButton clickListener inside the getView method, and used 'position' to delete the value, but I had the same problem. Any suggestions appreciated, this is really irritating me.

    Read the article

  • Resize a ListView depending on how many items?

    - by Dodi300
    Hello. How can I resize the height of a ListView depending on how many items are in that ListView? I'm trying to get the text of an item which is clicked, however whenever the user clicks on a space which has no item, there's an error. The exact error is: InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index. I'm using the code: label14.Text = myListView1.SelectedItems[0].Text.ToString(); I figured that removing the space below the items will solve this problem. Thanks!

    Read the article

  • How to load toolbox items of different domain specific languages

    - by Tejas
    I have 'n' different domain specifc languages e.g. language1, language2, ...., languagen each of which contains different toolbox items. Let say first language is for banking process, second one is for health process, third one is for insurance process etc. I want to load toolbox items of every above mentioned languages into every language. i.e. the toolbox item defined in banking process should be visible and functional in all other languages i.e. inside health and insurance languages resp.

    Read the article

  • Flex - prevent dragging for certain items

    - by Tom
    Hi troops, how would you prevent dragging for some items of your List or DataGrid? Let's say I had a list with two items: 'Tom' and 'Jerry'. Only 'Tom' should be dragable, not 'Jerry'. Ideally I had a 'isDragEnabled(item:Object):Boolean' function, which is being queried by the drag source. My difficulties start with the fact that the 'dragStart' event handler has a null value for the dragSource, so right from the start I find it hard to find out what the drag-start is about.. Thanks in advance! PS There have been a few discussions on preventing or canceling a drop, but I haven't seen much about preventing the drag start, hence this question.

    Read the article

  • Displaying a list of Items in a WPF form using XAML

    - by Dave Colwell
    Hi guys, I am attempting to display a list of items (the style and controltemplate for these items are defined elsewhere) and i want to be able to add/remove as many as i want to. As i do not have infinite screen realestate I am displaying these in a ListBox control. This is the screen i have to date: What is going to happen is this. When i click the New button, i want the item to appear in the outlined area. So now for the problem: I want, when i click the New... Button, a new item to appear in the ListBox (outlined). Is it possible to do this using XAML? I am trying to work on seperating the business logic from the interface, so if there were some way to acheive this in XAML i would appreciate it. If not,can i use the custom templated item i have created in C# so that it will appear as the template specifies in the list box instead of like a normal ListBoxItem Thanks in advance!

    Read the article

  • Creating a QLineEdit search field for items displayed in a QListView

    - by krunk
    I want to create a search field that filters the items shown in a QListView. Basically the user could type in "foo" and only items with "foo" in the DisplayRole are shown. I already have a few ideas on how to do this, but thought I'd ask those more experienced than I. My idea would be to use some signals and slots to set a filter in the QAbstractItem model and trigger an update() in the QListView. Are there any helper methods in QListView for filtering I may have missed? Is there a canonical way of handling this I haven't run across?

    Read the article

  • SQL latest/top items in category

    - by drozzy
    What is a scalable way to select latest 10 items from each category. I have a schema list this: item category updated so I want to select 10 last update items from each category. The current solution I can come up with is to query for categories first and then issue some sort of union query: query = none for cat in categories: query += select top 10 from table where category=cat order by updated I am not sure how efficient this will be for bigger databases (1 million rows). If there is a way to do this in one go - that would be nice. Any help appreciated.

    Read the article

  • Use XSLT to arrange a list of items in a table

    - by Mark Sp
    I have a linear list of items which I wish to arrange in a table using XSLT. I wish to specify the number of columns as a parameter. For example, if I have a list of 12 items, I can select a 2x6, 3x4, 4x3 or 6x2 table. I cannot see a general way to do this. I have seen this article: http://www.nedcomp.nl/support/origdocs/xml4/extracted/xpath_hdi_1_4llx.aspx It tells you how to generate a table with a specific number of columns, but does not allow a general case. (Ideally there would be a loop for the xsl:value-of lines). Thanks Mark

    Read the article

  • Java: Set<E> collection, where items are identified by its class

    - by mschayna
    I need Set collection, where its items will be identified by items class. Something like ReferenceIdentityMap from Appache Collections, but on class scope i.e. two different instances of same class must be identified as same in this collection. You know, it is a violation of equals()/hashCode() identity principle but in occasional use it makes sense. I have done this in simple class backing with Map<Class<? extends E>, E>, but due to simplicity it doesn't implement Set<E>. There may be a more elegant solution, decorator of any Set<E> would be great. Is there any implementation of such collection there (Apache/Google/something/... Collections)?

    Read the article

  • How to sort list items for Date field value (Apex, Salesforce)

    - by Channa
    With Salesforce's Apex, is there any way to sort list items, for Date field value. Please refer the TODO section of the following code, thanks. /** * Select list of jobOccurrences belongs to particular list of jobs */ private List<Job_Occurrence__c> getJobsByJobCode(List<Job__c> jobList) { // Select relevant Job Occurrence objects List<Job_Occurrence__c> jobOccuList = new List<Job_Occurrence__c>(); for (Job__c job : jobList) { Job_Occurrence__c jobOccurrence = [SELECT Id, Job__c, Schedule_Start_Date__c FROM Job_Occurrence__c WHERE Job__c =: job.Id]; if((jobOccurrence != null) && (jobOccurrence.Id != null)) { jobOccuList.add(jobOccurrence); } } if((jobOccuList != null) && (jobOccuList.size() > 0)) { // TODO // How I sort the 'jobOccuList' with Date field 'Schedule_Start_Date__c', // for select the items according to sequence of latest jobOccurrence return jobOccuList; } else { throw new RecordNotFoundException ('Could not found any jobOccurrence for given list of jobs'); } }

    Read the article

  • Combo box items tool tip not displayed

    - by SriniWeb
    Hello, I have written a combo box populated with items in ExtJs framework. I could not able to get the tooltips when the user hovers over the items. Below is the code: $formPanel .= " new Ext.form.ComboBox({ tpl:'<tpl for =\".\"><div ext:qtip=\"{abbr}\" class=\"x-combo-list-item\">{state}</div></tpl>', id:'type_blackout_weekly', store: sstore, displayField:'state', typeAhead: true, mode: 'local', triggerAction: 'all', emptyText:'Select a state...', selectOnFocus:true, forceSelection: true, width:135 }),"; var statedata = [ ['AL', 'Alabama'], ['AK', 'Alaska'], ['AZ', 'Arizona'], ['WV', 'West Virginia'], ['WI', 'Wisconsin'], ['WY', 'Wyoming'] ]; var sstore = new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : statedata }); Any guidance is highly appreciated.

    Read the article

  • WPF - Listbox bound to collection acts as one item

    - by user553765
    Hi, I have a listbox with the ItemsControl binding the ItemsSource to a readonly collection of strings. The ItemTemplate then declares the DataTemplate as a checkbox where its content is that of the name of the particular item in the collection and IsChecked bound to a property to determine whether or not the item is selected (it's just a listbox of checkboxes) This works fine with one exception - MouseOver the ListBox and it acts as if the collection of Strings is a single item; the whole box acts as if selected. This wouldn't be as much of a problem were it not for this also affecting the scrollbars where they won't get enabled - presumably because it considers the one item as being visible on the screen even though it in actual facts is x+ with only x-y showing on the screen. How do I get the listbox to act as if each individual string is its own item. I assume it acts this way because I declared a datatemplate in order to get a listbox of checkboxes?? Any help would be much appreciated!

    Read the article

  • Best way to order menu items injected by an IoC/plugin Framework

    - by Daver
    One of the common things I've seen done in applications built on IoC/plugin frameworks is to add commands to menus or toolbars from the dynamically loaded plugins. For example, the application's default plugins supply actions like "New, Open, Save" that show up in the context menu for a certain item in the workspace. A new plugin may add "Mail, Post, Encrypt" commands, but where do those commands show up in relation to "New, Open, Save"? How can the application that is loading components through IoC impose order on the items that get injected? Does it require metadata from the plugins that give a hint on how to group or order the items? Does it use a config file of previously known menu names (or ids) to define the order (seems a little weak to me)? Or are "unknown" plugins treated as second class citizens and always get dumped into sub menus? Something I've never even imagined (which I'm hoping to see in the answers)

    Read the article

  • Drupal limit number of menu items in primary links

    - by ninusik
    Is there a way to set a limit on how many menu items users can add to Primary Links menu? I'm working on a Drupal site and I have a horizontal primary links nav bar. There is only room for no more than 7-8 links in the nav bar. I don't want the future maintainer of the site to add more than 8 items to the menu. Is there a way I can set a limit on that? Some module or override function? Thanks,

    Read the article

  • Best way to implement a List(Of) with a maximum number of items

    - by Ben
    I'm trying to figure out a good way of implementing a List(Of) that holds a maximum number of records. e.g. I have a List(Of Int32) - it's being populated every 2 seconds with a new Int32 item. I want to store only the most current 2000 items. How can I make the list hold a maximum of 2000 items, then when the 2001'th item is attempted to be added, the List drops the 2000'th item (resulting in the current total being 1999). Thing is, I need to make sure I'm dropping only the oldest item and adding a new item into the List. Ben

    Read the article

  • Help with concept - filters and number of items

    - by dreamer
    Please check http://www.alibaba.com/catalogs/cid/702/Laptops.html they have nice filter here with number of items for each. Note one detail - they have locations here. Same thing on olx.com - location and number of items for each category. Now imagine I have tables: [products] (Id, Name, CategoryId, LocationId) [Categories] (Id,Name) [Location] (Id, Name) My question how can I do the same, cause count things even with caching looks expensive? And they give results pretty fast... Please advice with possible ways to do that in ASP.NET, C#, MVC, MS SQL, but avoice simple answers like "count and change" Thank you in advance.

    Read the article

  • Padding List Items?

    - by Lee Olayvar
    I have a list where i basically need a hierarchy of items. Any children of an item would be padded slightly, as to easily distinguish their parent item. How could this be achieved? Note that i could, if needed, make each parent show no children, and then when the parent is clicked, a new list containing all of it's children is loaded. This however requires more clicking to display information than i would prefer. Also, the items themselves will contain graphics and whatnot (to show a drag'n'drop button, etc), so it would be best if it visually appeared as if the item itself had a margin, rather than the contents of the item being padded. Thanks to any replies!

    Read the article

  • Using True and False to select items to print

    - by user1753915
    I have a workbook that contains rows of information that needs to printed to a seperate worksheet in excel. I am trying to utilize a checkbox to indicate which items need to print and which items need to be skipped. The checkbox is located in column "A" and once checked and the macro ran, I want it to pick up the data in each cell of that particular row, transfer it a seperate worksheet (form), prompt and save the worksheet to pdf, clear the form, and then return to the main worksheet to continue until all rows have been checked. However, right now, my code is only looping through the very first "TRUE" statement and not continuing to the rest. Here is the code: Private Sub CommandButton1_Click() On Error GoTo ErrHandler: Dim i As Integer For i = 1 To 10 If ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = False Then Else If ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = True Then Call PrintWO Else End If Do Until ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = 10 MsgBox "Nothing Selected to Print" Exit Do Exit Sub Loop End If Next i ErrHandler: End Sub

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >