Search Results

Search found 4118 results on 165 pages for 'attributes'.

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

  • MooTools Event Delegation using HTML5 data attributes.

    - by Anurag
    Is it possible to have event delegation using the HTML5 data attributes in MooTools? The HTML structure I have is: ?<div id="parent"> <div>not selectable</div> <div data-selectable="true">selectable</div> <div>not selectable either.</div> <div data-selectable="true">also selectable</div> </div>???????????????????????????????????????????????????????????????????????? And I want to setup <div id="parent"> to listen to all clicks only on child elements that have the data-selected attribute. Please let me know if I'm doing something wrong: The events are being setup as: $("parent").addEvent("click:relay([data-selectable])", function(event, el) { alert(this.get('text')); }); but the click callback is fired on clicking all div's, not just the ones with a data-selectable attribute defined. You can see this example on http://jsfiddle.net/NUGD4/ A workaround is to adding this as a CSS class, which works with delegation but I would prefer to be able to use data-attributes as it's used throughout the application.

    Read the article

  • Access and modify attributes/objects which are not part of the form backing bean

    - by spa
    I use Spring MVC (via Spring Roo) to build a small web application for administering persons. In the page for creating a person the bean Person is used as form backing object (key "person" in the model map). <form:form action="${form_url}" method="POST" modelAttribute="person"> I would like to add some attributes to the model map which can be altered by the user in the creation form. Basically, I try to add a Boolean, so that I can control which page is displayed next after the user presses the submit button. I try to modify the Boolean (key "myBoolean" in the model map) using a simple checkbox: <form:checkbox id="_myboolean_id" path="myBoolean"/> However, as I am new to Spring MVC I have some difficulties here. The Boolean object is not an attribute of the form backing object. So if I try to access it the following exception is thrown (of course): Invalid property 'myBoolean' of bean class [de.cm.model.Person]: Bean property 'myBoolean' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? Is there are way to access a value of the model map directly? The only solution I can imagine right now is a kind of wrapper object around the class Person and my additional attributes which is used as a new form backing object. However, this is more work for a IMHO simple task. Do you have a better solution?

    Read the article

  • Django internationalization for admin pages - translate model name and attributes

    - by geekQ
    Django's internationalization is very nice (gettext based, LocaleMiddleware), but what is the proper way to translate the model name and the attributes for admin pages? I did not find anything about this in the documentation: http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/ http://www.djangobook.com/en/2.0/chapter19/ I would like to have "???????? ????? ??? ?????????" instead of "???????? order ??? ?????????". Note, the 'order' is not translated. First, I defined a model, activated USE_I18N = True in settings.py, run django-admin makemessages -l ru. No entries are created by default for model names and attributes. Grepping in the Django source code I found: $ ack "Select %s to change" contrib/admin/views/main.py 70: self.title = (self.is_popup and ugettext('Select %s') % force_unicode(self.opts.verbose_name) or ugettext('Select %s to change') % force_unicode(self.opts.verbose_name)) So the verbose_name meta property seems to play some role here. Tried to use it: class Order(models.Model): subject = models.CharField(max_length=150) description = models.TextField() class Meta: verbose_name = _('order') Now the updated po file contains msgid 'order' that can be translated. So I put the translation in. Unfortunately running the admin pages show the same mix of "???????? order ??? ?????????". I'm currently using Django 1.1.1. Could somebody point me to the relevant documentation? Because google can not. ;-) In the mean time I'll dig deeper into the django source code...

    Read the article

  • Data Modeling of Entity with Attributes

    - by StackOverflowNewbie
    I'm storing some very basic information "data sources" coming into my application. These data sources can be in the form of a document (e.g. PDF, etc.), audio (e.g. MP3, etc.) or video (e.g. AVI, etc.). Say, for example, I am only interested in the filename of the data source. Thus, I have the following table: DataSource Id (PK) Filename For each data source, I also need to store some of its attributes. Example for a PDF would be "numbe of pages." Example for audio would be "bit rate." Example for video would be "duration." Each DataSource will have different requirements for the attributes that need to be stored. So, I have modeled "data source attribute" this way: DataSourceAttribute Id (PK) DataSourceId (FK) Name Value Thus, I would have records like these: DataSource->Id = 1 DataSource->Filename = 'mydoc.pdf' DataSource->Id = 2 DataSource->Filename = 'mysong.mp3' DataSource->Id = 3 DataSource->Filename = 'myvideo.avi' DataSourceAttribute->Id = 1 DataSourceAttribute->DataSourceId = 1 DataSourceAttribute->Name = 'TotalPages' DataSourceAttribute->Value = '10' DataSourceAttribute->Id = 2 DataSourceAttribute->DataSourceId = 2 DataSourceAttribute->Name = 'BitRate' DataSourceAttribute->Value '16' DataSourceAttribute->Id = 3 DataSourceAttribute->DataSourceId = 3 DataSourceAttribute->Name = 'Duration' DataSourceAttribute->Value = '1:32' My problem is that this doesn't seem to scale. For example, say I need to query for all the PDF documents along with thier total number of pages: Filename, TotalPages 'mydoc.pdf', '10' 'myotherdoc.pdf', '23' ... The JOINs needed to produce the above result is just too costly. How should I address this problem?

    Read the article

  • Read attributes of MSBuild custom tasks via events in the Logger

    - by gt
    I am trying to write a MSBuild logger module which logs information when receiving TaskStarted events about the Task and its parameters. The build is run with the command: MSBuild.exe /logger:MyLogger.dll build.xml Within the build.xml is a sequence of tasks, most of which have been custom written to compile a (C++ or C#) solution, and are accessed with the following custom Task: <DoCompile Desc="Building MyProject 1" Param1="$(Param1Value)" /> <DoCompile Desc="Building MyProject 2" Param1="$(Param1Value)" /> <!-- etc --> The custom build task DoCompile is defined as: public class DoCompile : Microsoft.Build.Utilities.Task { [Required] public string Description { set { _description = value; } } // ... more code here ... } Whilst the build is running, as each task starts, the logger module receives IEventSource.TaskStarted events, subscribed to as follows: public class MyLogger : Microsoft.Build.Utilities.Logger { public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource) { eventSource.TaskStarted += taskStarted; } private void taskStarted(object sender, Microsoft.Build.Framework.TaskStartedEventArgs e) { // write e.TaskName, attributes and e.Timestamp to log file } } The problem I have is that in the taskStarted() method above, I want to be able to access the attributes of the task for which the event was fired. I only have access to the logger code and cannot change either the build.xml or the custom build tasks. Can anyone suggest a way I can do this?

    Read the article

  • How to not use JavaScript with in the elements events attributes but still load via AJAX

    - by thecoshman
    I am currently loading HTMl content via AJAX. I have code for things on different elements onclick attributes (and other event attributes). It does work, but I am starting to find that the code is getting rather large, and hard to read. I have also read that it is considered bad practice to have the event code 'inline' like this and that I should really do by element.onclick = foobar and have foobar defined somewhere else. I understand how with a static page it is fairly easy to do this, just have a script tag at the bottom of the page and once the page is loaded have it executed. This can then attach any and all events as you need them. But how can I get this sort of affect when loading content via AJAX. There is also the slight case that the content loaded can very depending on what is in the database, some times certain sections of HTML, such as tables of results, will not even be displayed there will be something else entirely. I can post some samples of code if any body needs them, but I have no idea what sort of things would help people with this one. I will point out, that I am using Jquery already so if it has some helpful little functions that would be rather sweet¬

    Read the article

  • Matching on search attributes selected by customer on front end

    - by CodeNinja1974
    I have a method in a class that allows me to return results based on a certain set of Customer specified criteria. The method matches what the Customer specifies on the front end with each item in a collection that comes from the database. In cases where the customer does not specify any of the attributes, the ID of the attibute is passed into the method being equal to 0 (The database has an identity on all tables that is seeded at 1 and is incremental). In this case that attribute should be ignored, for example if the Customer does not specify the Location then customerSearchCriteria.LocationID = 0 coming into the method. The matching would then match on the other attributes and return all Locations matching the other attibutes, example below: public IEnumerable<Pet> FindPetsMatchingCustomerCriteria(CustomerPetSearchCriteria customerSearchCriteria) { if(customerSearchCriteria.LocationID == 0) { return repository.GetAllPetsLinkedCriteria() .Where(x => x.TypeID == customerSearchCriteria.TypeID && x.FeedingMethodID == customerSearchCriteria.FeedingMethodID && x.FlyAblityID == customerSearchCriteria.FlyAblityID ) .Select(y => y.Pet); } } The code for when all criteria is specified is shown below: private PetsRepository repository = new PetsRepository(); public IEnumerable<Pet> FindPetsMatchingCustomerCriteria(CustomerPetSearchCriteria customerSearchCriteria) { return repository.GetAllPetsLinkedCriteria() .Where(x => x.TypeID == customerSearchCriteria.TypeID && x.FeedingMethodID == customerSearchCriteria.FeedingMethodID && x.FlyAblityID == customerSearchCriteria.FlyAblityID && x.LocationID == customerSearchCriteria.LocationID ) .Select(y => y.Pet); } I want to avoid having a whole set of if and else statements to cater for each time the Customer does not explicitly select an attribute of the results they are looking for. What is the most succint and efficient way in which I could achieve this?

    Read the article

  • Using SimpleDB (with SimpleSavant) with POCO / existing entities, not attributes on my classes

    - by alex
    I'm trying to use Simple Savant within my application, to use SimpleDB I currently have (for example) public class Person { public Guid Id { get; set; } public string Name { get; set; } public string Description { get; set; } public DateTime DateOfBirth { get; set; } } To use this with Simple Savant, i'd have to put attributes above the class declaration, and property - [DomainName("Person")] above the class, and [ItemName] above the Id property. I have all my entities in a seperate assembly. I also have my Data access classes an a seperate assembly, and a class factory selects, based on config, the IRepository (in this case, IRepository I want to be able to use my existing simple class - without having attributes on the properties etc.. In case I switch out of simple db, to something else - then I only need to create a different implementation of IRepository. Should I create a "DTO" type class to map the two together? Is there a better way?

    Read the article

  • xpath php attributes not working?

    - by Jared
    Getting this error Call to a member function attributes() on a non-object I have found multiple answers to this on SO, but none of them seem to solve my problem? Here is the XML: <Routes> <Route type="source" name="incoming"> </Route> <Routes> Here is the PHP: $doc = new SimpleXMLElement('routingConfig.xml', null, true); class traverseXML { function getData() { global $doc; $routeCount = count($doc -> xpath("Route")); //this value returns correctly $routeArr = array(); for ($i = 1; $i <= $routeCount; $i++) { $name = $doc -> Route[$i] -> attributes() -> name; array_push($routeArr, $name); } return $routeArr; } } $traverseXML = new traverseXML; var_dump($traverseXML -> getData()); I understand what the error means, but how is it a non-object? How do I return the name attribute of Routes/Route[1] ?

    Read the article

  • Setting CSS attributes on Change using jQuery

    - by Nick B
    I want to change css visibility and display attributes using jQuery on click when the state of another div's visibility attribute changes. (Many apologies for the obfuscated markup, but needing to manipulate someone else's construction): There are four instances of [data-label="Checkbox"] [data-label="Checked"] in this page. I want to set [data-label="trash"] and [data-label="Sort Options"] to visibility: visible; display: [empty value] when any of the [data-label="Checkbox"] [data-label="Checked"]'s attributes changes to 'visibility', 'visible'. Else, if none of [data-label="Checkbox"] [data-label="Checked"]'s have the attribute 'visibility', 'visible', I want to set [data-label="trash"] and [data-label="Sort Options"] back to their initial states: display: none; visibility: hidden;. Here's the markup: <div data-label="Sort Options" style="display: none; visibility: hidden;"> <div data-label="trash" style="display: none; visibility: hidden;"></div> </div> <div data-label="Checkbox"> <div data-label="Unchecked"></div> <div data-label="Checked" style="display: none; visibility: hidden;"></div> </div> Here is what I have tried unsuccessfully: $('[data-label="Checkbox"]').click(function() { if ('[data-label="Checkbox"] [data-label="Checked"]').css('visibility', 'visible') { $('[data-label="trash"], [data-label="Sort Options"]').css({'display': '', 'visibility': 'visible'}); } else { $('[data-label="trash"], [data-label="Sort Options"]').css({'display': 'none', 'visibility': 'hidden'}); } }); Any help would be greatly appreciated! Thanks

    Read the article

  • How to get attributes from both relative and absolute positioning

    - by user3677286
    I have a footer that i want to attach to the bottom of the page using bottom:0px. However, I also want to center it by using margin-left:auto; and margin-right:auto;. Effectively, this will stick the footer to the bottom of the page while keeping it centered vertically. Unfortunately, these cannot be used together as bottom:0px requires position:relative while margin-left:auto and margin-right:auto require position:absolute. How can I get both of these attributes onto the same div without creating a container? If not possible, what is a clean way of getting both these attributes? ALSO: I do NOT want to have a fixed position. footer.css: .footer { /*background-color:blue;*/ min-height:10px; width:940px; margin-top:5px; margin-left:auto; /* WILL ONLY WORK IF POSITION IS RELATIVE */ margin-right:auto; padding:5px; display:block; border-top: 3px solid #CCCCCC; text-align: center; font-family:arial; color:gray; position: relative; bottom:0px; /* WILL ONLY WORK IF POSITION IS ABSOLUTE */ } Thanks.

    Read the article

  • Pass/Access Object Attributes to/from another Class

    - by Namuna
    Issue: Unable to access parent object attributes Verification.pm: (Parent class) package Verification; use Verification::Proid; sub Proid { my $self = shift; print Dumper($self); my $result = Verification::Proid->validate($self); return $result; } Dumper result $VAR1 = bless( { 'event_name' => 'validate', 'Verification_Type' => 'Proid', 'Verification_Value' => 'ecmetric', 'xml_request' => bless( do{\(my $o = 148410616)}, 'XML::LibXML::Document' ), 'Verification_Options' => [ { '2' => 'UNIX' } ], 'Verification_ID' => '3' }, 'Verification' ); Proid.pm: (Child class) package Verification::Proid; our @ISA = qw(Verification); sub validate { my $self = shift; print Dumper($self); my $result; foreach my $validation_type ( @$self->{Verification_Options} ) { do stuff... } } Dumper result $VAR1 = 'Verification::Proid'; What am I doing wrong that the child class isn't properly getting all the attributes from the object passed to it? Thank you!

    Read the article

  • Export Core Data Entity as text files in Cocoa

    - by happyCoding25
    Hello, I have an entity in core data that has 2 Attributes. One that is a string called "name", and another one that is a string called "message". I need a method to create text files for all the attributes that the user has added. I wan't the files names to be the name attribute and the contents to be the message attribute. If anyone knows how to do this any help would be great. Thanks for any help

    Read the article

  • Localization of attribute values in .NET

    - by Alex Angas
    How can I localize/internationalize attribute values in .NET? My specific example is for ASP.NET web parts such as WebDisplayName, WebDescription, etc. where I inherit from the base class that uses these attributes. Also, is there any difference to doing this with attributes declared in my own classes? Thanks!

    Read the article

  • How to Create A Document Type Definition

    - by DaveDev
    Hi Guys I've been creating a lot of my own custom attributes in my XHTML documents lately, and am aware that because they are custom attributes, they won't validate against the W3C standard. Isn't it true that I can specify my own DTD to make it validate? If so, can anyone tell me what's involved in doing this in an ASP.NET MVC app? Thanks Dave

    Read the article

  • XSL How to copy identical + add copy with attributes changes

    - by Alex
    Hello I need to copy a node and its sub-nodes: first: one identical copy followed by a modified copy with some attributes values changed Here is the extract to change: <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" BasicRuntimeChecks="3" RuntimeLibrary="1" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="4" SuppressStartupBanner="TRUE" DebugInformationFormat="4" CompileAs="0"/> </Configuration> In the second copy I need to change all "Debug" to "Release" and some attribute values also. Thanks

    Read the article

  • Nominal Attributes in LibSVM

    - by Chris S
    When creating a libsvm training file, how do you differentiate between a nominal attribute verses a numeric attribute? I'm trying to encode certain nominal attributes as integers, but I want to ensure libsvm doesn't misinterpret them as numeric values. Unfortunately, libsvm's site seems to have very little documentation. Pentaho's docs seem to imply libsvm makes this distinction, but I'm still not clear how it's made.

    Read the article

  • NSFetchRequest returns correct number of objects, but each object contains nil attributes

    - by BU
    Hi, I can't figure out why this is happening. I can add to the context. But when I retrieve the objects, it returns the correct number of objects but the attributes of the objects are null. I am adding 3 instances with this code: +(BOOL)addStoreWithID:(NSNumber *)ID Latitude:(NSNumber *)latitude Longitude:(NSNumber *)longitude Name:(NSString *)name { Stores *store = (Stores *)[NSEntityDescription insertNewObjectForEntityForName:@"Stores" inManagedObjectContext:[[SharedResources instance] managedObjectContext]]; store.ID = ID; store.Latitude = latitude; store.Longitude = longitude; store.Name = name; NSError *error; if(![[[SharedResources instance] managedObjectContext] save:&error]) { //Handle the error return NO; } return YES; } I get the result: 2010-03-07 19:19:37.060 GamePouch_iPhone[11337:207] Store name is Starbucks (gdb) continue 2010-03-07 19:19:37.933 GamePouch_iPhone[11337:207] Store name is Dunkin Donuts (gdb) continue 2010-03-07 19:19:38.717 GamePouch_iPhone[11337:207] Store name is Krispy Kreme I have confirmed that this code is visited three times and none of the attributes are nil. Then when I try to retrieve it, I use the following code: +(NSMutableArray *)fetchAllObjects { NSFetchRequest *request; request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Stores" inManagedObjectContext:[[SharedResources instance] managedObjectContext]]; [request setEntity:entity]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"ID" ascending:YES]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; NSError *error; NSMutableArray *array = [[[SharedResources instance] managedObjectContext] executeFetchRequest:request error:&error]; [request release]; [sortDescriptor release]; [sortDescriptors release]; for(int i=0;i<3;i++) { Stores *tempStore = (Stores *)[array objectAtIndex:i]; NSLog(@"store name is %@",[tempStore Name]); } return array; } I get the result: 2010-03-07 19:21:00.504 GamePouch_iPhone[11337:207] store name is (null) (gdb) continue 2010-03-07 19:21:01.541 GamePouch_iPhone[11337:207] store name is (null) (gdb) continue 2010-03-07 19:21:02.503 GamePouch_iPhone[11337:207] store name is (null) Thanks a lot for reading. Any help would be much appreciated. Thanks Bakhtiyar uddin

    Read the article

  • How to select all the attributes that contain certain String in an XML Document using LINQ

    - by jaircazarin
    Similar to XPath: How to match attributes that contain a certain string but without using XPath. Is it possible? <c BarFoo="val1"> <d Foo="val2" someAttribute=""> <e FooBar="val3" /> </d> </c> Basically I want to select all the attribute values in the document that their attribute name contains "Foo", so it should return the values of "BarFoo", "FooBar", "Foo" (va1, val2, val3)

    Read the article

  • How to show title attributes onfocus using jquery?

    - by jitendra
    By default in all browser title attributes only shows on mouse over. I want to show on keyboard focus also. I know this is not possible through only HTML and CSS. JavaScript will be need. so i jquery in almost all projects. so i need a jquery solution to show title on onfocus. <a title="this is title" href="#">Websites</a>

    Read the article

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