Search Results

Search found 7466 results on 299 pages for 'selected'.

Page 5/299 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • ASP.NET MVC Dropdownlist retain the selected value in the browser after post

    - by MLabib
    I build a drop down list in my aspx page as following <%= Html.DropDownList("SelectedRole", new SelectList((IEnumerable)Model.roles, "RoleId", "RoleName", Model.SelectedRole), "")%> it works fine for first Get and the first default value is selected; then I select item from the drop down list and submit the form. the controller bind the values correctly, public ActionResult About([Bind] Roles r) { //r.SelectedRole = the selected value in the page. //Roles r = new Roles(); r.roles = new List<Role>(); r.roles.Add(new Role(1, "one")); r.roles.Add(new Role(2, "two")); r.roles.Add(new Role(3, "three")); r.roles.Add(new Role(4, "four")); r.SelectedRole = null; return View(r) } Then I nullify the selected item and return my view, but still the previous selected Item is selected (although I did nullify it) Any Idea if I am doing something wrong or it is a bug in MVC? I am using ASP.NET MVC 1 Thanks

    Read the article

  • Keep row of datagridview clicked by user selected

    - by user367509
    Hi All, I need the snipped code in C# to mantain selected the row from a datagridview after that row is double clicked. Right now I'm displaying data from a dataset and the selection mode is FullRowSelect. Any way to set this? There are two scenarios to deal with: 1) Everytime the timer ticks the selected row always go to the first row of datagridview. 2) Once a row is clicked, it is selected but after the timer ticks the selected row goes to the first one. Thanks for your help! A newbie programmer

    Read the article

  • saving value selected in a list when submit button is cliked

    - by kawtousse
    Hi everyone, In my JSP I have a dropdownlist and a submit button when clicking the submit button I loose the value already selected in my list. I am using the jstl because i need to construct other table corresponding the value selected in my list.For that I must call a submit button but the problem; it reset the value selected I want to know if there is a way to save the value selected in my list even I click a submit button. I work with JSP and eclipse environment. Think you for your help.

    Read the article

  • how to filter selected objects then hide objects not selected.

    - by ussteele
    following up from yesterday... This portion of the code does work. $(document).ready(function(){ $('#listMenu a').click(function (selected) { var getPage = $(this).attr('id'); var getName = $(this).attr('name'); //console.log(getPage); //console.log(getName); $(function() { $("#" + getName ).show(); var getColor = $('#' + getName ).css('background-color'); $('#header' ).css('background', getColor); $('#slideshow' ).css('background', getColor); $('span').css('background', getColor); $('#menuContainer').css('background', getColor); }); $('li.listMenu ul').hide(); }); }); I am able to get what I wanted selected; based on vars getPage and getName, now I need to hide what is not selected. I have tried this: $(function() { var notSelected = $('div').filter(selected).attr('id', 'name'); $(this).hide(); console.log(notSelected); }); placed just above: $('li.listMenu ul').hide(); but it's not correct, remember I am really a newbie. what I see on screen is the new selected items on top of what should be hidden. again any help is appreciated. -sjs

    Read the article

  • jqGrid - customizing the multi-select option (restrict single selection and adding custom events)

    - by Renso
    Goal: Using the jgGrid to enable a selection of a checkbox for row selection - which is easy to set in the jqGrid - but also only allowing a single row to be selectable at a time while adding events based on whether the row was selected or de-selected. Environment: jQuery 1.4.4 jqGrid 3.4.4a Issue: The jqGrid does not support the option to restrict the multi-select to only allow for a single selection. You may ask, why bother with the multi-select checkbox function if you only want to allow for the selection of a single row? Good question, as an example, you want to reserve the selection of a row to trigger another kind of event and use the checkbox multi-select to handle a different kind of event; in other words, when I select the row I want something entirely different to happen than when I select to check off the checkbox for that row. Also the setSelection method of the jqGrid is a toggle and has no support for determining whether the checkbox has already been selected or not, So it will simply act as a switch - which it is designed to do - but with no way out of the box to only check off the box (as in not to de-select) rather than act like a switch. Furthermore, the getGridParam('selrow') does not indicate if the row was selected or de-selected, which seems a bit strange and is the main reason for this blog post. Solution: How this will act: When you check off a multi-select checkbox in the gird, and then commence to select another row by checking off that row's multi-select checkbox - I'm not talking there about clicking on the row but using the grid's multi-select checkbox - it will de-select the previous selection so that you are always left with only a single selection. Furthermore, once you select or de-select a multi-select checkbox, fire off an event that will be determined by whether or not the row was selected or de-selected, not just merely clicked on. So if I de-select the row do one thing but when selecting it do another. Implementation (this of course is only a partial code snippet):             multiselect: true,             multiboxonly: true,             onSelectRow: function (rowId) {                 var gridSelRow = $(item).getGridParam('selrow');                 var s;                 s = $(item).getGridParam('selarrrow');                 if (!s || !s[0]) {                     $(item).resetSelection();                     $('#productLineDetails').fadeOut();                     lastsel = null;                     return;                 }                 var selected = $.inArray(rowId, s) != -1;                 if (selected) {                     $('#productLineDetails').show();                 }                 else {                     $('#productLineDetails').fadeOut();                 }                 if (rowId && rowId !== lastsel && selected) {                     $(item).GridToForm(gridSelRow, '#productLineDetails');                     if (lastsel) $(item).setSelection(lastsel, false);                 }                 lastsel = rowId;             }, In the example code above: The "item" property is the id of the jqGrid. The following to settings ensure that the jqGrid will add the new column to select rows with a checkbox and also the not allow for the selection by clicking on the row but to force the user to have to click on the multi-select checkbox to select the row: multiselect: true, multiboxonly: true, Unfortunately the var gridSelRow = $(item).getGridParam('selrow') function will only return the row the user clicked on or rather that the row's checkbox was clicked on and NOT whether or not it was selected nor de-selected, but it retrieves the row id, which is what we will need. The following piece get's all rows that have been selected so far, as in have a checked off multi-select checkbox: var s; s = $(item).getGridParam('selarrrow'); Now determine if the checkbox the user just clicked on was selected or de-selected: var selected = $.inArray(rowId, s) != -1; If it was selected then show a container "#productLineDetails", if not hide that container away. The following instruction populates a form with the grid data using the built-in GridToForm method (just mentioned here as an example) ONLY if the row has been selected and NOT de-selected but more importantly to de-select any other multi-select checkbox that may have been selected: if (rowId && rowId !== lastsel && selected) {                     $(item).GridToForm(gridSelRow, '#productLineDetails');                     if (lastsel) $(item).setSelection(lastsel, false); }

    Read the article

  • Can't sync iphone when sync podcasts selected

    - by spacecadet
    I've gone through the following steps: Loaded up iTunes 10 on a Windows7 machine Went to iTunes store and subscribed to a podcast Selected sync podcasts Clicked sync However, it always hangs on step 1 of 3 - it just gives a status of 'Backing up' and never progresses past that. I've waited over an hour 3 times now. I'm getting so infuriated with this iTunes software; I'm afraid I might damage my PC in frustration ;-) Any help greatly appreciated. Thank you.

    Read the article

  • Internet Explorer - selected language is changing to English when opening a new window

    - by Amit
    When opening a new window in IE8 or IE9 (doesn't matter if using a link or window.open), my selected keyboard language is changing to English (doesn't matter what was the previous selection, tried it with a few different languages). This doesn't happen for me in Chrome or Firefox (all the browsers are installed in their English version), and I tested it in Windows 7 and Windows 2008R2. Is there any way to avoid that? If there isn't - supposing the new window is within my website or application, is there a way to change it back?

    Read the article

  • Grub Setup(hd0) Error Cannot mount selected partition

    - by MA1
    I have created a NTFS Partition(/dev/sda3) and copy the grub files in it in the following path: /dev/sda3/boot/grub/ then tried to install the grub by using following commands: grub root (hd0,2) Filesystem unknown, partition type 0x7 grub setup (hd0) Error : cannot mount selected partition The partition is present and i created it with gparted. i also tried the following command: find (hd0,2)/boot/grub/stage1 Error 15: File not found All the files were there as copied them. So, where is the problem and what i am doing wrong?

    Read the article

  • jquery remove selected element and append to another

    - by KnockKnockWhosThere
    I'm trying to re-append a "removed option" to the appropriate select option menu. I have three select boxes: "Categories", "Variables", and "Target". "Categories" is a chained select, so when the user selects an option from it, the "Variables" select box is populated with options specific to the selected categories option. When the user chooses an option from the "Variables" select box, it's appended to the "Target" select box. I have a "remove selected" feature so that if a user "removes" a selected element from the "Target" select box, it's removed from "Target" and put back into the pool of "Variables" options. The problem I'm having is that it appends the option to the "Variables" items indiscriminately. That is, if the selected category is "Age" the "Variables" options all have a class of "age". But, if the removed option is an "income" item, it will display in the "Age Variables" option list. Here's the HTML markup: <select multiple="" id="categories" name="categories[]"> <option class="category" value="income">income</option> <option class="category" value="gender">gender</option> <option class="category" value="age">age</option> </select> <select multiple="multiple" id="variables" name="variables[]"> <option class="income" value="10">$90,000 - $99,999</option> <option class="income" value="11">$100,000 - $124,999</option> <option class="income" value="12">$125,000 - $149,999</option> <option class="income" value="13">Greater than $149,999</option> <option class="gender" value="14">Male</option> <option class="gender" value="15">Female</option> <option class="gender" value="16">Ungendered</option> <option class="age" value="17">Ages 18-24</option> <option class="age" value="18">Ages 25-34</option> <option class="age" value="19">Ages 35-44</option> </select> <select height="60" multiple="multiple" id="target" name="target[]"> </select> And, here's the js: /* This determines what options are display in the "Variables" select box */ var cat = $('#categories'); var el = $('#variables'); $('#categories option').click(function() { var class = $(this).val(); $('#variables option').each(function() { if($(this).hasClass(class)) { $(this).show(); } else { $(this).hide(); } }); }); /* This adds the option to the target select box if the user clicks "add" */ $('#add').click(function() { return !$('#variables option:selected').appendTo('#target'); }); /* This is the remove function in its current form, but doesn't append correctly */ $('#remove').click(function() { $('#target option:selected').each(function() { var class = $(this).attr('class'); if($('#variables option').hasClass(class)) { $(this).appendTo('#variables'); sortList('variables'); } }); });

    Read the article

  • PHP combobox can't save the selected value on Edit Page

    - by bEtTy Barnes
    hello I've got problem with my combobox. It's not saving the selected value in Edit page. Here what I'm working with: private function inputCAR(){ $html = ""; $selectedId = $this->CAR; //$html .= '<option value="Roadmap Accelerator - Core">Roadmap Accelerator - Core</option>'; //$html .= '<option value="Roadmap Accelerator - Optional Core">Roadmap Accelerator - Optional Core</option>'; //$html .= '<option value="Regulatory">Regulatory</option>'; //$html .= '<option value="Mission Critical">Mission Critical</option>'; //$html .= '<option value="Various CARs/Types">Various CARs/types</option>'; $selection = array( "Roadmap Accelerator - Core", "Roadmap Accelerator - Optional Core", "Regulatory", "Mission Critical", "Various CARs/types" ); $html .= '<label for="car">CAR Type</label>'; $html .= HTML::selectStart("car"); foreach($selection as $value){ $text = $value; $html .= HTML::option($value, $text, $selectedId == $value ? true : false); } $html .= HTML::selectEnd(); return $html; } My option function: public static function option($value, $text, $isSelected=false) { $html = '<option value="' . $value . '"'; if($isSelected) { $html .= ' selected="selected"'; } $html .= '>'; $html .= $text; $html .= '</option>'; return $html; } When I first created a record. The selected value from my combobox got saved into the DB then the page refreshed to display. When I went to edit page, to select another value, and clicked save button. On the display page, it's not saving. For example. on Create page I selected Regulatory. then I changed my mind and changed it to Mission Critical on Edit page. On display page it is not changed. I don't know what's wrong or what I'm missing here. Any help is welcome and truly appreciated. Thanks.

    Read the article

  • WPF DataGrid Get All SelectedRows

    - by anvarbek raupov
    Have to use free WPF DataGrid (I thought Infragistics libraries are bad, I take it back after this) for this project of mine. Looks like DataGrid doesnt have clean MVVM Friendly way of getting the list of selectedRows ? I can data bind to SelectedItem="{Binding SelectedSourceFile}" but this only shows the 1st selected row. Need to be able to get all selected rows. Any hints to do it cleanly via MVVM ?

    Read the article

  • Highlighting dates between two selected dates jQuery UI Datepicker

    - by Ralph
    I have one datepicker with numberOfMonths set to 2. Arrival Date and Departure Date are determined using this logic (within onSelect): if ((count % 2)==0) { depart = $("#datepicker-1").datepicker('getDate'); if (arriv depart) { temp=arriv; arriv=depart; depart=temp; } $("#check-in").val($.datepicker.formatDate("DD, MM d, yy",arriv)); $("#check-out").val($.datepicker.formatDate("DD, MM d, yy",depart)); } else { arriv = $("#datepicker-1").datepicker('getDate'); depart = null; if ((arriv depart)&&(depart!=null)) { temp=arriv; arriv=depart; depart=temp; } $("#day-count").val(''); $("#check-in").val($.datepicker.formatDate("DD, MM d, yy",arriv)); $("#check-out").val($.datepicker.formatDate("DD, MM d, yy",depart)); } if(depart!=null) { diffDays = Math.abs((arriv.getTime() - depart.getTime())/(oneDay)); if (diffDays == 0) { $("#day-count").val((diffDays+1)+' Night/s'); } else { $("#day-count").val(diffDays+' Night/s'); } } Getting the number of days within these 2 dates has no problem What I want now is highlight those dates starting from the Arrival to Departure I tried working around the onSelect but had no luck. I am now using beforeShowDay to highlight these dates but I can't seem to figure it out Got a sample from here Basically, it is customized to highlight 11 or 12 days after the selected date (Here's the code from that link). $('#datePicker').datepicker({beforeShowDay: function(date) { if (selected != null && date.getTime() selected.getTime() && (date.getTime() - selected.getTime()) Since I am new to using the UI, and the logic is not clear to me yet, I can't seem to figure this out. Any ideas on how I can make this highlight dates between the Arrival and Departure using my aforementioned logic used in determining the two?

    Read the article

  • Display ASP.NET GridView inside a selected row in another GridView

    - by Justin C
    I have been given a mockup that I do not know is possible to code in ASP.NET without being a real html and javascript wizard. I want a GridView that when a row is selected, the selected row expands and below the selected row a panel of additional information is shown, which would also include another small GridView. The idea is this would all be in-line. So if the user selected row 4, then the additional information would appear below row 4 and then after the additional information the parent GridView would continue with row 5. Ultimately I would want to do a multi-select type of set up, but first I need to figure out if this is even possible. Also, the solution must be 508 Compliant The one solution I considered was using only one "column". Then I would put all my fields in the ItemTemplate, and my detail panel content in the EditItemTemplate and instead of selecting the row, set it to edit mode. The problem with this solution is I lose the functionality of multiple columns if I throw everything in one huge ItemTemplate. Any and all suggestions or ideas are appreciated.

    Read the article

  • Symfony forms question (restoring selected value of a dynamically populated sfWidgetFormSelect widge

    - by Stick it to THE MAN
    I am using Symfony 1.3.2 with Propel ORM on Ubuntu 9.10. I have developed a form that dynamically populates a select widget with cities in a selected country, using AJAX. Before the data entered on the form is saved, I validate the form. If validation fails, the form is presented back to the user for correction. However, because the country list is dynamically generated, the form that is presented for correction does not have a valid city selected (it is empty, since the country widget has not changed yet). This is inconvenient for the user, because it means they have to select ANOTHER country (so the change event is fired), and then change back to the original country they selected, then FINALLY select the city which they had last selected. All of this is forced on the user because another (possibly unrelated) field did not vaildate. I tried $form-getValue('widget_name'), called immediately after $form-bind(), but it seems (infact, IIRC, if form fails to validate, all the values are reset to null) - so that does not work. I am currently trying a nasty hack which involves the use of directly accesing the input (i.e. tainted) data via $_POST, and setting them into a flash variable - but I feel its a very nasty hack) What I'm trying to do is a common use case scenario - is there a better way to do this, than hacking around with $_POST etc?

    Read the article

  • WPF Combobox Updates list but not the selected item

    - by JoshReedSchramm
    I have a combo box on a WPF form. On this form the user selects a record from the combo box which populates the rest of the fields on the form so the user can update that record. When they click save I am re-retrieving the combo box source which updates the combo box list. The problem is the selected item keeps the original label even though the data behind it is different. When you expand the combo box the selected item shows the right label. I am using a command binding mechanism. Here is some of the relevant code. private void SaveSalesRep() { BindFromView(); if (_salesRep.Id == 0) SalesRepRepository.AddAndSave(_salesRep); else SalesRepRepository.DataContext.SaveChanges(); int originalId = _salesRep.Id; InitSalesRepDropDown(); SalesRepSelItem = ((List<SalesRep>) SalesRepItems.SourceCollection).Find(x => x.Id == originalId); } private void InitSalesRepDropDown() { var salesRepRepository = IoC.GetRepository<ISalesRepRepository>(); IEnumerable<SalesRep> salesReps = salesRepRepository.GetAll(); _salesRepItems = new CollectionView(salesReps); NotifyPropertyChanged("SalesRepItems"); SalesRepSelItem = SalesRepItems.GetItemAt(0) as SalesRep; } The Selected Item property on the combo box is bound to SalesRepSelItem Property and the ItemsSource is bound to SalesRepItems which is backed by _salesRepItems. THe SalesRepSelItem property called NotifyPropertyChanges("SalesRepSelItem") which raises a PropertyChanged event. All told the binding of new items seems to work and the list updates, but the label on the selected item doesnt. Any ideas? Thanks all.

    Read the article

  • Jeditable setting default selected value after change.

    - by Dk589
    My app allows the user to update a field via a drop down box using jeditable. When the program is loaded i created this function to get the selected value and set it as the selected value in jeditable. But after i change the value, the selected tag stays set as the old value. how can i make it change to the new value? this is the function function updateType(ID,type){ $(document).ready(function(){ $('#tweekType-'+ID).editable("edit.php?type=tweekType", { data : " {'copywriting':'Copywriting','design':'Design','code':'Code', 'selected':'"+type+"'}", type : 'select' }); }); this is the wrapper around the tag. <span id="tweekType-<?php echo $getTweaksReturned->tweekID; ?>"> <?php type($getTweaksReturned->type); ?> <script>updateType('<?php echo $getTweaksReturned->tweekID; ?>','<? echo $getTweaksReturned->type; ?>'); </script> </span> The same tag is replicated on the page the returns the new variable.

    Read the article

  • UITableView, having problems changing accessory when selected

    - by zpasternack
    I'm using a UITableView to allow selection of one (of many) items. Similar to the UI when selecting a ringtone, I want the selected item to be checked, and the others not. I would like to have the cell selected when touched, then animated back to the normal color (again, like the ringtone selection UI). A UIViewController subclass is my table's delegate and datasource (not UITableViewController, because I also have a toolbar in there). I'm setting the accessoryType of the cells in cellForRowAtIndexPath:, and updating my model when cells are selected in didSelectRowAtIndexPath:. The only way I can think of to set the selected cell to checkmark (and clear the previous one) is to call [tableView reloadData] in didSelectRowAtIndexPath:. However, when I do this, the animating of the cell deselection is weird (a white box appears where the cell's label should be). If I don't call reloadData, of course, the accessoryType won't change, so the checkmarks won't appear. I suppose I could turn the animation off, but that seems lame. I also toyed with getting and altering the cells in didSelectRowAtIndexPath:, but that's a big pain. Any ideas? Abbreviated code follows... - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell* aCell = [tableView dequeueReusableCellWithIdentifier:kImageCell]; if( aCell == nil ) { aCell = [[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:kImageCell]; } aCell.text = [imageNames objectAtIndex:[indexPath row]]; if( [indexPath row] == selectedImage ) { aCell.accessoryType = UITableViewCellAccessoryCheckmark; } else { aCell.accessoryType = UITableViewCellAccessoryNone; } return aCell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; selectedImage = [indexPath row] [tableView reloadData]; }

    Read the article

  • Setting nested object to null when selected option has empty value

    - by Javi
    Hello, I have a Class which models a User and another which models his country. Something like this: public class User{ private Country country; //other attributes and getter/setters } public class Country{ private Integer id; private String name; //other attributes and getter/setters } I have a Spring form where I have a combobox so the user can select his country or can select the undefined option to indicate he doen't want to provide this information. So I have something like this: <form:select path="country"> <form:option value="">-Select one-</form:option> <form:options items="${countries}" itemLabel="name" itemValue="id"/> </form:select> In my controller I get the autopopulated object with the user information and I want to have country set to null when the "-Select one-" option has been selected. So I have set a initBinder with a custom editor like this: @InitBinder protected void initBinder(WebDataBinder binder) throws ServletException { binder.registerCustomEditor(Country.class, "country", new CustomCountryEditor()); } and my editor do something like this: public class CustomCountryEditor(){ @Override public String getAsText() { //I return the Id of the country } @Override public void setAsText(String str) { //I search in the database for a country with id = new Integer(str) //and set country to that value //or I set country to null in case str == null } } When I submit the form it works because when I have country set to null when I have selected "-Select one-" option or the instance of the country selected. The problem is that when I load the form I have a method like the following one to load the user information. @ModelAttribute("user") public User getUser(){ //loads user from database } The object I get from getUser() has country set to a specific country (not a null value), but in the combobox is not selected any option. I've debugged the application and the CustomCountryEditor works good when setting and getting the text, thoughgetAsText method is called for every item in the list "countries" not only for the "country" field. Any idea? Is there a better way to set null the country object when I select no country option in the combobox? Thanks

    Read the article

  • Get a selected radio button value after POST to set other fields enabled/disabled

    - by Redeemed1
    I have an MVC application with a simple control to all selection of All Dates or selecting a Date Range. The radio buttons have an onclick handler to enable/disable the dat pickers. All work well so far. When I try to set the correct context state for the datepickers after doing a POST I cannot get the jQuery selector to return the radio buttons checked value. The code is as follows: <%= Html.RadioButton("DateSelection.AllDates", "AllDates", Model.AllDates == "AllDates", new { onclick = "setReadOnly(this);" })%>ALL Dates&nbsp; <%= Html.RadioButton("DateSelection.AllDates", "Selection", Model.AllDates == "Selection", new { onclick = "setReadOnly(this);" })%>Selection <%= Html.DatePicker("DateSelection.startdate", Model.StartDate, "", "") %> &nbsp;To&nbsp;<%= Html.DatePicker("DateSelection.enddate", Model.EndDate, "", "") %><br /> The javascript is as follows: <script type="text/jscript" > function setReadOnly(obj) { if (obj.value == "Selection") { $('#DateSelection_startdate').css('backgroundColor', '#ffffff') .removeAttr('readonly') .datepicker('enable'); $('#DateSelection_enddate').css('backgroundColor', '#ffffff') .removeAttr('readonly') .datepicker('enable'); } else { $('#DateSelection_startdate').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val('') .datepicker('disable'); $('#DateSelection_enddate').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val('') .datepicker('disable'); } } <script type="text/jscript"> $(document).ready(function() { $('#DateSelection_startdate').datepicker('disable').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val(''); $('#DateSelection_enddate').datepicker('disable').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val(''); var selected = $('#DateSelection_AllDates:checked'); setReadOnly(selected); }); The javascript line that is causing the problem is var selected = $('#DateSelection_AllDates:checked'); which will NOT return the checked radio button. Using var selected = $('#DateSelection_AllDates'); will return the first radio button value as expected i.e. applying the ':checked' filter ALWAYS returns undefined. Can anyone see anything wrong here?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >