Search Results

Search found 1854 results on 75 pages for 'country'.

Page 22/75 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • How to get dropdown value using jsp:useBean and jsp:setProperty?

    - by littlevahn
    I have a rather simple form in JSP that looks like this: <form action="response.jsp" method="POST"> <label>First Name:</label><input type="text" name="firstName" /><br> <label>Last Name:</label><input type="text" name="lastName" /><br> <label>Email:</label><input type="text" name="email" /><br> <label>Re-enter Email:</label><input type="text" name="emailRe" /><br> <label>Address:</label><input type="text" name="address" /><br> <label>Address 2:</label><input type="text" name="address2" /><br> <label>City:</label><input type="text" name="city" /><br> <label>Country:</label> <select name="country"> <option value="0">--Country--</option> <option value="1">United States</option> <option value="2">Canada</option> <option value="3">Mexico</option> </select><br> <label>Phone:</label><input type="text" name="phone" /><br> <label>Alt Phone:</label><input type="text" name="phoneAlt" /><br> <input type="submit" value="submit" /> </form> But when I try and access the value of the select box in my Java class I get null. Ive tried reading it in as a String and an Array of strings neither though seems to be grabbing the right value. The response.jsp looks like this: <%@ page language="java" %> <%@ page import="java.util.*" %> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%! %> <jsp:useBean id="formHandler" class="validation.RegHandler" scope="request"> <jsp:setProperty name="formHandler" property="*" /> </jsp:useBean> <% if (formHandler.validate()) { %> <jsp:forward page="success.jsp"/> <% } else { %> <jsp:forward page="retryReg.jsp"/> <% } %> I already have Java script validation in place but I wanted to make sure I covered validation and checking for non-JS users. The RegHandler just uses the name field to refer to the value in the form. Any Idea how I could access the select box's value?

    Read the article

  • Android - phone number contact format

    - by Daniel Benedykt
    Hi In Android I can get phone numbers of all the contacts without any problem. Tha problem is that for most users some numbers are stored as 'local' numbers, meaning that they dont have the country code included. For example, if the user lives in US and he has 2 contacts: 1) John - 555-123-1234 (local) (starting 1 not showing) 2) Jane - 44-123456787 (england phone number) The question is: How do I get all the numbers in an international format, when some of the numbers doesnt include the country code? Any way to figure that out? Thanks

    Read the article

  • Inheritance with POCO entities in Entity Framework 4

    - by Juvaly
    Hi All, I have a Consumer class and a BillableConsumer : Consumer class. When trying to do any operation on my "Consumers" set, I get the error message "Object mapping could not be found for Type with identity Models.BillableConsumer. From the CSDL: <EntityType Name="BillableConsumer" BaseType="Models.Consumer"> <Property Type="String" Name="CardExpiratoin" Nullable="false" /> <Property Type="String" Name="CardNumber" Nullable="false" /> <Property Type="String" Name="City" Nullable="false" /> <Property Type="String" Name="Country" Nullable="false" /> <Property Type="String" Name="CVV" Nullable="false" /> <Property Type="String" Name="NameOnCard" Nullable="false" /> <Property Type="String" Name="PostalCode" Nullable="false" /> <Property Type="String" Name="State" /> <Property Type="String" Name="StreetAddress" Nullable="false" /> </EntityType> From the C-S: <EntitySetMapping Name="Consumers"> <EntityTypeMapping TypeName="IsTypeOf(Models.Consumer)"> <MappingFragment StoreEntitySet="consumer"> <ScalarProperty Name="LoginID" ColumnName="LoginID" /> <ScalarProperty Name="FirstName" ColumnName="FirstName" /> <ScalarProperty Name="LastName" ColumnName="LastName" /> </MappingFragment> </EntityTypeMapping> <EntityTypeMapping TypeName="IsTypeOf(Models.BillableConsumer)"> <MappingFragment StoreEntitySet="billinginformation"> <ScalarProperty Name="CardExpiratoin" ColumnName="CardExpiratoin" /> <ScalarProperty Name="CardNumber" ColumnName="CardNumber" /> <ScalarProperty Name="City" ColumnName="City" /> <ScalarProperty Name="Country" ColumnName="Country" /> <ScalarProperty Name="CVV" ColumnName="CVV" /> <ScalarProperty Name="LoginID" ColumnName="LoginID" /> <ScalarProperty Name="NameOnCard" ColumnName="NameOnCard" /> <ScalarProperty Name="PostalCode" ColumnName="PostalCode" /> <ScalarProperty Name="State" ColumnName="State" /> <ScalarProperty Name="StreetAddress" ColumnName="StreetAddress" /> </MappingFragment> </EntityTypeMapping> </EntitySetMapping> Is this because I did not specifically add the BillableConsumer entity to the object set? How do I do that in a POCO scenario? Thanks! UPDATE: I decided to test whether or not POCOs generated with the T4 template would solve the problem and they did. The most annoying part is that when I restored my original classes from SVN to try and figure out how they are different - they worked as well!! Not adding this as an answer because someone else might have an actual explanation...

    Read the article

  • ASP.NET MVC 2 UpdateModel() is not updating values in memory or database

    - by campbelt
    Hello, I am new to MVC, and so am working through the NerdDinner tutorial, here. In particular, I'm running into problems with the use of the UpdateModel method, which is explained in the part five of that tutorial. The problem is, when I try to edit the value of a dinner object using the UpdateModel method, the values do not get updated, and no exceptions are thrown. Oddly, I am not having any trouble with the Create or Delete features that are illustrated in the tutorial. Only the update feature isn't working. Below, I have included the Controller code that I am using, as well as the view markup, which is contained in both an aspx View file and an ascx Partial View file. Here is the code inside my Controller, called DinnerController.cs: // // GET: /Dinners/Edit/2 [Authorize] public ActionResult Edit(int id) { Dinner dinner = dinnerRepository.GetDinner(id); return View(new DinnerFormViewModel(dinner)); } // // POST: /Dinners/Edit/2 [AcceptVerbs(HttpVerbs.Post), Authorize] public ActionResult Edit(int id, FormCollection formValues) { Dinner dinner = dinnerRepository.GetDinner(id); try { UpdateModel(dinner); var x = ViewData.GetModelStateErrors(); // <-- to catch other ModelState errors dinnerRepository.Save(); return RedirectToAction("Details", new { id = dinner.DinnerID }); } catch { ModelState.AddRuleViolations(dinner.GetRuleViolations()); return View(new DinnerFormViewModel(dinner)); } } The line with the comment "to catch other ModelState errors" was added after reading a possible solution from another StackOverflow thread, here: http://stackoverflow.com/questions/1461283/asp-net-mvc-updatemodel-not-updating-but-not-throwing-error Unfortunately, that solution didn't help me. Here is the corresponding markup in my Dinners/Edit.aspx View: <asp:Content ID="Main" ContentPlaceHolderID="MainContent" runat="server"> <h2>Edit Dinner</h2> <% Html.RenderPartial("DinnerForm"); %> </asp:Content> Here is the corresponding markup in my DinnerForm.ascx Partial View. This Partial View file is also used by the Create feature, which is working fine: <%=Html.ValidationSummary("Please correct the errors and try again.") %> <% using (Html.BeginForm()) { %> <fieldset> <p> <label for="Title">Dinner Title:</label> <%=Html.TextBoxFor(model => Model.Dinner.Title)%> <%=Html.ValidationMessage("Title", "*") %> </p> <p> <label for="EventDate">EventDate:</label> <%=Html.TextBoxFor(model => Model.Dinner.EventDate, new { value = String.Format("{0:g}", Model.Dinner.EventDate) })%> <%=Html.ValidationMessage("EventDate", "*") %> </p> <p> <label for="Description">Description:</label> <%=Html.TextBoxFor(model => Model.Dinner.Description)%> <%=Html.ValidationMessage("Description", "*")%> </p> <p> <label for="Address">Address:</label> <%=Html.TextBoxFor(model => Model.Dinner.Address)%> <%=Html.ValidationMessage("Address", "*") %> </p> <p> <label for="Country">Country:</label> <%=Html.DropDownListFor(model => Model.Dinner.Country, Model.Countries)%> <%=Html.ValidationMessage("Country", "*") %> </p> <p> <label for="ContactPhone">ContactPhone #:</label> <%=Html.TextBoxFor(model => Model.Dinner.ContactPhone)%> <%=Html.ValidationMessage("ContactPhone", "*") %> </p> <p> <label for="Latitude">Latitude:</label> <%=Html.TextBoxFor(model => Model.Dinner.Latitude)%> <%=Html.ValidationMessage("Latitude", "*") %> </p> <p> <label for="Longitude">Longitude:</label> <%=Html.TextBoxFor(model => Model.Dinner.Longitude)%> <%=Html.ValidationMessage("Longitude", "*") %> </p> <p> <input type="submit" value="Save"/> </p> </fieldset> <% } %> In any case, I've been hitting away at this for hours, and I'm out of ideas. So, I'm hoping someone here can help nudge me in the right direction, in order to figure out what I'm doing wrong.

    Read the article

  • manipulate objects outside svg with javascript-function inside the svg

    - by Christian Benke
    Hello! I'm embedding a svg-graphic on my website and i'd like to manipulate the rest of the website with javascript-commands which are in the svg - though i'm not sure if this is possible. Let me elaborate: I've got a worldmap in svg, i want to click on a country and this click should run an ajax-call and load relevant information of this country into a div in the html site where the svg is embedded. "onclick="location.href='xxx'"" redirects to the respective site which is fine, but i'd prefer to run a js-function that fetches the site with ajax - but running a javascript-function in the svg only seems to work for functions and elements defined in the svg, not outside of it. Is it basically possible to manipulate anything outside the svg through a js-function in the svg? How? Regards Christian

    Read the article

  • Can't cast treeviewitem as treeviewitem in wpf

    - by phenevo
    Hi, I've got webservice asmx, and there are classes: Country public string Name {get;set;} public string Code {get;set;} public List<Area> Areas {get;set;} Area public string Name {get;set;} public string Code {get;set;} public List<Regions> Provinces {get;set;} Provinces public string Name {get;set;} public string Code {get;set;} I bind it to mz TreeView WPF: Country[] items = new MyService().GetListOfCountries(); structureTree.ItemsSource = items; Code of myTree: <UserControl x:Class="ObjectsAndZonesSimpleTree" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <Grid> <StackPanel Name="stackPanel1"> <GroupBox Header="Choose" Height="354" Name="groupBox1" Width="Auto"> <TreeView Name="structureTree" SelectedItemChanged="structureTree_SelectedItemChanged" Grid.Row="0" Grid.Column="0" ItemsSource="{Binding}" Height="334" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" Width="Auto" PreviewMouseRightButtonUp="structureTree_PreviewMouseRightButtonUp" FontFamily="Verdana" FontSize="12" BorderThickness="1" MinHeight="0" Padding="1" Cursor="Hand" Margin="-1"> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type MyService:Country}" ItemsSource="{Binding Path=ListOfRegions}"> <StackPanel Orientation="Horizontal"> <TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=Name}"/> </StackPanel> </HierarchicalDataTemplate> <HierarchicalDataTemplate DataType="{x:Type MyService:Region}" ItemsSource="{Binding Path=Provinces}"> <StackPanel Orientation="Horizontal"> <TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=Name}"/> </StackPanel> </HierarchicalDataTemplate> <DataTemplate DataType="{x:Type MyService:Province}" ItemsSource="{Binding Path=ListOfCities}"> <StackPanel Orientation="Horizontal"> <TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=Name}"/> </StackPanel> </DataTemplate> </TreeView.Resources> </TreeView> </GroupBox> </StackPanel> </Grid> </UserControl> This gives me null: private void structureTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) { TreeViewItem treeViewItem = structureTree.SelectedItem as TreeViewItem; }

    Read the article

  • Jquery flowplayer - tabs - content inside div tags not displaying

    - by Gublooo
    Hey guys, I'm looking for a simple example of JQuery tabs in which I am planning to show two different forms. I came across this example http://flowplayer.org/tools/demos/tabs/index.htm which is perfect for my needs. So I implemented the simple example. The code in question is: <div class="panes" <divFirst tab content. Tab contents are called "panes"</div <divSecond tab content</div <divThird tab content</div </div Now my content for the first tab is a form which has several of its own div tags - when I put that form with div tags as the content for the first tab - nothing appears. So I made a simple change and added another div tag to the content of the first tab as shown below and still nothing appears: <div class="panes" <div<divFirst tab content. Tab contents are called "panes"</div</div <divSecond tab content</div <divThird tab content</div </div Is there a simple way to fix this. This is the content that I want to display in my first tab - Thanks for your help <div id="formbox" class="formbox" <form id="shopping_form" method="post" <div id="3" style="width:520px;" <textarea id="message" name="message" rows="3" cols="50"</textarea </div <div id="store_row" style="width:220px;float:left;padding-bottom:10px;"<bStore</b <input type="text" id="store" name="store" class="required" size="20" / <input type="hidden" id="store_id"/ </div <div id="city_column" style="width:200px;float:left;padding-bottom:10px;"<bCity</b <input type="text" id="city" name="city" size="15"/ </div <div id="findbutton_column" style="vertical-align:top;width:80px;float:left;" <input class="find_address" id="findaddress" type="button" value="Find Store"/ </div <div id="googlerow" style="width:120px;float:left;padding-bottom:10px;" <bSelect Store</b<select id="google_stores" name="google_stores"</select <input type="hidden" id="google_address"/ </div <div id="google_message" style="float:left;padding-bottom:10px;display:none;"</div <div id="locationrow" style="float:left;padding-bottom:10px;display:none;" <bAddress/Country</b <input type="text" id="address" name="address" size="20" / <input type="text" id="country" name="country" size="20"/ </div <div style="width:520px;float:left;padding-bottom:10px;" <bPrice    <input type="text" id="price" name="price" size="20" / </div <div id="buttonrow" style="width:200px;float:right;display:none;" <input id="it" type="image" src="http://images.pe.com.s3.amazonaws.com/it.png" height="35px"/ </div </form </div

    Read the article

  • ComboBox wpf not item not being selected

    - by Greg R
    I am trying to bind a combo box to a list of objects, and it works great, besides the selected value, am I missing somethign? <ComboBox ItemsSource="{Binding OrderInfoVm.AllCountries}" SelectedValuePath="country_code" DisplayMemberPath="country_name" SelectedValue="{Binding OrderInfoVm.BillingCountry}" /> Basically I want to bind value to country codes and set the selected value to the country code bound to OrderInfoVm.BillingCountry (which implements INotifyPropertyChanged) Initially when the control loads selected value is empty, but on click BillingCountry is populated. Selected value does not seem to change. How can I remedy that?

    Read the article

  • Google maps API - info window height and panning

    - by Tim Fountain
    I'm using the Google maps API (v2) to display a country overlay over a world map. The data comes from a KML file, which contains coords for the polygons along with a HTML description for each country. This description is displayed in the 'info window' speech bubble when that country is clicked on. I had some trouble initially as the info windows were not expanding to the size of the HTML content they contained, so the longer ones would spill over the edges (this seems to be a common problem). I was able to work around this by resetting the info window to a specific height as follows: GEvent.addListener(map, "infowindowopen", function(iw) { iw = map.getInfoWindow(); iw.reset(iw.getPoint(), iw.getTabs(), new GSize(300, 295), null, null); }); Not ideal, but it works. However now, when the info windows are opened the top part of them is sometimes obscured by the edges of the map, as the map does not pan to a position where all of the content can be viewed. So my questions: Is there any way to get the info windows to automatically use a height appropriate to their content, to avoid having to fix to a set pixel height? If fixing the height is the only option, is there any way to get the map to pan to a more appropriate position when the info windows open? I know that the map class has a panTo() method, but I can't see a way to calculate what the correct coords would be. Here's my full init code: google.load("maps", "2.x"); // Call this function when the page has been loaded function initialize() { var map = new google.maps.Map2(document.getElementById("map"), {backgroundColor:'#99b3cc'}); map.addControl(new GSmallZoomControl()); map.setCenter(new google.maps.LatLng(29.01377076013671, -2.7866649627685547), 2); gae_countries = new GGeoXml("http://example.com/countries.kmz"); map.addOverlay(gae_countries); GEvent.addListener(map, "infowindowopen", function(iw) { iw = map.getInfoWindow(); iw.reset(iw.getPoint(), iw.getTabs(), new GSize(300, 295), null, null); }); } google.setOnLoadCallback(initialize);

    Read the article

  • Constructing dynamic columns from parameters in Sybase

    - by Chapax
    Hi, I'm trying to write a stored proc (SP) in Sybase. The SP takes 5 varchar parameters. Based on the parameters passed, I want to construct the column names to be selected from a particular table. The below works: DECLARE @TEST VARCHAR(50) SELECT @TEST = "country" --print @TEST execute("SELECT DISTINCT id_country AS id_level, Country AS nm_level FROM tempdb..tbl_books INNER JOIN (tbl_ch2_bespoke_report INNER JOIN tbl_ch2_bespoke_rpt_mapping ON tbl_ch2_bespoke_report.id_report = tbl_ch2_bespoke_rpt_mapping.id_report) ON id_" + @TEST + "= tbl_ch2_bespoke_rpt_mapping.id_pnl_level WHERE tbl_ch2_bespoke_report.id_report = 14") but gives me multiple results: 1 1 row(s) affected. id_level nm_level 1 4376 XYZ 2 4340 ABC I would like to however only obtain the 2nd result. Do I need to necessarily use dynamic SQL to achieve this? Many thanks for your help. --Chapax

    Read the article

  • Translate google co-ordinates to the pixels on picture.

    - by kalininew
    I have a city "map" (for example - Moscow). She in accuracy repeats the contours the given city in google maps (that is it is copied from google maps and it is a little processed, but the sense remained the same). Also I have object co-ordinates in a city (in co-ordinates of google). Problem: how to translate google co-ordinates to the co-ordinates of my picture (that is in pixels on OX and OY on a picture). That is I receive google-co-ordinates and it is necessary for me to draw this point on my picture. I know that on small scales (for example on city scales) it to make simply enough (it is necessary to learn what google-co-ordinates has one of picture corners, then to learn "price" of one pixel in google-co-ordinates on a picture on axes OX and OY separately). But on the big scales (country scale) "price" of one pixel will be not a constant, and will vary strongly enough and the method described above cannot be applied. How to solve a problem on country scales?

    Read the article

  • Sql query problem

    - by LiveEn
    I have the below sql query that will update the the values from a form to the database $sql="update leads set category='$Category',type='$stype',contactName='$ContactName',email='$Email',phone='$Phone',altphone='$PhoneAlt',mobile='$Mobile',fax='$Fax',address='$Address',city='$City',country='$Country',DateEdited='$today',printed='$Printed',remarks='$Remarks' where id='$id'"; $result=mysql_query($sql) or die(mysql_error()); echo '<h1>Successfully Updated!!.</h1>'; when i submit I dont get any errors and the success message is displayed but the database isnt updated . When i echo the $sql, all the values are set properly. and when i ech the $result i get the value 1. can someone please tell me what am i doing wrong here??

    Read the article

  • properly setting email subject line delivered from email form

    - by DC1
    I have a email form for my website but here is the issue: when i receive an email, the subject line in my inbox shows whatever the user inputted as subject in the form. id like to override that so that whenever an email comes in. the subject in the email header is always "an inquiry from your website". In the message body, sure i don't mind their specific subject they entered but when I receive an email, id like consistency in my inbox. this is the current code: <?php session_start(); if(isset($_POST['Submit'])) { if( $_SESSION['chapcha_code'] == $_POST['chapcha_code'] && !empty($_SESSION['chapcha_code'] ) ) { $youremail = 'xxxxxxxxx'; $fromsubject = 'An inquiry from your website'; $title = $_POST['title']; $fname = $_POST['fname']; $lname = $_POST['lname']; $mail = $_POST['mail']; $address = $_POST['address']; $city = $_POST['city']; $zip = $_POST['zip']; $country = $_POST['country']; $phone = $_POST['phone']; $subject = $_POST['subject']; $message = $_POST['message']; $headers = "From: $nome <$mail>\r\n"; $to = $youremail; $mailsubject = 'Message received from'.$fromsubject.' Contact Page'; $body = $fromsubject.' The person that contacted you is '.$fname.' '.$lname.' Address: '.$address.' '.$city.', '.$zip.', '.$country.' Phone Number: '.$phone.' E-mail: '.$mail.' Subject: '.$subject.' Message: '.$message.' |---------END MESSAGE----------|'; echo "Thank you for inquiring. We will contact you shortly.<br/>You may return to our <a href='/index.html'>Home Page</a>"; mail($to, $subject, $body, $headers); unset($_SESSION['chapcha_code']); } else { echo 'Sorry, you have provided an invalid security code'; } } else { echo "You must write a message. </br> Please visit our <a href='/contact.html'>Contact Page</a> and try again."; } ?>

    Read the article

  • php cURL POST how to follow location

    - by webfac
    Hi Guys, I am in a bit of a rut with a cURL issue. The post works greate, the data is POSTED just fine and received ok, but the url of the posted page never appears in the browser after the cURL session is executed, for example look at the following code: $ch = curl_init("http://localhost/eterniti/cart-step-1.php"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, "error=1&em=$em&fname=$fname&lname=$lname&email1=$email1&email2=$email2&code=$code&area=$area&number=$num&mobile=$mobile&address1=$address1&address2=$address2&address3=$address3&suburb=$suburb&postcode=$postcode&country=$country"); curl_exec($ch); curl_close($ch); The post works fine and I am taken to the cart-step-1.php where I can process the posted data, HOWEVER the location in the URL address bar of the browser remains that of the script page, in this case proc_xxxxxx.php Any ideas how to get the URL address to reflect the page I am actually POSTED to? Thanks a mill

    Read the article

  • Convet long/lat to pixel x/y on a given picure.

    - by kalininew
    I have a city "map" (for example - Moscow). She in accuracy repeats the contours the given city in google maps (that is it is copied from google maps and it is a little processed, but the sense remained the same). Also I have object co-ordinates in a city (in co-ordinates of google). Problem: how to translate google co-ordinates to the co-ordinates of my picture (that is in pixels on OX and OY on a picture). That is I receive google-co-ordinates and it is necessary for me to draw this point on my picture. I know that on small scales (for example on city scales) it to make simply enough (it is necessary to learn what google-co-ordinates has one of picture corners, then to learn "price" of one pixel in google-co-ordinates on a picture on axes OX and OY separately). But on the big scales (country scale) "price" of one pixel will be not a constant, and will vary strongly enough and the method described above cannot be applied. How to solve a problem on country scales?

    Read the article

  • tradingeye JS error.

    - by Kyle Hudson
    Hi Guys, Can anyone help me, I have a IE javascript issue. I am really stuck and the client has just brought it to my attention. The site is http://www.fleurofengland.com/, its the check out page so if you would be kind enough to goto the site, add anything to your basket and go through to the checkout. The problem is when you get to the checkout page (https://www.fleurofengland.com/eaction/checkout.billing/), under the 'Billing and Delivery Details' heading you will see a dropdown called country. Below that is another dropdown called County/State, this dropdown is meant to be populated from the values of the 'country' one above however its not working. Please help or suggest a fix. Thanks in Advance, Kyle

    Read the article

  • ValueError with multi-table inheritance in Django Admin

    - by jorde
    I created two new classes which inherit model Entry: class Entry(models.Model): LANGUAGE_CHOICES = settings.LANGUAGES language = models.CharField(max_length=2, verbose_name=_('Comment language'), choices=LANGUAGE_CHOICES) user = models.ForeignKey(User) country = models.ForeignKey(Country, null=True, blank=True) created = models.DateTimeField(auto_now=True) class Comment(Entry): comment = models.CharField(max_length=2000, blank=True, verbose_name=_('Comment in English')) class Discount(Entry): discount = models.CharField(max_length=2000, blank=True, verbose_name=_('Comment in English')) coupon = models.CharField(max_length=2000, blank=True, verbose_name=_('Coupon code if needed')) After adding these new models to admin via admin.site.register I'm getting ValueError when trying to create a comment or a discount via admin. Adding entries works fine. Error msg: ValueError at /admin/reviews/discount/add/ Cannot assign "''": "Discount.discount" must be a "Discount" instance. Request Method: GET Request URL: http://127.0.0.1:8000/admin/reviews/discount/add/ Exception Type: ValueError Exception Value: Cannot assign "''": "Discount.discount" must be a "Discount" instance. Exception Location: /Library/Python/2.6/site-packages/django/db/models/fields/related.py in set, line 211 Python Executable: /usr/bin/python Python Version: 2.6.1

    Read the article

  • Get logical path from treeview which has HierarchicalDataTemplate

    - by phenevo
    Hi, I have a structure of geography objects: Country Areas, Provinces, Cities and Hotels Country has regions, regions provinces etc... Whne I'll click City node I wanna to get logical path eg: France,Provanse,SomeProvince,Montpellier,Coral Hotel. Each class has fields: name, code nad listOf... Treeview works great, but this method not: private void structureTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) { if (structureTree.SelectedItem is Hotel) { objectCode = ((Hotel)structureTree.SelectedItem).Code; TreeViewItem item = e.OriginalSource as TreeViewItem; DependencyObject parent = VisualTreeHelper.GetParent(item); dlgEditHotel(objectCode, structureTree.Parent.ToString()); } }

    Read the article

  • [Java] Form data transition into entity beans to persist them by the server side ORM

    - by cscsaba242
    Hello guys, Is there any good explanation or tutorial which describes the common way how can we create entity beans from the received data of the form ? The main reason of my question the treating the received ids (e.g id of country,city and so forth) which is the way from the id to entity ? Example: ................Client side form username:String countryid:Integer (could be a drop down) ................Server side entities public class UserBean { String username; CountryBean Country; } public class CountryBean { String cityname; Integer id; } ............................................ Maybe the question is dependent of the used technology, but I guess there is a very common way. I would like to comprehend the conventional approach of this problem. (For the sake of the completeness I would like to save the form data (received by Stripes) by JPA) Thanks advance. cscsaba242

    Read the article

  • Parsing a XML File and Replacing Chosen Node With Values From Text File

    - by transmogrify
    I wrote a C# Winforms program to take a XML file and load values from a text file into each occurrence of that field which the user specifies on the UI. For whatever reason, the program inserts a carriage return on any nodes which don't contain a value. For example, it will do that to <example></example> whereas it will not misbehave on something like <country>USA</country> What is causing it to do this and how can I prevent it? Here is the code from the part which handles this functionality. XmlDocument LoadXmlDoc = new XmlDocument(); StreamReader sr = File.OpenText(DataLoadTxtBx.Text); string InputFromTxtFile; LoadXmlDoc.Load(XmlPath.Text); XmlNodeList NodeToCreateOrReplace = LoadXmlDoc.GetElementsByTagName(XmlTagNameTxtBx.Text); foreach (XmlNode SelectedNode in NodeToCreateOrReplace) { if ((InputFromTxtFile = sr.ReadLine()) != null) { SelectedNode.InnerText = InputFromTxtFile; } } sr.Close(); LoadXmlDoc.Save(XmlPath.Text);

    Read the article

  • jQuery: Sort div's according to content of different sub divs

    - by rayne
    I'm trying to create a somewhat complex sorting feature which neither uses divs nor lists. Unfortunately two hours of googling didn't help me. Here is the basic setup of my HTML: <div id="all_elements"> <!-- one element --> <div class="element"> <div class="wrapper"> <a href="/" title="links"> <img src="/img/image.jpg" border="0" alt="image" class="image" /></a> <div class="details"> <h3><a href="/" title="title">Name (Sort Argument 1)</a></h3> <div class="title"><a href="/" title="title">Title (Sort Argument 2)</a></div> <div class="year">2010 (Sort Argumentt 3)</div> <div class="country">Great Britain (Sort Argument 4)</div> </div><!-- details --> </div><!-- wrapper --> </div><!-- element --> </div> <!--all_elements--> The setup is a bit complex, but basically .element is the element that needs to be sorted alphabetically according to either the contents of h3, div.title, div.year or div.country. So the user will be able to view the contents of the site either sorted by name, by year, by country or by title. I have this jQuery snippet from a website, but all my attempts on trying to tell it to use the contents of e.g. h3 to sort have failed. Right now it sorts pretty much randomly. jQuery.fn.sort = function() { return this.pushStack([].sort.apply(this, arguments), []); }; function sortAscending(a, b) { return a.innerHTML > b.innerHTML ? 1 : -1; }; function sortDescending(a, b) { return a.innerHTML < b.innerHTML ? 1 : -1; }; $(document).ready(function() { $("#sort").toggle( function() { $('#all_elements .element').sort(sortDescending).appendTo('#all_elements'); $(this).text("Sort Asc"); }, function() { $('#all_elements .element').sort(sortAscending).appendTo('#all_elements'); $(this).text("Sort Desc"); }); }); How can I customize the function to sort the contents of my h3 or divs?

    Read the article

  • Jquery Autocomplete Unable to Empty Input on Internet Explorer

    - by Matias
    Hi, I´ve got a Jquery autocomplete input like the following: $("#cities").autocomplete(regionIDs, { minChars: 2, width: 310, autoFill: true, matchContains: "word", formatItem: function(row) { return row.city + ", " + "<span>" + row.country + "</span>"; }, formatMatch: function(row) { return row.city; }, formatResult: function(row) { return row.city + ", " + row.country; } }); A listener for the input $("#cities").result(function(event, data, formatted) { selectedCity = (data.regionID); }); And the input: <input type="text" class="textbox" id="cities" name="q" autocomplete="off"> The trouble is when I reload the page, Internet explorer displays last user Input in the text box. However, the variable has no value. I have tried with .reset() but no success. Any ideas why ?

    Read the article

  • SMS Gateway Devices

    - by u07ch
    Can anyone recommend a good SMS Gateway device that sends and receives messages and has a reasonable API. We are looking for a hardware device that a Sim Card and works with Windows / .Net. I am working with about 50 different countries (Right now 50 will only become more in the future) and dealing with that many SMS suppliers and their various methods for billing and sending / responding to messages is proving unmanageable. It may be much easier to have a single method and call it by country. We do bulk send messages but from the logs this is at most 500 messages at a time (though it could be up-to about 1500 at a time) - mostly its small numbers far less than 500 messages. Ideally would like to get message delivery data and error handling type messages back from the device. I am not interested in a hosted solution unless it has the ability to receive a message to a local number in EVERY country.

    Read the article

  • standardize international phone no. code using only regex

    - by DarkFox
    Sipdroid on Android has a search & replace method, that uses regex. I'm trying to use it to make sure all outgoing calls has a country code in the format 00XX I also want it to put 0045 in front of the number, if no country code is present. The first one, I have solved, but I can't figure out how to do the second thing. Search: \A(((\+)(\d{2})?)|(00(\d{2})?)|)((\d|\s)+)\Z Replace: 00$4$6$7 I'm using http://www.regexplanet.com/simple/index.html to test it, with the test strings: "12345678", "+4512345678" and "004512345678" They should all return "004512345678".

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >