Loading only the selected item

I am developing a data binding app where the source data is stored in the following format:
public void LoadData()
// Sample data; replace with real data
this.Items.Add(new ItemViewModel() { ID = "0", LineOne = "runtime one", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu" });
this.Items.Add(new ItemViewModel() { ID = "1", LineOne = "runtime two", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus" });
this.Items.Add(new ItemViewModel() { ID = "2", LineOne = "runtime three", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent" });
this.Items.Add(new ItemViewModel() { ID = "3", LineOne = "runtime four", LineTwo = "Nascetur pharetra placerat pulvinar", LineThree = "Ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos" });
this.Items.Add(new ItemViewModel() { ID = "4", LineOne = "runtime five", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur" });
this.Items.Add(new ItemViewModel() { ID = "5", LineOne = "runtime six", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent" });
this.Items.Add(new ItemViewModel() { ID = "6", LineOne = "runtime seven", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat" });
this.Items.Add(new ItemViewModel() { ID = "7", LineOne = "runtime eight", LineTwo = "Nascetur pharetra placerat pulvinar", LineThree = "Pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum" });
this.Items.Add(new ItemViewModel() { ID = "8", LineOne = "runtime nine", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu" });
this.Items.Add(new ItemViewModel() { ID = "9", LineOne = "runtime ten", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus" });
this.Items.Add(new ItemViewModel() { ID = "10", LineOne = "runtime eleven", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent" });
this.Items.Add(new ItemViewModel() { ID = "11", LineOne = "runtime twelve", LineTwo = "Nascetur pharetra placerat pulvinar", LineThree = "Ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos" });
this.Items.Add(new ItemViewModel() { ID = "12", LineOne = "runtime thirteen", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur" });
this.Items.Add(new ItemViewModel() { ID = "13", LineOne = "runtime fourteen", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent" });
this.Items.Add(new ItemViewModel() { ID = "14", LineOne = "runtime fifteen", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat" });
this.Items.Add(new ItemViewModel() { ID = "15", LineOne = "runtime sixteen", LineTwo = "Nascetur pharetra placerat pulvinar", LineThree = "Pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum" });
this.IsDataLoaded = true;
This will load all the items and refresh the data. The problem is as the number of items and content increases the delay in clicking the option and getting the content visible is significant and cannot be ignored. This is more annoying since the data
is static and once loaded, it never changes. I am thinking of improving the data refresh rate and looking for ways to load only the data for the selected item and not for all the items listed above.
Anyone has any good suggestions?
Thanks,
Aiseduk

Hi Toni,
Thanks for your reply. I am not too sure about ListBox virtualization. Can you please elaborate how it can help me in my scenario? As of now, I am exploring few possible options to achieve what I am looking for:
1. How to restrict LoadData() to load only the selected item? Since this will only load one item performance will be better on selecting the option. Is there any way to limit "this.Items.Add(new
ItemViewModel()" so that once an item is loaded, the flow jumps to
this.IsDataLoaded =
true;
2. Is there any way to create multiple LoadData() instance and connect them using Case/Switch to the available option? This will only initiate the LoadData() for that particular instance of selected item.
2. Take the performance hit once. Since the data is static and do not change later on do we have any option to load data once and prevent it from refreshing later on every time an option is selected? Will this impact any features depending on system (like
theming)?
3. Create multiple pages, one for each ID, and then somehow link them to the selected items in the list? I am able to achieve this, but this makes my project unnecessary bulky and difficult to manage.
Once again, thank you very much for helping me on this.
Aiseduk

Similar Messages

  • Changing JList non-editable Font color of the selected items

    Hi All,
    I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.
    Could you please clarify me?
    <img src="file:///C:/DOCUME~1/sgnanasi/LOCALS~1/Temp/moz-screenshot-4.png" alt="" />

    [email protected] wrote:
    ..I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.Set a custom [cell renderer|http://java.sun.com/javase/6/docs/api/javax/swing/ListCellRenderer.html] *(<- link)* for the JList.

  • The 'selected items' color randomly changes and I can't figure out why.

    Hi everybody, I recently upgraded to Firefox 13, which appears to be the most stable browser version so far and I really like it. I have loved Firefox very much, having used it since somewhere between versions 2 and 3.
    After upgrading to version 13 I noticed something that annoys me quite a bit. This may have been present before but I can't remember and I did not notice until now.
    On my computer (Windows 7 x64 Ultimate) I have set the color of the 'selected items' (specifically text) to be lime green text on a slightly off black background. I chose this color scheme because it blends very well with Firefox itself (I have the NASA night launch theme), Windows Explorer, and many web pages that I have changed to a dark theme (using the Stylish browser extension). This color scheme has excellent contrast in areas with black text on a light background, as well as light text on a dark background. It has served me well.
    After upgrading to Firefox 13 I have noticed that if the web page is dark with light text, the 'selected items' color changes to lime green text on a light grey background. (Less frequently, it changes instead to off-black text on a lime green background). I have not been able to isolate the threshold where this change occurs (meaning how dark the website background needs to be /how light the text needs to be for this to happen) nor have I found a solution.
    This problem sometimes extends even to sites that have dark text on a light background: when tabs are switched, with no input fields clicked and the address bar is not clicked. This very page (Firefox support) is apparently vulnerable as well.
    This problem only happens on rendered web pages. Firefox's menus, buttons and toolbars, as well as all other programs and Windows itself, are unaffected.
    I want the 'selected items' to remain as I have set it, and not deviate regardless of the apparent contrast or color scheme of the web page being displayed.
    [Edit #1]: Interestingly, as I was copying the information from about:support I noticed that it is affected as well.
    Any suggestions? Thanks so much, and I am sorry for the long-winded description. tl;dr look at the pictures.
    [http://i.imgur.com/vmLZ6.png selected items]
    [http://i.imgur.com/d8xsa.png example1]
    [http://i.imgur.com/2OE9J.png example2]
    [http://i.imgur.com/1lhvb.png example3]
    [http://i.imgur.com/UWOOp.png example4]

    It is always best to avoid making changes to the selected text colors.<br />
    Firefox uses an algorithm to check if the contrast is sufficient and will swap text and background colors if that test fails.<br />
    *http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsTextFrameThebes.cpp#3349
    *http://forums.mozillazine.org/viewtopic.php?f=38&t=1331845

  • Cannot sync ipad. statement "ipad cannot be synced because there is not enough free space to hold all of the selected items (additional 157.3 mb required) There is 1.86gb available on ipad and i am trying to remove items. any thoughts...

    annot sync ipad. statement "ipad cannot be synced because there is not enough free space to hold all of the selected items (additional 157.3 mb required) There is 1.86gb available on ipad and i am trying to remove items. any thoughts...

    If you haven't changed your sync preferences, meaning that you are not trying to add more content from the last time that you synced with iTunes, try quitting iTunes, restart your computer and then try again.
    If you are trying to add more content to the iPad than what you had before, you can only use so much of the available storage capacity that is left on the device. You probably need to leave about 10% of the space free so if you have a 16GB iPad, you might not have enough space left to sync that content that you are trying to sync.

  • Easy Question! How Do I Play ONLY the Selection, and then playback stops?

    How Do I Play ONLY the Selection, and then playback stops? (Same as subject..)
    Thanks! I'm loving STP so far. I came from Sony Sound Forge so it's been difficult finding something that can compare, but I think I have it now! Lot's of advantages for STP too.

    I think you're confusing the audio loops with MIDI loops. The blue loops are audio loops which will play only on audio tracks. You can't 'play' those with a keyboard because they are actual audio files. The green loops contain MIDI data that corresponds with a software instrument, and if you drop them onto a Software Instrument track, they will open that instrument which you CAN play with an external keyboard or the caps lock keyboard.
    I might be missing some loops, but when I searched for Bell Tower I found only one, and it is a blue loop. So it can only be played as an audio loop on an audio track. However, if it were a green loop, you would NOT drop it on an external MIDI track (I think that's what you're trying to do if you're dragging it onto the 'Grand Piano MIDI instrument'), but you would create a SOFTWARE INSTRUMENT track, and drag it on that. Any internal sounds you want to play from Logic's instrument you'll do from Software Instrument tracks, and not MIDI tracks.
    What you should do to find a good chime sound that you can play with the caps lock keyboard is to create a Software Instrument Track, open the Library tab, and search there for a good chime. This will search all of the instruments and presets that Logic has for all of its internal instruments. Try 'Tubular Bells' and see if that works for you.
    If you need to use the bells from that loop, do what SC suggested, and take the hits from the audio file and load them into a sampler. Then you can play them the way you want to. If you don't know how to make a sampler, it's a bit complicated. Look up EXS24 in the manual, or check out
    http://www.youtube.com/user/SFLogicNinja
    I think he has a video or two on EXS24

  • Slideshow page appears to load all images at once making it very slow. Is it possible to force it to load just the required items for the immediate page / slide

    Hi Everyone
    First post and a Muse / Web Noob.
    Im building my personal website with muse ( CC and now CC 2014 ) , its quite simple with slideshows embedded inside each other and is just 4 pages in total.
    My two slideshow pages appears to load all images at once making it very slow ( plus 20 secs on my system ). Is it possible to force it to load just the required items for the immediate page / slide. It would be so much faster and would work much better in this particular situation.
    Ive built all the images and icons at the correct size so optimisation shouldn't be an issue. The whole site is only about 42mb.
    www.paradoks.co.uk
    Many thanks
    Deck

    Oh well the problem seems to have fixed itself. It seems it was either a Java or Tumblr problem because the same thing happened when I installed Chrome. It is a lot more stable now and no more crashes yay.

  • How to get the selected items from listbox

    Regarding listbox i have two questions
    1) I want to get the selected items as per the order in which ihave selected.Presently i'm getting in the ascending order.For example after selcting the 1,2,6 if i select 3 then its giving 1,2,3,6.But i want it in the order 1,2,6,3
    2)I want to select items from a single list box to many other listboxes.(ie) my first selection should goto first,second one to the second listbox and like this.How should i write the logic.
    please give me a suggestion.

    In order to have the selected items line up in accordance to the selection order, please do it one at a time. (That's the limit for that VI)
    If you need more than that (i.e. to regconize which item clicked first and which one comes later), you may have to figure it out ya
    Wish you good luck. Perhaps, someone else has a already made vi.
    Cheers!
    ian.f
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com

  • How i can set the selected item of a dropDown component from java code

    Hi
    Thank you for reading my post
    How i can set the slected item of a DropDown component from backing beans java code ?
    it is binded with a database , so one field determine its display and one other field determine its value , I want to set the selected item of this combobox
    In back code i have both value and display values to use them .
    can some one give me some help ?
    Thanks ,

    See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    It says
    One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back.

  • The iPod "TAMI DUGARD's iPod" cannot be synced because there is not enough free space to hold all of the selected items (additional 146.5 MB required). this was from my ipod mini trying to sync and it wont let me sync so... could u help me i really needit

    I really need help because my ipod mini isnt working correctly my mom just gave it to me and The iPod “TAMI DUGARD’s iPod” cannot be synced because there is not enough free space to hold all of the selected items (additional 146.5 MB required). it says this. Over and over when i try to sync it too my itunes what does this mean and its a 4gb

    It means you try to sync an amount of content to your iPod Mini that exceeds for 4 GB, or the amount of space that is available on the iPod.  See this article for more details.
    How to sync music to your iPod when your library is bigger than your iPod storage space
    B-rock

  • How to find the selected item in alv grid or table control

    can any one tell me please
    how to find the selected item in alv grid or table control

    In table control, If you goto screen painter and goto table control properties ( f2 ), there is one check-box w/selColumn check that and give column name. Then add that column to your internal table.
    IN PAI
      LOOP AT it_tkhdr.
        FIELD it_tkhdr-sel_row
          MODULE tab_tkhdr_mark ON REQUEST.
      ENDLOOP.
    MODULE tab_tkhdr_mark INPUT.
      MODIFY it_tkhdr INDEX tc_tkhdr-current_line.
    ENDMODULE.                 " tab_tkhdr_mark  INPUT
    here it_TKHDR is internal table sel_row is field for selection
    After that, you can loop at it_tkhdr where sel_row is 'X' to get selected rows.
    regards,
    Gagan

  • How to check the selected items of a selectManyListbox in doDML of an EO ?

    Hello,
    I have a VO based on en EO. During the doDML(UPDATE) of that EO, I would like to check what items of a af:selectManyListbox have been selected.
    How could I get the checked items in the selectManyListbox (which belongs to the ViewController) in the doDML method of an EO (which belongs to the Model)?
    Many thanks

    Hello John,
    I know I cannot access the component directly. This is why I asked my question.
    The real case is rather complex and long to be copied and pasted here.
    Let me simplify it without being too generic.
    The VO is based on a hierarchical SQL query. All its EO attributes are transient. This VO is shown as a Tree in the page.
    Each node of the Tree has a checkBox. During commit (doDML() of the EO to be precise), for each checked node I need to access the selected items of a selectManyListbox in some proper way to perform further operations on the DB (no matter what now). The selectManyListbox is based on a second VO. As you may understand, the problem is that from the EO I don't have a direct access to the selectManyListbox. Also, as far as I know, the VO the selectManuListBox is based on does not have any informations about the selected elements, since the checkBox in the list cannot be associated to the VO. Basically I cannot know what elements have been choosen.
    I hope the problem is clear.

  • The plug-in for the selected item is not installed on your system

    Hello,
    When I want to build an application there is a "!" mark before the application and for  the Installer,  in the Project Explorer under Build Specification.
    When I ask for "explain warning" I got the message "The plug-in for the selected item is not installed on your system"
    Previously it worked well, whats happend?? (during my holyday's )
    Thanks for help, Huub

    Well, something obviously changed. Install any software and/or hardware recently? Using any hardware in your LabVIEW project? Could be the drivers for that hardware got corrupted. Try identifying what you're using and reinstall the drivers.

  • How to find out the selected item in the lsit

    Hi all,
    How to find out the selected item in the list,can any please post some examples which easy to understand,because iam not a good programmer

    This sample program uses a checkbox as selection,  you could also use a HOTSPOT.
    report zrich_0002 no standard page heading.
    data: imara type table of mara with header line.
    data: check_box(1) type c,  
       report_lines type i.
    start-of-selection.
    * Create the gui status with BACK button in standard place
    * and a READ button in the application toolbar
      set pf-status 'CHECK'. 
    select * into corresponding fields of table imara           from mara up to 100 rows.
    loop at imara.   
    write:/ check_box as checkbox, imara-matnr, imara-matkl.  
    hide imara-matnr. 
    endloop.
      report_lines  = sy-linno - 1.
    top-of-page. 
    write: 'List of materials'.  uline.
    top-of-page during line-selection.  write:  'Material.....'.  uline.
    at user-command. 
    case sy-ucomm.  
    when 'READ'.   
      check_box = space.    
    set pf-status 'CHECK' excluding 'READ'.
          do report_lines times.       
    read line sy-index field value check_box.    
       if check_box = 'X'.        
    write:/  'You have selected material',
    imara-matnr.       
    endif.   
      enddo. 
    endcase.
    Regards,
    Rich Heilman

  • Can I extract the page number of the selection item

    Hi,
    I want to extract the page number of the selected item in my document
    Is it possible?
    my script will be executed out from InDesign by another application
    please help me

    Yes, that's right! I read it so wrong!
    In CS5 there is new property:
    var mySel = app.selection[0];
    var mySelPage = mySel.parentPage;
    alert(mySelPage);
    Hope that helps.
    tomaxxi
    http://indisnip.wordpress.com/
    http://inditip.wordpress.com/

  • How to change the selection background color of the selected item in the popup menu of the choice box ?

    How to change the selection background color of the selected item in the popup menu of the choice box ?
    By defaut, the selection background color likes "blue", but if I want it to be "yellow" for example, how should I do ?
    Thanks

    The id is applied by (I think) the skin class of the ChoiceBox. You don't need to define it.
    You have to apply the css in an external style sheet. You can apply the external style sheet to any parent of your choice box, or to the scene (the most usual way to do it).
    Example:
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ChoiceBoxTest extends Application {
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
        final ChoiceBox<String> choiceBox = new ChoiceBox<>();
        List<String> tempResult = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        choiceBox.getItems().setAll(tempResult);
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();   
      public static void main(String[] args) {
        launch(args);
    choiceBox.css:
    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
    -fx-background-color: yellow ;
    #choice-box-menu-item .label {
    -fx-text-fill: black ;
    Message was edited by: James_D

Maybe you are looking for