Search Results

Search found 11927 results on 478 pages for 'pete field'.

Page 12/478 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Cannot update a single field using Linq to Sql

    - by KallDrexx
    I am having a hard time attempting to update a single field without having to retrieve the whole record prior to saving. For example, in my web application I have an in place editor for the Name and Description fields of an object. Once you edit either field, it sends the new field (with the object's ID value) to the web server. What I want is the webserver to take that value and ID and only update the one field. There are only two ways google tells me to do this: 1) When I get the value I want to change, the value and the ID, retrieve the record from the database, update the field in the c# object, and then send it back to the server. I don't like this method because not only does it include a completely unnecessary database read call (which includes two tables due to the way my schema is). 2) Set UpdateCheck for all the fields (but the primary keys) to UpdateCheck.Never. This doesn't work for me (I think) due to my mapping layer between the Linq to Sql and my Entity/ViewModel layer. When I convert my entity into the linq to sql db object it seems to be updating those fields regardless of the UpdateCheck setting. This might be just because of integers, since not setting an int means it is a zero (and no, I can't use int? instead). Are there any other options that I have?

    Read the article

  • Copy from a password field in form

    - by Ali
    I was designing a form which asks the user to type in a password and then to verify again in the next field. I noticed however, that if I copy and paste from the first password field to the other, the values are not same. It seems my Firefox running on Mac OS X, copies the asterisk graphic instead, which has the value '\x95' Is it possible to copy the underlying text from the password field? Thanks

    Read the article

  • How to determine MS Access field size via OleDb

    - by Andy
    The existing application is in C#. During startup the application calls a virtual method to make changes to the database (for example a new revision may need to calculate a new field or something). An open OleDb connection is passed into the method. I need to change a field width. The ALTER TABLE statement is working fine. But I would like to avoid executing the ALTER TABLE statement if the field is already the appropriate size. Is there a way to determine the size of an MS Access field using the same OleDb connection?

    Read the article

  • Odd behavior in Django Form (readonly field/widget)

    - by jamida
    I'm having a problem with a test app I'm writing to verify some Django functionality. The test app is a small "grade book" application that is currently using Alex Gaynor's readonly field functionality http://lazypython.blogspot.com/2008/12/building-read-only-field-in-django.html There are 2 problems which may be related. First, when I flop the comment on these 2 lines below: # myform = GradeForm(data=request.POST, instance=mygrade) myform = GradeROForm(data=request.POST, instance=mygrade) it works like I expect, except of course that the student field is changeable. When the comments are the shown way, the "studentId" field is displayed as a number (not the name, problem 1) and when I hit submit I get an error saying that studentId needs to be a Student instance. I'm at a loss as to how to fix this. I'm not wedded to Alex Gaynor's code. ANY code will work. I'm relatively new to both Python and Django, so the hints I've seen on websites that say "making a read-only field is easy" are still beyond me. // models.py class Student(models.Model): name = models.CharField(max_length=50) parent = models.CharField(max_length=50) def __unicode__(self): return self.name class Grade(models.Model): studentId = models.ForeignKey(Student) finalGrade = models.CharField(max_length=3) # testbed.grades.readonly is alex gaynor's code from testbed.grades.readonly import ReadOnlyField class GradeROForm(ModelForm): studentId = ReadOnlyField() class Meta: model=Grade class GradeForm(ModelForm): class Meta: model=Grade // views.py def modifyGrade(request,student): student = Student.objects.get(name=student) mygrade = Grade.objects.get(studentId=student) if request.method == "POST": # myform = GradeForm(data=request.POST, instance=mygrade) myform = GradeROForm(data=request.POST, instance=mygrade) if myform.is_valid(): grade = myform.save() info = "successfully updated %s" % grade.studentId else: # myform=GradeForm(instance=mygrade) myform=GradeROForm(instance=mygrade) return render_to_response('grades/modifyGrade.html',locals()) // template <p>{{ info }}</p> <form method="POST" action=""> <table> {{ myform.as_table }} </table> <input type="submit" value="Submit"> </form> // Alex Gaynor's code from django import forms from django.utils.html import escape from django.utils.safestring import mark_safe from django.forms.util import flatatt class ReadOnlyWidget(forms.Widget): def render(self, name, value, attrs): final_attrs = self.build_attrs(attrs, name=name) if hasattr(self, 'initial'): value = self.initial return mark_safe("<span %s>%s</span>" % (flatatt(final_attrs), escape(value) or '')) def _has_changed(self, initial, data): return False class ReadOnlyField(forms.FileField): widget = ReadOnlyWidget def __init__(self, widget=None, label=None, initial=None, help_text=None): forms.Field.__init__(self, label=label, initial=initial, help_text=help_text, widget=widget) def clean(self, value, initial): self.widget.initial = initial return initial

    Read the article

  • Drupal - Grabbing and Looping NID of CCK Nodereference field

    - by GaxZE
    Hello, cant seem to work out how i grab multiple nids of a node reference field. $node-field_name[0]['nid'] picks up the node id of the cck node reference field. however when that cck node reference field has more than one value i get stuck! my php is abit sketchy atm so working with arrays and loops is being quite difficult! here is my code: field_industry as $item) { ? "

    Read the article

  • Drupal CCK field type with complex fAPI child fields

    - by Cliff Smith
    This question is basically a follow-up to this one: http://stackoverflow.com/questions/1640534/drupal-custom-cck-field-with-multiple-child-fields I need to build a CCK field type that stores several pieces of data, and fAPI form elements to accept the input for each piece of data already exist. These elements are built out into multiple HTML form inputs with fAPI #process functions. The problem is that when I try to use these elements in my CCK field, the input from the widget doesn't line up with the database columns specified in hook_field_settings(). The widget returns something like this: Array ( [thumbnail_image] => [imceimage_path] => ... [imceimage_alt] => ... [imceimage_width] => ... [imceimage_height] => ... [user_address] => [address_number] => ... [address_street] => ... [address_city] => ... [address_state] => ... Unless there's a way to specify "sub-columns" in hook_field_settings(), it appears to me that I can't use form element types with sub-elements in CCK fields. I've tried using CCK field validation to pull out the "imce_xxx" values from thumbnail_image and likewise with user_address, but that doesn't get me anywhere. Is it not possible to use form elements with child elements in CCK field definitions? Thanks, Cliff Smith

    Read the article

  • Link between CCK field and view

    - by JTB
    I want to use a view to select nodes in a content type field. This view must receive an argument that is another field of the content type. Can someone explain me how to pass the argument from the field to the view? Excuse my poor english

    Read the article

  • Jackson object mapping - map incoming JSON field to protected property in base class

    - by Pete
    We use Jersey/Jackson for our REST application. Incoming JSON strings get mapped to the @Entity objects in the backend by Jackson to be persisted. The problem arises from the base class that we use for all entities. It has a protected id property, which we want to exchange via REST as well so that when we send an object that has dependencies, hibernate will automatically fetch these dependencies by their ids. Howevery, Jackson does not access the setter, even if we override it in the subclass to be public. We also tried using @JsonSetter but to no avail. Probably Jackson just looks at the base class and sees ID is not accessible so it skips setting it... @MappedSuperclass public abstract class AbstractPersistable<PK extends Serializable> implements Persistable<PK> { @Id @GeneratedValue(strategy = GenerationType.AUTO) private PK id; public PK getId() { return id; } protected void setId(final PK id) { this.id = id; } Subclasses: public class A extends AbstractPersistable<Long> { private String name; } public class B extends AbstractPersistable<Long> { private A a; private int value; // getter, setter // make base class setter accessible @Override @JsonSetter("id") public void setId(Long id) { super.setId(id); } } Now if there are some As in our database and we want to create a new B via the REST resource: @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Transactional public Response create(B b) { if (b.getA().getId() == null) cry(); } with a JSON String like this {"a":{"id":"1","name":"foo"},"value":"123"}. The incoming B will have the A reference but without an ID. Is there any way to tell Jackson to either ignore the base class setter or tell it to use the subclass setter instead? I've just found out about @JsonTypeInfo but I'm not sure this is what I need or how to use it. Thanks for any help!

    Read the article

  • Best way to retrieve certain field of all documents returned by a lucen search

    - by Philipp
    Hi, I was wondering what the best way is to retrieve a certain field of all documents returned by a Searcher of Lucene. Background: each document has a date field (written on) and I would like to show a timeline of all found documents, so I need to extract the date (day) field of all the documents I find with the search. I currently retrieve every document using Searcher.doc(int, FieldSelector) having the selector only retrieve the certain field. I have indexed 250k documents, the search itself takes no time and returns about 10k document ids. Retrieving those however, takes 20+ seconds. What can I do to speed things up, but still get all the values I need. Thx in advance Philipp

    Read the article

  • I need an abstract field !

    - by Jules Olléon
    I know abstract fields do not exist in java. I also read this question but the solutions proposed won't solve my problem. Maybe there is no solution, but it's worth asking :) Problem I have an abstract class that does an operation in the constructor depending on the value of one of its fields. The problem is that the value of this field will change depending on the subclass. How can I do so that the operation is done on the value of the field redefined by the subclass ? If I just "override" the field in the subclass the operation is done on the value of the field in the abstract class. I'm open to any solution that would ensure that the operation will be done during the instantiation of the subclass (ie putting the operation in a method called by each subclass in the constructor is not a valid solution, because someone might extend the abstract class and forget to call the method). Also, I don't want to give the value of the field as an argument of the constructor. Is there any solution to do that, or should I just change my design ?

    Read the article

  • MySQL: select words as rows even som are "new line" separated in one field

    - by Tillebeck
    Hi I have a table with a field where words are written separated with new lines. So a select on this single field from to rows will output 3 lines for first row and 2 lines for second row: Row1 designationer nye kolonier mindre byer Row2 udsteder bopladser I would like to do a select that select all these lines as if they had been rows in the table like: SELECT do_the_split(field) FROM table so the result would be more like: Row1 designationer Row2 nye kolonier Row3 mindre byer Row4 udsteder Row5 bopladser is there any way to do this in MySQL? BR. Anders

    Read the article

  • how to bind a winforms to a field ?

    - by MemoryLeak
    I use winforms to develop application, I want to know how can I use data binding to bind two radio button to a database field ? And if bind to a database field is too complicated, then can I save the value manually while leave other field bind to textbox and automatically update the value?

    Read the article

  • ASP.Net Custom Field From Query In DataSet

    - by boruchsiper
    I added a new query to a table adapter in a DataSet. This query adds another field to the query whcih is a sum from another table. Here is the full query: SELECT (SELECT COUNT(donationID) AS Expr1 FROM Donations AS da WHERE (dn.donorID = donorID)) AS Count, Solicitor, address1, address2, city, companyName, country, donorID, email, first, last, phoneHome, phoneMobile, phoneWork, state, webURL, zip, (select sum(amount) from Donations as dna where dna.donorID = dn.donorID) as SumDonations FROM Donors AS dn order by last The new field is represented in the last part of the query: (select sum(amount) from Donations as dna where dna.donorID = dn.donorID) as SumDonations I can preview the data in the xsd but the last field "SumDonations" is not showing up as a field I can add to my gridview. I rebuilt the website but no luck. What am I missing?

    Read the article

  • Change field access to getter / setter method access

    - by Chris Dennett
    Hi everyone, is it possible to change external class field accesses in Java to getter / setter calls automatically, and also hide the exposed fields? I'm using Javabeans and I want change notifications when a field property changes (this is important). I've found cglib which can automatically insert the property change call to the PropertyChangeSupport field. I'd like this question to be a discussion of the issues posed and their solutions. I know about Project Lombok, but this appears to modify the source code, and additionally doesn't support field access modification. Perhaps with modifications to Lombok, this could be supported, or are there other solutions? Cheers and thanks in advance, Chris

    Read the article

  • PDF Form Field Manipulation

    - by 108039818756939362532
    I'm making a web interface to autofill pdf forms with user data from a database. The admin needs to be able to upload a pdf (right now targeted at IRS pdf forms) and then associate the fields in the pdf with data fields in the database. I need a way to help the admin associate the field names (stuff like "topmostSubform[0].Page2[0].p2-t66[0]") with the the data fields in the database. I'm looking for a way to modify the PDF programatically to in some way provide this information. Basically I'm open to suggestions on how I might make the field names appear in an obvious manner on a modified version of the original pdf. The closest I've gotten is being able to insert Tooltips into the fields in the pdf by just editting the raw pdf line by line. However when editting the pdf in this manner the field names are gibberish, and so I can't just use them. An optimal solution would be anything that could automatically parse a pdf and set each field's tooltip to be the fields name. Anything that can be run from the command line, or any python tool, or just a basic how to correctly parse a field's name from a raw pdf file would be amazing.

    Read the article

  • I am wondering how the Plural-Field generic is to be rendered in the REST OpenSocial 1.0 API specifi

    - by DaveGrahamOrg
    In the OpenSocial Data specificaiton 1.0 for a Person object (social profile data) it includes the use of a generic called Plural-Field. The spec can be found at: http://opensocial-resources.googlecode.com/svn/spec/1.0/Social-Data.xml#Person In the 1.0 data specification there is no XSD and no examples showing the use of this generic Plural-Field. After puzzeling the spec for some time I think I might understand the user of this generic. I was hoping that someone could confirm or correct my understanding. For example the accounts field is a generic Plural-Field<Account> while the activities field is Plural-Field <string>. Am I right in assuming that the result XML would look like: <accounts> <Plural-Field> <primary>true</primary> <type>ntlm</type> <value> <Account> <domain>MYDOMAIN</domain> <userid>MYDOMAIN\davegraham</userid> <username>davegraham</username> </Account> </value> </Plural-Field> <Plural-Field> <primary>false</primary> <type>claims</type> <value> <Account> <domain>i:0#.f|claimsDomain</domain> <userid>i:0#.f|claimsDomain|davegraham</userid> <username>davegraham</username> </Account> </value> </Plural-Field> </accounts> <activities> <Plural-Field> <primary>true</primary> <type>ntlm</type> <value>cycling</value> </Plural-Field> <Plural-Field> <primary>false</primary> <type>claims</type> <value>swiming</value> </Plural-Field> </activities> Am I right in my interpretation of the spec?

    Read the article

  • Grails + Spring Security one field login

    - by Miguel
    Hi all Is it possible, using spring security plugin 0.5.3 with Grails 1.2.1, to authenticate a user using only one field? I mean, for example, making j_username and j_password fields in the authentication form equal previous to the authentication. I read it was possible to define j_username field in Config.groovy with acegi plugin, in older versions of the plugin. Now it uses SecurityConfig.groovy but the possibility of defining the field exists no more. Any ideas?? Thanks a lot, Miguel

    Read the article

  • How to clear a bean field with Stripes.

    - by Davoink
    In a JSP I have the following field: <stripes:text name="email"/> This field is in my action bean(snippet): public class CreateClaim implements ActionBean { private String email; public void setEmail(String email) { this.email = email; } public String getEmail() { return email; } public Resolution alc(){ email = "poodle"; return new ForwardResolution("aForward.jsp"); } } In the alc() methos I am setting email to be null. But when the pages renders the value of the email field is exactly as it was entered originally. Is there a way of clearing this field once and event has triggered? Cheers Dave

    Read the article

  • SmartGwt DateItem useTextField=true - how to make text entry field UNeditable

    - by Paul
    Since I can't figure out how to solve my problem presented here I'm thinking for the moment at a temporary solution. I have a smartgwt DateItem widget: DateItem date = new DateItem("Adate"); date.setWidth(120); date.setWrapTitle(false); date.setAttribute("useTextField", true); date.setAttribute("inputFormat", "yyyy/MM/dd"); date.setAttribute("displayFormat", "toJapanShortDate"); Because the attribute useTextField is set to true we can see the text entry field. How can I make this text entry field to be uneditable. Actually I want to have only the possibility to choose the date from calendar and not to change it manually. Resolved - the issue exposed above - thanks to @RAS user. TextItem textItem = new TextItem(); textItem.setAttribute("readOnly", true); date.setAttribute("textFieldProperties", textItem); Related link But I have now another issue: The date chooser won't show the date on the text field but Today's date. For example, enter 30/05/2009 on the text field, go to another field, then come back on click on the date chooser and the selected day will be Today's date instead on June 30th, 2009. Which is the reason for this? Can this be solved? Also let's say I let to the user to opportunity to manually modify the date - can I put some validators on it? Thank you.

    Read the article

  • Validate numeric text field in jquery

    - by mcxiand
    I have this code in jquery to prevent non-numeric characters being inputted to the text field $("#NumericField").numeric(); Now, on the text field i cant input non-numeric characters. That is OK. The problem here is if the user will paste on the text field with non numeric characters. Is there a way/method to disable pasting if the value is non-numeric? Or is there any other approach to handle this situation that you can share?

    Read the article

  • AES Encrypting a Microsoft Access Field Via VBA

    - by Jason
    I need to create a Microsoft Access database, but have a need, in one of my tables, for a single field to be strongly encrypted. Since AES requires both a key and an initialization vector, I've decided to solve this problem by requiring a password to access the database (as the key), and a field in the table to hold a SHA1 hash of the plaintext of the encrypted field. Does anyone know where I can find VBA-compatible code to actually do the encryption?

    Read the article

  • LINQ OrderBy with more than one field

    - by brainimus
    I have a list that I need sorted by two fields. I've tried using OrderBy in LINQ but that only allows me to specify one field. I'm looking for the list to be sorted by the first field and then if there are any duplicates in the first field to sort by the second field. For example I want the results to look like this (sorted by last name then first name). Adams, John Smith, James Smith, Peter Thompson, Fred I've seen that you can use the SQL like syntax to accomplish this but I am looking for a way to do it with the OrderBy method. IList<Person> listOfPeople = /*The list is filled somehow.*/ IEnumerable<Person> sortedListOfPeople = listOfPeople.OrderBy(aPerson => aPerson.LastName, aPerson.FirstName); //This doesn't work.

    Read the article

  • Want to bind an input field to a jquery-ui slider handle

    - by BFTrick
    hello, I want to bind an input field to the jquery-ui slider handle. So whenever one value changes I want the other value to also change. Ex: if someone types 1000 into the minimum value input field I want the lower slider handle to move to the 1000 mark. Also if the user drags the lower slider handle to 1000 the input field should reflect that. Making the slider reflect the changes in the input field is easy: $(minYearInput).blur(function () { $("#yearSlider").slider("values", 0, parseInt($(this).val())); }); $(maxYearInput).blur(function () { $("#yearSlider").slider("values", 1, parseInt($(this).val())); }); I just need help making the text fields mimic the slider. $("#yearSlider").slider({ range: true, min: 1994, max: 2011, step: 1, values: [ 1994 , 2011 ], slide: function(event, ui) { //what goes here? } }); Any ideas? A similar question from this site: http://stackoverflow.com/questions/1330008/jquery-ui-slider-input-a-value-and-slider-move-to-location

    Read the article

  • How To Get A Field Value Based On The Max Of Another Field In VFP v8.0

    - by DaveB
    So, I have a table and I want to get the value from one field in the record with the greatest DateTime() value in another field and where still another field is equal to a certain value. Example data: Balance Created MeterNumber 7924.252 02/02/2010 10:31:48 AM 2743800 7924.243 02/02/2010 11:01:37 AM 2743876 7924.227 02/02/2010 03:55:50 PM 2743876 I want to get the balance for a record with the greatest created datetime for a specific meter number. In VFP 7 I can use: SELECT a.balance ,MAX(a.created) FROM MyTable a WHERE a.meternumber = '2743876' But, in the VFP v8.0 OleDb driver I am using in my ASP.NET page I must conform to VFP 8 which says you must have a GROUP BY listing each non aggregate field listed in the SELECT. This would return a record for each balance if I added GROUP BY a.balance to my query. Yes, I could issue a SET ENGINEBEHAVIOR 70 but I wanted to know if this could be done without having to revert to a previous version?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >