Search Results

Search found 17357 results on 695 pages for 'custom attributes'.

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

  • How do I get my custom requiredif attribute to prevent other attributes from firing

    - by user1757804
    I'm working on an MVC application. I've decorated a property with EqualTo found here: http://dataannotationsextensions.org/EqualTo/Create As well as a custom RequiredIf attribute as suggested here: http://blogs.msdn.com/b/simonince/archive/2011/02/04/conditional-validation-in-asp-net-mvc-3.aspx My issue is that even when the field is supposed to be required and isn't the EqualTo logic is firing. So I get error messages saying the field is required but also that the field doesn't match. If I replace the Requiredif with a regular Required only the Required message will show. What I'm trying to figure out is how the EqualTo logic is prevented when combined with the Required attribute but not prevented when combined with my custom RequiredIf. Any suggestions would be most appreciated, I've been racking my brain most of the day trying to figure out the mvc internals around Required.

    Read the article

  • Custom distro using ubuntu 12.04

    - by user89707
    I am creating the custom operating system using the ubuntu 12.04. When ubuntu login from the light dm -- it shows ubuntu desktop . i need to change to the my os name. I need to replace the ambaince dark icon to fs icon by default for all the login and live cd. How to permanentely change the os name It should not change even the customer update the operating system too. I am using the remastersys. I am looking to develop the new distro. like mint ,, If i had an breif explanation of the creation of the repository and maintaining the updates . it will be more helpfull. Kindly provind the link for creating the full fledged os based on the ubuntu .. like mint, Snowlinux, etc did.. replace the grub with burg for default installation If remastersys is not good . then provide me some other tool to create . I am not having the high speed internet

    Read the article

  • Accepts Nested Attributes For - edit form displays incorrect number of items ( + !map:ActiveSupport:

    - by Brightbyte8
    Hi, I have a teacher profile model which has many subjects (separate model). I want to add subjects to the profile on the same form for creating/editing a profile. I'm using accepts_nested_attributes for and this works fine for creation. However on the edit page I am getting a very strange error - instead of seeing 3 subjects (I added three at create and a look into the console confirms this), I see 12 subjects(!). #Profile model class Profile < ActiveRecord::Base has_many :subjects accepts_nested_attributes_for :subjects end #Subject Model class Subject < ActiveRecord::Base belongs_to :profile end #Profile Controller (only showing deviations from normal RESTFUL setup) def new @profile = Profile.new 3.times do @profile.subjects.build end end #Here's 1 of three parts of the subject output of = debug @profile errors: !ruby/object:ActiveRecord::Errors base: *id004 errors: !map:ActiveSupport::OrderedHash {} subjects: - &id001 !ruby/object:Subject attributes: exam: Either name: "7" created_at: 2010-04-15 10:38:13 updated_at: 2010-04-15 10:38:13 level: Either id: "31" profile_id: "3" attributes_cache: {} # Note that 3 of these attributes are displayed despite me seeing 12 subjects on screen Other info in case it's relevant. Rails: 2.3.5 Ruby 1.8.7 p149 HAML I've never had so much difficulty with a bug before - I've already lost about 8 hours to it. Would really appreciate any help! Thanks to any courageous takers Jack

    Read the article

  • Create Awesome Map-Based Wallpapers for Your Desktop with ‘Map –> Image’

    - by Asian Angel
    Are you tired of using the same old types of wallpapers on your desktop? Then add something fresh and unique to your desktop with custom-created map wallpapers from ‘Map – Image’. When you first visit the website it will show the default location of San Francisco (home of the developers). To get started simply enter your location in the search blank in the upper left corner and click the Go Button. Your chosen location will appear in a basic black and white format as shown here. 6 Start Menu Replacements for Windows 8 What Is the Purpose of the “Do Not Cover This Hole” Hole on Hard Drives? How To Log Into The Desktop, Add a Start Menu, and Disable Hot Corners in Windows 8

    Read the article

  • Creating a spin from my installation

    - by LinuxPCplus
    Over the last 6 months or so I have tweaked & customized my Ubuntu installation until I have what I feel is a perfect Distro! Now I would like to turn it into a custom Ubuntu spin that can be run either as I live DVD/USB or installed to a users HDD. Is there an "easy" way to do this? I would want to use the standard Ubuntu installer but the distro would have it's own name, so I may need to customize the installer to reflect this.

    Read the article

  • Practical mysql schema advice for eCommerce store - Products & Attributes

    - by Gravy
    I am currently planning my first eCommerce application (mySQL & Laravel Framework). I have various products, which all have different attributes. Describing products very simply, Some will have a manufacturer, some will not, some will have a diameter, others will have a width, height, depth and others will have a volume. Option 1: Create a master products table, and separate tables for specific product types (polymorphic relations). That way, I will not have any unnecessary null fields in the products table. Option 2: Create a products table, with all possible fields despite the fact that there will be a lot of null rows Option 3: Normalise so that each attribute type has it's own table. Option 4: Create an attributes table, as well as an attribute_values table with the value being varchar regardless of the actual data-type. The products table would have a many:many relationship with the attributes table. Option 5: Common attributes to all or most products put in the products table, and specific attributes to a particular category of product attached to the categories table. My thoughts are that I would like to be able to allow easy product filtering by these attributes and sorting. I would also want the frontend to be fast, less concern over the performance of the inserting and updating of product records. Im a bit overwhelmed with the vast implementation options, and cannot find a suitable answer in terms of the best method of approach. Could somebody point me in the right direction? In an ideal world, I would like to offer the following kind of functionality - http://www.glassesdirect.co.uk/products/ to my eCommerce store. As can be seen, in the sidebar, you can select an attribute the glasses to filter them. e.g. male / female or plastic / metal / titanium etc... Alternatively, should I just dump the mySql relational database idea and learn mongodb?

    Read the article

  • ASP.Net MVC 2.0: EditorFor setting name via attributes

    - by vdh_ant
    Hey guys Just wondering how do I mimic the following using attributes... <%= Html.EditorFor(x => x.SportProgramIdList, "FormMultiSelectDropDownList", "SportProgramIds")%> I know I can specify the template by using [UIHint("FormMultiSelectDropDownList")] but I am left with the problem with how to set the name... Cheers Anthony

    Read the article

  • jquery get attributes

    - by Mark
    I'm looking for a way to grab the custom attributes of a element with jquery. <span id='element' data-type='foo' data-sort='bar'></span> I'm looking to get: `["data-type", "data-sort"]` as an array. Anyone know how to do this? Thanks.

    Read the article

  • Multiple roles with attributes(?) in Capistrano

    - by Justin
    How can I pass along attributes to my tasks in capistrano? I'm thinking it would be something along the lines of... role :app, [["server_one", {:name => "alice"}], ["server_two", {:name => "bob"}], ["server_three", {:name => "charles"}]] And then for my task... task :start_server do run "./myscript #{name}" end Any ideas?

    Read the article

  • Validate number of nested attributes

    - by Damien MATHIEU
    Hello, I have a model with nested attributes : class Foo < ActiveRecord::Base has_many :bar accepts_nested_attributes_for :bar end It works fine. However I'd want to be sure that for every Foo, I have at least two Bar. I can't access the bar_attributes in my validations so it seems I can't validate it. Is there any clean way to do so ?

    Read the article

  • Python Attributes and Inheritance

    - by user368186
    Say I have the folowing code: class Class1(object): def __init__(self): self.my_attr = 1 self.my_other_attr = 2 class Class2(Class1): def __init__(self): super(Class1,self).__init__() Why does Class2 not inherit the attributes of Class1?

    Read the article

  • Custom field not showing in Custom Content Type

    - by BeraCim
    Hi all: I created a custom column in a custom content type in a Sharepoint Web manually (e.g. /MySite/MyWeb). I now want to programmatically copy this content type across to another web (e.g. /MySite/MyWeb2). However, upon looping through the custom content type in code, I could only find 2 fields: Content Type and Title (expected: Title and custom column). The custom column was missing. I'm very sure that the content type and field are added at the web level. The custom content type is inherited from Item. When I loop through the web's fields, I can see the custom column, and that was copied to the new web. It is only within the content type that the custom column is not showing up. Any ideas why this is happening? Thanks.

    Read the article

  • Workaround for abstract attributes in Java

    - by deamon
    In Scala I would write an abstract class with an abstract attribute path: abstract class Base { val path: String } class Sub extends Base { override val path = "/demo/" } Java doesn't know abstract attributes and I wonder what would be the best way to work around this limitation. My ideas: a) constructor parameter abstract class Base { protected String path; protected Base(String path) { this.path = path; } } class Sub extends Base { public Sub() { super("/demo/"); } } b) abstract method abstract class Base { // could be an interface too abstract String getPath(); } class Sub extends Base { public String getPath() { return "/demo/"; } } Which one do you like better? Other ideas? I tend to use the constructor since the path value should not be computed at runtime.

    Read the article

  • .net Attributes that handle exceptions - usage on a property accessor

    - by Mr AH
    Hi, well I know from my asp.net mvc experience that you can have attributes that handle exceptions (HandleErrorAttribute). As far as I can tell the Controller class has some OnException event which may be integral to this behaviour. However, I want to do something similar in my own code: dream example: public String MyProperty { [ExceptionBehaviour(typeof(FormatException), MyExEnum.ClearValue)] set { _thing.prop = Convert.ToThing(value); } } .... The code above obviously makes very little sense, but is close to the kind of thing I wish to do. I want the attribute on the property set accessor to catch some type of exception and then deal with this in some custom way (or even just swallow it). Any ideas guys?

    Read the article

  • Form is creating already loaded attributes in addition to new attributes, how do I ignore the first?

    - by looloobs
    In my application you: Have an admin user that signs on and that user has a role (separate model), then I use the declarative_authorization plugin to give access to certain areas. That admin user can also register new users in the system, when they do this (using Authlogic) they fill out a nested form that includes that new users' role. So what is happening is the role of the admin user is being loaded by the declarative_authorization and then the nested form using the has_many_nested_attributes is loading that existing role as well as the new role for the new user (users can have many roles). Is there some way I can tell the new User being created to ignore the role assigned to the current_user and only create the role in the form for the new user? I have looked through a lot of different things, but it seems to get more complicated that these are nested attributes. Thanks in advance.

    Read the article

  • Replace an element name while retaining the attributes with jquery

    - by geckomist
    I'm trying to create a jquery setup where all instances of <i> are changed to <em>. It's easy enough to do with: $("i").each(function(){ $(this).replaceWith($('<em>' + this.innerHTML + '</em>')); }); But what I am having trouble figuring out is how to change all the <i> tags but retain each ones individual attributes. So if I have <i style="background-color: #333;" alt="Example" title="Example">Example Text</i> I would like it to change to <em style="background-color: #333;" alt="Example" title="Example">Example Text</em> Thanks for any help!

    Read the article

  • XPath to compare two distinct attributes of two elements

    - by user364902
    Suppose I have this XML: <x> <e s="1" t="A"/> <e s="2" t="A"/> <e s="1" t="B"/> </x> Is there any way to write an xpath to find any nodes named "e" which have the same value of @s as another node but a different value of @t for the same node. The first part is easy: //e[@s = //e/@s] as is the second part: //e[@t != //e[@t]] But I don't see any way to construct an xpath that compares two different attributes for two separate elements "e". Is there a way within the xpath syntax, or is it hopeless?

    Read the article

  • Regex for template tag with attributes

    - by Funkmyer
    Hi, I haven't found my answer after reading through all of these posts, so I'm hoping one of you heavy hitter regex folks can help me out. I'm trying to isolate the tag name and any attributes from the following string format: {TAG:TYPE attr1="foo" attr2="bar" attr3="zing" attr4="zang" attr5="zoom" ...} NOTE: in the above example, TAG will always be the same and TYPE will be one of several preset strings (e.g. share,print,display etc...). TAG and TYPE are uppercased only for the example but will not be case sensitive for real.

    Read the article

  • PHP SimpleXML, how to set attributes ?

    - by Jahmaica
    Hi, if you've got something like, <hello id="1" name="myName1"> <anotherTag title="Hello"> </anotherTag> </hello> <hello id="2" name="myName2"> <anotherTag title="Hi"> </anotherTag> </hello> How to change the attributes of, for example, hello id 2, to name="William" ? Or the title hi to hello ? Thanks a lot for your atention, H'

    Read the article

  • Display a list of all attributes in opencart

    - by Catalin Dragos Vladulescu
    I want to display a list of all attributes that are added into database but every time I try something it doesn't work. I want to show this inside a div from the from the front page. I tried to insert this into featured.tpl: <?php foreach ($attribute_groups as $attribute_group) { echo $attribute_group['name']; print_r($attribute_group); echo '<select name="listaGrupe">'; foreach ($attribute_groups['attribute'] as $attribute) { echo '<option value="'.$attribute.'">'.$attribute.'</option>'; } echo '</select>'; } ?>

    Read the article

  • IDE underlining custom attributes

    - by runrunraygun
    I have a custom attribute... [System.AttributeUsage(System.AttributeTargets.All)] public class Refactor : System.Attribute { private string _message; public Refactor() { _message = string.Empty; } public Refactor(string message) { _message = message; } } Applied to [Refactor("this should be less rubbish")] public virtual void RubbishMethod() { … } Now when someone makes a call to RubbishMethod I'd like the IDE (vs2008) to underline that call in a deep brown colour, similar to if I mark as Obsolete you get a green wave line. Is this possible? I've been racking my brain and hitting the google but I can't find how and where to do this.

    Read the article

  • Magento Replacing super attributes table with dropdown

    - by thrice801
    Hi, I am trying to replace my magento super attributes table with a drop down menu in place of it, Ive got the menu created but I am struggling to get it to actually use the data from the select dropdown. On submit it calls up function productAddToCartForm, which I feel like if I could modify, I could figure it out. But I have no idea where that function is. My php code looks like the following. <?php if (count($_associatedProducts)): ?> <select name="selectedSku"> <?php foreach ($_associatedProducts as $_item): ?> <?php $prodname = $this->htmlEscape($_item->getName()); $prodprice = $this->htmlEscape($_item->getPrice()); $prodcolor = $_item->getFullColor(); $prodsize = $_item->getTopSize(); $prodcombined = $prodname; $prodcombined .= " / "; $prodcombined .= $prodprice; echo "<option "; echo "value ='"; echo $_item->getId(); echo "'>"; echo $prodcombined; echo "</option>"; ?> <?php endforeach; ?> </select> Any help would be much appreciated. Thanks!

    Read the article

  • C++ Virtual Methods for Class-Specific Attributes or External Structure

    - by acanaday
    I have a set of classes which are all derived from a common base class. I want to use these classes polymorphically. The interface defines a set of getter methods whose return values are constant across a given derived class, but vary from one derived class to another. e.g.: enum AVal { A_VAL_ONE, A_VAL_TWO, A_VAL_THREE }; enum BVal { B_VAL_ONE, B_VAL_TWO, B_VAL_THREE }; class Base { //... virtual AVal getAVal() const = 0; virtual BVal getBVal() const = 0; //... }; class One : public Base { //... AVal getAVal() const { return A_VAL_ONE }; BVal getBVal() const { return B_VAL_ONE }; //... }; class Two : public Base { //... AVal getAVal() const { return A_VAL_TWO }; BVal getBVal() const { return B_VAL_TWO }; //... }; etc. Is this a common way of doing things? If performance is an important consideration, would I be better off pulling the attributes out into an external structure, e.g.: struct Vals { AVal a_val; VBal b_val; }; storing a Vals* in each instance, and rewriting Base as follows? class Base { //... public: AVal getAVal() const { return _vals->a_val; }; BVal getBVal() const { return _vals->b_val; }; //... private: Vals* _vals; }; Is the extra dereference essentially the same as the vtable lookup? What is the established idiom for this type of situation? Are both of these solutions dumb? Any insights are greatly appreciated

    Read the article

  • Rails Nested Attributes Doesn't Insert ID Correctly

    - by MunkiPhD
    I'm attempting to edit a model's nested attributes, much as outline here, replicated here: <%= form_for @person do |person_form| %> <%= person_form.text_field :name %> <% for address in @person.addresses %> <%= person_form.fields_for address, :index => address do |address_form|%> <%= address_form.text_field :city %> <% end %> <% end %> <% end %> In my code, I have the following: <%= form_for(@meal) do |f| %> <!-- some other stuff that's irrelevant... --> <% for subitem in @meal.meal_line_items %> <%= f.fields_for subitem, :index => subitem do |line_item_form| %> <%= line_item_form.label :servings %><br/> <%= line_item_form.text_field :servings %><br/> <%= line_item_form.label :food_id %><br/> <%= line_item_form.text_field :food_id %><br/> <% end %> <% end %> <%= f.submit %> <% end %> This works great, except, when I look at the HTML, it's creating the inputs that look like the following, failing to input the correct id and instead placing the memory representation(?) of the model: <input type="text" value="2" size="30" name="meal[meal_line_item][#<MealLineItem:0x00000005c5d618>][servings]" id="meal_meal_line_item_#<MealLineItem:0x00000005c5d618>_servings">

    Read the article

  • Webhosting with custom database choice [closed]

    - by churchill614
    Possible Duplicate: How to find web hosting that meets my requirements? I am trying to find somewhere to host a website which uses OrientDB as its database. My budget doesn't stretch to a dedicated server where I can configure everything as I need it. Rather, I am hoping to find somewhere, ideally UK based, that will allow me to install/install for me OrientDB on their server, that is of the normal shared server variety. Is anybody able to point me in a good direction for this please (whilst UK is preferable it is not essential)?

    Read the article

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