Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 52/433 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • dynamic HREF attribute by XSLT

    - by ofortuna
    Can anyone plese advice how I can have dynamic HREF attribute in the place of http://abc.com by XSLT in following code snippet? <xsl:for-each select="MenuItems/mainmenu"> <a href="http://abc.com"> <span><xsl:value-of select="menuName"/></span> </a> </xsl:for-each> sample xml <MenuItems> <mainmenu> <menuID>1</menuID> <menuName>Home</menuName> <menuLink>http://aaa.com</menuLink> <subMenuList> <menuID>2</menuID> <menuName>Home</menuName> <menuLink>http://a1.com</menuLink> </subMenuList> <subMenuList> <menuID>3</menuID> <menuName>List of RCCs</menuName> <menuLink>http://a2.com</menuLink> </subMenuList> <subMenuList> <menuID>4</menuID> <menuName>Turnover Workout</menuName> <menuLink>http://a3.com</menuLink> </subMenuList> </mainmenu> <MenuItems>

    Read the article

  • Issue with changing an attribute with jquery

    - by rshivers
    Hello, I'm having an issue with changing the attribute for an id and can't seem to figure out what I'm doing wrong. I guess it doesn't help that I'm new to this also. I have a function that tests to make sure that I am pulling the correct id from the row in my form that I have dynamically created. It goes something like this: myFunction() { var id = $(id).attr("id"); alert("This is my id " + id); } This works with no problem and when I click the button assigned to alert me of my id it will give give me the id of the dynamic row in my form. The issue is now when I try to change the id with this: changeId() { var newId = $(id).attr("id", "x"); alert("This is my new id " + newId); } What happens in this case is that it will alert saying "This is my new id [object Object]" instead of giving me the new id. Any suggestions? I'd really appreciate any help with this.

    Read the article

  • MySQL: optimization of table (indexing, foreign key) with no primary keys

    - by Haradzieniec
    Each member has 0 or more orders. Each order contains at least 1 item. memberid - varchar, not integer - that's OK (please do not mention that's not very good, I can't change it). So, thera 3 tables: members, orders and order_items. Orders and order_items are below: CREATE TABLE `orders` ( `orderid` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `memberid` VARCHAR( 20 ), `Time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , `info` VARCHAR( 3200 ) NULL , PRIMARY KEY (orderid) , FOREIGN KEY (memberid) REFERENCES members(memberid) ) ENGINE = InnoDB; CREATE TABLE `order_items` ( `orderid` INT(11) UNSIGNED NOT NULL, `item_number_in_cart` tinyint(1) NOT NULL , --- 5 items in cart= 5 rows `price` DECIMAL (6,2) NOT NULL, FOREIGN KEY (orderid) REFERENCES orders(orderid) ) ENGINE = InnoDB; So, order_items table looks like: orderid - item_number_in_cart - price: ... 1000456 - 1 - 24.99 1000456 - 2 - 39.99 1000456 - 3 - 4.99 1000456 - 4 - 17.97 1000457 - 1 - 20.00 1000458 - 1 - 99.99 1000459 - 1 - 2.99 1000459 - 2 - 69.99 1000460 - 1 - 4.99 ... As you see, order_items table has no primary keys (and I think there is no sense to create an auto_increment id for this table, because once we want to extract data, we always extract it as WHERE orderid='1000456' order by item_number_in_card asc - the whole block, id woudn't be helpful in queries). Once data is inserted into order_items, it's not UPDATEd, just SELECTed. The questions are: I think it's a good idea to put index on item_number_in_cart. Could anybody please confirm that? Is there anything else I have to do with order_items to increase the performance, or that looks pretty good? I could miss something because I'm a newbie. Thank you in advance.

    Read the article

  • Display attribute from XML using PHP

    - by user560411
    Hello. I need to display the id attribute of CD from the following XML file. I display correctly everything except the id. Any help would be appreciate. display code <?php $doc = new DOMDocument(); $doc->load( 'insert.xml' ); $CATEGORIES = $doc->getElementsByTagName( "CD" ); foreach( $CATEGORIES as $CD ) { $TITLES = $CD->getElementsByTagName( "TITLE" ); $TITLE = $TITLES->item(0)->nodeValue; $BANDS= $CD->getElementsByTagName( "BAND" ); $BAND= $BANDS->item(0)->nodeValue; $YEARS = $CD->getElementsByTagName( "YEAR" ); $YEAR = $YEARS->item(0)->nodeValue; echo "<b>$TITLE - $BAND - $YEAR\n</b><br>"; } ?> XML <?xml version="1.0" encoding="utf-8"?> <MY_CD> <CATEGORIES> <CD id="3231"> <TITLE>NEVER MIND THE BOLLOCKS</TITLE> <BAND>SEX PISTOLS</BAND> <YEAR>1977</YEAR> </CD> <CD id="2453"> <TITLE>NEVERMIND</TITLE> <BAND>NIRVANA</BAND> <YEAR>1991</YEAR> </CD> </CATEGORIES> </MY_CD>

    Read the article

  • Laravel4: Checking many-to-many relationship attribute even when it does not exist

    - by Simo A.
    This is my first time with Laravel and also Stackoverflow... I am developing a simple course management system. The main objects are User and Course, with a many-to-many relationship between them. The pivot table has an additional attribute, participant_role, which defines whether the user is a student or an instructor within that particular course. class Course extends Eloquent { public function users() { return $this->belongsToMany('User')->withPivot('participant_role')->withTimestamps(); } } However, there is an additional role, system admin, which can be defined on the User object. And this brings me mucho headache. In my blade view I have the following: @if ($course->pivot->participant_role == 'instructor') { // do something here... } This works fine when the user has been assigned to that particular $course and there is an entry for this user-course combination in the pivot table. However, the problem is the system administrator, who also should be able to access course details. The if-clause above gives Trying to get property of non-object error, apparently because there is no entry in the pivot table for system administrator (as the role is defined within the User object). I could probably solve the problem by using some off-the-shelf bundle for handling role-based permissions. Or I could (but don't want to) do something like this with two internal if-clauses: if (!empty($course->pivot)) { if ($course->pivot->participant_role == 'instructor') { // do something... } } Other options (suggested in partially similar entries in Stackoverflow) would include 1) reading all the pivot table entries to an array, and use in_array to check if a role exists, or even 2) SQL left join to do this on database level. However, ultimately I am looking for a compact one-line solution? Can I do anything similar to this, which unfortunately does not seem to work? if (! empty ($course->pivot->participant_role == 'instructor') ) { // do something... } The shorter the answer, the better :-). Thanks a lot!

    Read the article

  • Exclude notes based on attribute wildcard in XSL node selection

    - by C A
    Using cruisecontrol for continuous integration, I have some annoyances with Weblogic Ant tasks and how they think that server debug information are warnings rather than debug, so are shown in my build report emails. The XML output from cruise is similar to: <cruisecontrol> <build> <target name="compile-xxx"> <task name="xxx" /> </target> <target name="xxx.weblogic"> <task name="wldeploy"> <message priority="warn">Message which isn't really a warning"</message> </task> </target> </build> </cruisecontrol> In the cruisecontrol XSL template the current selection for the task list is: <xsl:variable name="tasklist" select="/cruisecontrol/build//target/task"/> What I would like is something which selects the tasklist in the same way, but doesn't include any target nodes which have the attribute name="*weblogic" where * is a wildcard. I have tried <xsl:variable name="tasklist" select="/cruisecontrol/build//target[@name!='*weblogic']/task"/> but this doesn't seem to have worked. I'm not an expert with XSLT, and just want to get this fixed so I can carry on the real development of the project. Any help is much appreciated.

    Read the article

  • Exclude nodes based on attribute wildcard in XSL node selection

    - by C A
    Using cruisecontrol for continuous integration, I have some annoyances with Weblogic Ant tasks and how they think that server debug information are warnings rather than debug, so are shown in my build report emails. The XML output from cruise is similar to: <cruisecontrol> <build> <target name="compile-xxx"> <task name="xxx" /> </target> <target name="xxx.weblogic"> <task name="wldeploy"> <message priority="warn">Message which isn't really a warning"</message> </task> </target> </build> </cruisecontrol> In the cruisecontrol XSL template the current selection for the task list is: <xsl:variable name="tasklist" select="/cruisecontrol/build//target/task"/> What I would like is something which selects the tasklist in the same way, but doesn't include any target nodes which have the attribute name="*weblogic" where * is a wildcard. I have tried <xsl:variable name="tasklist" select="/cruisecontrol/build//target[@name!='*weblogic']/task"/> but this doesn't seem to have worked. I'm not an expert with XSLT, and just want to get this fixed so I can carry on the real development of the project. Any help is much appreciated.

    Read the article

  • NSPredicate 'OR' filtering based on an NSArray of keys

    - by So Over It
    Consider the following NSArray: NSArray *dataSet = [[NSArray alloc] initWithObjects: [NSDictionary dictionaryWithObjectsAndKeys:@"abc", @"key1", @"def", @"key2", @"hij", @"key3", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"klm", @"key1", @"nop", @"key2", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"qrs", @"key2", @"tuv", @"key3", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"wxy", @"key3", nil], nil]; I am able to filter this array to find dictionary objects that contain the key key1 // Filter our dataSet to only contain dictionary objects with a key of 'key1' NSString *key = @"key1"; NSPredicate *key1Predicate = [NSPredicate predicateWithFormat:@"%@ IN self.@allKeys", key]; NSArray *filteretSet1 = [dataSet filteredArrayUsingPredicate:key1Predicate]; NSLog(@"filteretSet1: %@",filteretSet1); Which appropriately returns: filteretSet1: ( { key1 = abc; key2 = def; key3 = hij; }, { key1 = klm; key2 = nop; } ) Now, I am wanting to filter the dataSet for dictionary objects containing ANY of the keys in an NSArray. For example, using the array: NSArray *keySet = [NSArray arrayWithObjects:@"key1", @"key3", nil]; I want to create a predicate that returns and array of any dictionary objects that contain either 'key1' or 'key3' (ie. in this example all dictionary objects would be returned except for the third object - as it does not contain either 'key1' or 'key3'). Any ideas on how I would achieve this? Would I have to use a compound predicate?

    Read the article

  • C# InternalsVisibleTo() attribute for VBNET 2.0 while testing?

    - by Will Marcouiller
    I'm building an Active Directory wrapper in VBNET 2.0 (can't use later .NET) in which I have the following: IUtilisateur IGroupe IUniteOrganisation These interfaces are implemented in internal classes (Friend in VBNET), so that I want to implement a façade in order to instiate each of the interfaces with their internal classes. This will allow the architecture a better flexibility, etc. Now, I want to test these classes (Utilisateur, Groupe, UniteOrganisation) in a different project within the same solution. However, these classes are internal. I would like to be able to instantiate them without going through my façade, but only for these tests, nothing more. Here's a piece of code to illustrate it: public static class DirectoryFacade { public static IGroupe CreerGroupe() { return new Groupe(); } } // Then in code, I would write something alike: public partial class MainForm : Form { public MainForm() { IGroupe g = DirectoryFacade.CreerGroupe(); // Doing stuff with instance here... } } // My sample interface: public interface IGroupe { string Domaine { get; set; } IList<IUtilisateur> Membres { get; } } internal class Groupe : IGroupe { private IList<IUtilisateur> _membres; internal Groupe() { _membres = new List<IUtilisateur>(); } public string Domaine { get; set; } public IList<IUtilisateur> Membres { get { return _membres; } } } I heard of InternalsVisibleTo() attribute, recently. I was wondering whether it is available in VBNET 2.0/VS2005 so that I could access the assmebly's internal classes for my tests? Otherwise, how could I achieve this?

    Read the article

  • Question about <foreach> task and the failonerror attribute?

    - by Mike M
    Hi guys, I have made a build file for the automated compilation of Oracle Forms files. An excerpt of the code is as follows: <target name="build" description="compiles the source code"> ... <foreach item="File" property="filename" failonerror="false" > <in> <items basedir="${source.directory}\${project.type}\Forms"> <include name="*.fmb" /> </items> </in> <do> <exec program="${forms.path}" workingdir="${source.directory}\${project.type}\Forms" commandline="module=${filename} userid=${username}/${password}@${database} batch=yes module_type=form compile_all=yes window_state=minimize" /> </do> </foreach> ... </target> The build file navigates to the directory containing the forms that the user desires fo compile and attempts to compile each form. The failonerror attribute is set to false so that the build file does not exit if a compilation error occurs. Unfortunately, however, though this prevents the build file from exiting when a compilation error occurs, it also appears to make the build file exit the task. This is a problem because, unless the form that does not compile successfully is the last to be tested (based on the filename of the form in alphanumerical decsending order), there will be one or more forms that the build file does not attempt to compile. So, for example, if the folder containing the forms that are desired to be compiled contains 10 forms and the first form does not compile successfully, the build file will not attempt to compile the remaining 9 forms (ie exit the task). Is there a way to make the build file attempt to compile remaining forms after encountering after failing to compile a form? Thanks in advance!

    Read the article

  • JPA : many-to-many - only one foreign key in the association table

    - by Julien
    Hi, I mapped two classes in a ManyToMany association with these annotations : @Entity @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) public abstract class TechnicalItem extends GenericBusinessObject implements Resumable{ @SequenceGenerator(name="TECHNICAL_ITEM_ID_GEN", sequenceName="TECHNICAL_ITEM_ID_SEQ") @Id @Column(name = "\"ID\"", nullable = false) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TECHNICAL_ITEM_ID_GEN") private int id; @ManyToMany(mappedBy = "referencePerformanceItems", fetch=FetchType.LAZY) private List testingRates; } @Entity @DiscriminatorValue("T") public class TestingRate extends Rate { @ManyToMany(fetch=FetchType.LAZY) @JoinTable(name="ecc.\"TESTING_RATE_TECHNICAL_ITEM\"", joinColumns = {@JoinColumn(name = "\"TESTING_RATE_ID\"")}, inverseJoinColumns = {@JoinColumn(name = "\"TECHNICAL_ITEM_ID\"")}) //@ManyToMany(mappedBy = "testingRates", fetch=FetchType.LAZY) private List referencePerformanceItems; } The sql generated for the association table creation is : create table ecc."TESTING_RATE_TECHNICAL_ITEM" ( "TESTING_RATE_ID" int4 not null, "TECHNICAL_ITEM_ID" int4 not null ); alter table ecc."TESTING_RATE_TECHNICAL_ITEM" add constraint FKC5D64DF6A2FE2698 foreign key ("TESTING_RATE_ID") references ecc."RATE"; There is no mention of the second foreign key "TECHNICAL_ITEM_ID" (the second part of the composite foreign key which should be in the association table). Is it a normal behaviour ? What should I do in the mapping if I want my 2 columns are 2 foreign keys referencing the primary keys of my 2 concerned tables. I use a PostGreSQL database and Hibernate as JPA provider. Thanks, Julien

    Read the article

  • Cascading Deletes in SQL Sever 2008 not working.

    - by Vaccano
    I have the following table setup. Bag | +-> BagID (Guid) +-> BagNumber (Int) BagCommentRelation | +-> BagID (Int) +-> CommentID (Guid) BagComment | +-> CommentID (Guid) +-> Text (varchar(200)) BagCommentRelation has Foreign Keys to Bag and BagComment. So, I turned on cascading deletes for both those Foreign Keys, but when I delete a bag, it does not delete the Comment row. Do need to break out a trigger for this? Or am I missing something? (I am using SQL Server 2008) Note: Posting requested SQL. This is the defintion of the BagCommentRelation table. (I had the type of the bagID wrong (I thought it was a guid but it is an int).) CREATE TABLE [dbo].[Bag_CommentRelation]( [Id] [int] IDENTITY(1,1) NOT NULL, [BagId] [int] NOT NULL, [Sequence] [int] NOT NULL, [CommentId] [int] NOT NULL, CONSTRAINT [PK_Bag_CommentRelation] PRIMARY KEY CLUSTERED ( [BagId] ASC, [Sequence] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Bag_CommentRelation] WITH CHECK ADD CONSTRAINT [FK_Bag_CommentRelation_Bag] FOREIGN KEY([BagId]) REFERENCES [dbo].[Bag] ([Id]) ON DELETE CASCADE GO ALTER TABLE [dbo].[Bag_CommentRelation] CHECK CONSTRAINT [FK_Bag_CommentRelation_Bag] GO ALTER TABLE [dbo].[Bag_CommentRelation] WITH CHECK ADD CONSTRAINT [FK_Bag_CommentRelation_Comment] FOREIGN KEY([CommentId]) REFERENCES [dbo].[Comment] ([CommentId]) ON DELETE CASCADE GO ALTER TABLE [dbo].[Bag_CommentRelation] CHECK CONSTRAINT [FK_Bag_CommentRelation_Comment] GO The row in this table deletes but the row in the comment table does not.

    Read the article

  • SSAS Cube reprocessing fails - then succeeds if I try again

    - by EdgarVerona
    So I'm basically brand new to the concept of BI, and I've inherited an existing ETL process that is a two step process: 1) Loads the data into a database that is only used by the cube processing 2) Starts off the SSAS cube processing against said database It seems pretty well isolated, but occasionally (once a week, sometimes twice) it will fail with the following exception: "Errors in the OLAP storage engine: The attribute key cannot be found" Now the interesting thing is that: 1) The dimension having the issue is not usually the same one (i.e. there's no single dimension that consistently has this failure) 2) The source table, when I inspect it, does actually contain the attribute key that it says could not be found And, most interestingly... 3) If I then immediately reprocess the dimensions and cubes manually through SSMS, they reprocess successfully and without incident. In both the aforementioned job and when I reprocess them through SSMS, I am using "ProcessFull", so it should be reprocessing them completely. Has anyone run into such an issue? I'm scratching my head about it... because if it was a genuine data integrity issue, reprocessing the cube again wouldn't fix it. What on earth could be happening? I've been tasked with finding out why this happens, but I can neither reproduce it consistently nor can I point to a data integrity problem as the root cause. Thanks for any input you can provide!

    Read the article

  • How should I manage my many-to-many relationships?

    - by wes
    Hello all, I have a database containing a couple tables: files and users. This relationship is many-to-many, so I also have a table called users_files_ref which holds foreign keys to both of the above tables. Here's the schema of each table: files - file_id, file_name users - user_id, user_name users_files_ref - user_file_ref_id, user_id, file_id I'm using Codeigniter to build a file host application, and I'm right in the middle of adding the functionality that enables users to upload files. This is where I'm running into my problem. Once I add a file to the files table, I will need that new file's id to update the users_files_ref table. Right now I'm adding the record to the files table, and then I imagined I'd run a query to grab the last file added, so that I can get the ID, and then use that ID to insert the new users_files_ref record. I know this will work on a small scale, but I imagine there is a better way of managing these records, especially in a heavy-traffic scenario. I am new to relational database stuff but have been around PHP for a while, so please bear with me here :-) I have primary and foreign keys set up correctly for the files, users, and users_files_ref tables, I'm just wondering how to manage the adding of file records for this scenario? Thanks for any help provided, it's much appreciated. -Wes

    Read the article

  • MVC 2 - Name Attributes on HTML Input Field when using Parent/Child Entities

    - by Click Ahead
    Hi All, I'm pretty new to MVC 2 using the Entity Framework. I have two tables Company {ID int identity PK,Name nvarchar} and User {ID int identity PK,UserName nvarchar,CompanyID int FK}. A Foreign Key exists between User and Company. I generated my ADO.NET Entity Data Model, a Controller and a view to insert a record. My HTML form has the fields Company and UserName and the idea is when I click save a Company and User is inserted into the database. Sounds straight forward right! My question is as follows: I created a strongly-typed view derived from my 'User' entity. I'm using the the html helper Html.TextBoxFor(model = model.Organisation.Name) but the html name attribute for this input field is 'Organisation.Name'. My problem with this is that the dot throws up all sorts of issues in JQuery, which sees this as a property. If I want to change the name I read that I can use DataAnnotations but because I used the Entity Designer this involves using Buddy Classes. Seems like a bit of overkill just to change the html name attribute on this input field. Am I approaching this the right way or am I missing something here? Thanks for the help !

    Read the article

  • Which Table Should be Master and Child in Database Design

    - by Jason
    I am quickly learning the ins and outs of database design (something that, as of a week ago, was new to me), but I am running across some questions that don't seem immediately obvious, so I was hoping to get some clarification. The question I have right is about foreign keys. As part of my design, I have a Company table. Originally, I had included address information directly within the table, but, as I was hoping to achieve 3NF, I broke out the address information into its own table, Address. In order to maintain data integrity, I created a row in Company called "addressId" as an INT and the Address table has a corresponding addressId as its primary key. What I'm a little bit confused about (or what I want to make sure I'm doing correctly) is determining which table should be the master (referenced) table and which should be the child (referencing) table. When I originally set this up, I made the Address table the master and the Company the child. However, I now believe this is wrong due to the fact that there should be only one address per Company and, if a Company row is deleted, I would want the corresponding Address to be removed as well (CASCADE deletion). I may be approaching this completely wrong, so I would appreciate any good rules of thumb on how to best think about the relationship between tables when using foreign keys. Thanks!

    Read the article

  • The best way to structure this database?

    - by James P
    At the moment I'm doing this: gems(id, name, colour, level, effects, source) id is the primary key and is not auto-increment. A typical row of data would look like this: id => 40153 name => Veiled Ametrine colour => Orange level => 80 effects => +12 sp, +10 hit source => Ametrine (Some of you gamers might see what I'm doing here :) ) But I realise this could be sorted a lot better. I have studied database relationships and secondary keys in my A-Level computing class but never got as far as to set one up properly. I just need help with how this database should be organised, like what tables should have what data with what secondary and foreign keys? I was thinking maybe 3 tables: gem, effects, source. Which then have relationships to each other? Can anyone shed some light on this? Is a complex way like I'm proposing really the way to go or should I just carry on with what I'm doing? Cheers.

    Read the article

  • 'NoneType' object has no attribute 'get' error using SQLAlchemy

    - by Az
    I've been trying to map an object to a database using SQLAlchemy but have run into a snag. Version info if handy: [OS: Mac OSX 10.5.8 | Python: 2.6.4 | SQLAlchemy: 0.5.8] The class I'm going to map: class Student(object): def __init__(self, name, id): self.id = id self.name = name self.preferences = collections.defaultdict(set) self.allocated_project = None self.allocated_rank = 0 def __repr__(self): return str(self) def __str__(self): return "%s %s" %(self.id, self.name) Background: Now, I've got a function that reads in the necessary information from a text database into these objects. The function more or less works and I can easily access the information from the objects. Before the SQLAlchemy code runs, the function will read in the necessary info and store it into the Class. There is a dictionary called students which stores this as such: students = {} students[id] = Student(<all the info from the various "reader" functions>) Afterwards, there is an "allocation" algorithm that will allocate projects to student. It does that well enough. The allocated_project remains as None if a student is unsuccessful in getting a project. SQLAlchemy bit: So after all this happens, I'd like to map my object to a database table. Using the documentation, I've used the following code to only map certain bits. I also begin to create a Session. from sqlalchemy import * from sqlalchemy.orm import * engine = create_engine('sqlite:///:memory:', echo=False) metadata = MetaData() students_table = Table('studs', metadata, Column('id', Integer, primary_key=True), Column('name', String) ) metadata.create_all(engine) mapper(Student, students_table) Session = sessionmaker(bind=engine) sesh = Session() Now after that, I was curious to see if I could print out all the students from my students dictionary. for student in students.itervalues(): print student What do I get but an error: Traceback (most recent call last): File "~/FYP_Tests/FYP_Tests.py", line 140, in <module> print student File "/~FYP_Tests/Parties.py", line 30, in __str__ return "%s %s" %(self.id, self.name) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/attributes.py", line 158, in __get__ return self.impl.get(instance_state(instance), instance_dict(instance)) AttributeError: 'NoneType' object has no attribute 'get' I'm at a loss as to how to resolve this issue, if it is an issue. If more information is required, please ask and I will provide it.

    Read the article

  • IE8 v8 not changing class for a DOM element despite JS function changing the element attribute

    - by Alfabravo
    I have an on-screen keyboard in order to provide a safer input for passwords. The keyboard itself is placed like this: <div class="teclado_grafico" id="teclado_grafico"> <a class="tecla_teclado" onmousedown="teclaAction( this, 'caja_selector'); return false" style="top: 0px; left: 0px;">Q</a> <a class="tecla_teclado" onmousedown="teclaAction( this, 'caja_selector'); return false" style="top: 0px; left: 28px;">W</a> . . . </div> And it has a "Shift button" which fires a JS function with this (I've already tried all that, indeed): if (obj.innerHTML == "Mayus.") { try { MAYUSCULA_ACTIVADO = !MAYUSCULA_ACTIVADO; var tgrafico = document.getElementById("teclado_grafico"); if(MAYUSCULA_ACTIVADO) { // tgrafico.className = "teclado_grafico mayuscula"; // $("#teclado_grafico").removeClass('minuscula').addClass('mayuscula'); // $("#teclado_grafico").attr('class', 'teclado_grafico mayuscula'); // $("#teclado_grafico").attr('className', 'teclado_grafico mayuscula'); tgrafico.setAttribute('className', "teclado_grafico mayuscula") || tgrafico.setAttribute('class', "teclado_grafico mayuscula"); } else { // tgrafico.className = "teclado_grafico minuscula"; // $("#teclado_grafico").removeClass('mayuscula').addClass('minuscula'); // $("#teclado_grafico").attr('class', 'teclado_grafico minuscula'); // $("#teclado_grafico").attr('className', 'teclado_grafico minuscula'); tgrafico.setAttribute('className', "teclado_grafico minuscula") || tgrafico.setAttribute('class', "teclado_grafico minuscula"); } } catch (_E) { //void } return; } The associated CSS is like this: .mayuscula a.tecla_teclado{ text-transform: uppercase; } .minuscula a.tecla_teclado{ text-transform: lowercase; } It works on every single browser I've tried. IE 6, 7; Opera 10; GChrome; FF 3, 3.5 and 3.6; Safari 4,... but in IE8 v8 (strict mode) the class is not changed! I mean, debuggin' with the IE8 tools allows one to see that the attribute className is there and it changes... but the user does not see the letters changing from uppercase to lowercase, to uppercase again. I just don't know how to handle this... I had complains about the client using IE6... now they updated their stuff and this shows up. Any help will be reaaaaly helpful!

    Read the article

  • Rich Tooltip for SelectItem, error when including EL in "for" attribute

    - by pakore
    How to attach a rich:tooltip to the list generated by f:selectItems when using a variable for the attribute for inside the rich:tooltip. This code works fine (the value of #{prefix} is theprefixvalue <ui:composition> <a4j:form id="#{prefix}_form"> <h:selectOneRadio style="text-align:left" id="#{prefix}_rating"> <f:selectItems value="#{test.options}"></f:selectItems> </h:selectOneRadio>&nbsp; <rich:toolTip for="theprefixvalue_form\:theprefixvalue_rating\:0">a</rich:toolTip> </a4j:form> </ui:composition> But this code does not: <ui:composition> <h:outputText value="#{prefix}" /> <a4j:form id="#{prefix}_form"> <h:selectOneRadio style="text-align:left" id="#{prefix}_rating"> <f:selectItems value="#{test.options}"></f:selectItems> </h:selectOneRadio>&nbsp; <rich:toolTip for="#{prefix}_form\:#{prefix}_rating\:0">a</rich:toolTip> </a4j:form> </ui:composition> Throws the following exception: Caused by: java.lang.IllegalArgumentException: theprefixvalue_rating at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:612) at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:1037) at org.richfaces.renderkit.html.ToolTipRenderer.getTargetId(ToolTipRenderer.java:234) at org.richfaces.renderkit.html.ToolTipRenderer.constructJSVariable(ToolTipRenderer.java:251) ... TestBean is session scoped and this is the code for getOptions(); public List<SelectItem> getOptions(){ List<SelectItem> options = new ArrayList<SelectItem>(); options.add(new SelectItem("a","a")); options.add(new SelectItem("b","b")); options.add(new SelectItem("c","c")); return options; } Any ideas? The goal is to have a tooltip when the mouse is over the different options. Thanks in advance.

    Read the article

  • Calculate # of Rowspans and Colspans based on keys in a Multi-Array

    - by sologhost
    Ok, I have these 2 types of layouts, basically, it can be any layout really. I have decided to use tables for this, since using div tags cause undesirable results in some possible layout types. Here are 2 pics that describe the returned results of row and column: This would return the $layout array like so: $layout[0][0] $layout[0][1] $layout[1][1] In this layout type: $layout[1][0] is NOT SET, or doesn't exist. Row 1, Column 0 doesn't exist in here. So how can we use this to help us determine the rowspans...? Ok, this layout type would now return the following: $layout[0][0] $layout[0][1] $layout[1][0] $layout[2][0] $layout[2][1] $layout[3][1] Again, there are some that are NOT SET in here: $layout[1][1] $layout[3][0] Ok, I have an array called $layout that does a foreach on the row and column, but it doesn't grab the rows and columns that are NOT SET. So I created a for loop (with the correct counts of how many rows there are and how many columns there are). Here's what I got so far: // $not_set = array(); for($x = 0; $x < $cols; $x++) { $f = 0; for($p = 0; $p < $rows; $p++) { // $f = count($layout[$p]); if(!isset($layout[$p][$x])) { $f++; // It could be a rowspan or a Colspan... // We need to figure out which 1 it is! /* $not_set[] = array( 'row' => $p, 'column' => $x, ); */ } // if ($rows - count($layout[$p])) } } Ok, the $layout array has 2 keys. The first 1 is [ row ] and the 2nd key is [ column ]. Now looping through them all and determining whether it's NOT SET, tells me that either a rowspan or a colspan needs to be put into something somewhere. I'm completely lost here. Basically, I would like to have an array returned here, something like this: $spans['row'][ row # ][ column # ] = Number of rowspans for that <td> element. $spans['column'][ row # ][ column # ] = Number of colspans for that <td> element. It's either going to need a colspan or a rowspan, it will definitely never need both for the same element. Am I going about this whole thing the wrong way? Any help at all would be greatly appreciated!! I've been driving myself crazy with this for days! Pllleaase...

    Read the article

  • Applying SoapIgnore attribute doesn't take any effect to serialization result

    - by the_V
    I'm trying to figure out .NET serialization stuff and experiencing a problem. I've made a simple program to test it and got stuck with using attributes. Here's the code: [Serializable] public class SampleClass { [SoapIgnore] public Guid InstanceId { get; set; } } class Program { static void Main() { SampleClass cl = new SampleClass { InstanceId = Guid.NewGuid() }; SoapFormatter fm = new SoapFormatter(); using (FileStream stream = new FileStream(string.Format("C:\\Temp\\{0}.inv", Guid.NewGuid().ToString().Replace("-", "")), FileMode.Create)) { fm.Serialize(stream, cl); } } } The problem is that InstanceId is not ignored while serialization is done. What I get in .inv file is something like this: <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <a1:SampleClass id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TestConsoleApp/TestConsoleApp%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull"> <_x003C_InstanceId_x003E_k__BackingField> <_a>769807168</_a> <_b>27055</_b> <_c>16408</_c> <_d>141</_d> <_e>210</_e> <_f>171</_f> <_g>30</_g> <_h>252</_h> <_i>196</_i> <_j>246</_j> <_k>159</_k> </_x003C_InstanceId_x003E_k__BackingField> </a1:SampleClass> </SOAP-ENV:Body> </SOAP-ENV:Envelope> As I can understand from documentation InstanceId property is not supposed to be serialized since SoapIgnore attribute is applied to it. Am I missing something?

    Read the article

  • Unrequired property keeps getting data-val-required attribute

    - by frennky
    This is the model with it's validation: [MetadataType(typeof(TagValidation))] public partial class Tag { } public class TagValidation { [Editable(false)] [HiddenInput(DisplayValue = false)] public int TagId { get; set; } [Required] [StringLength(20)] [DataType(DataType.Text)] public string Name { get; set; } //... } Here is the view: <h2>Create</h2> <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> @using (Html.BeginForm()) { @Html.ValidationSummary(true) <fieldset> <legend>Tag</legend> <div>@Html.EditorForModel()</div> <p> <input type="submit" value="Create" /> </p> </fieldset> } <div> @Html.ActionLink("Back to List", "Index") </div> And here is what get's renderd: <form action="/Tag/Create" method="post"> <fieldset> <legend>Tag</legend> <div><input data-val="true" data-val-number="The field TagId must be a number." data-val-required="The TagId field is required." id="TagId" name="TagId" type="hidden" value="" /> <div class="editor-label"><label for="Name">Name</label></div> <div class="editor-field"><input class="text-box single-line" data-val="true" data-val-length="The field Name must be a string with a maximum length of 20." data-val-length-max="20" data-val-required="The Name field is required." id="Name" name="Name" type="text" value="" /> <span class="field-validation-valid" data-valmsg-for="Name" data-valmsg-replace="true"></span></div> ... </fieldset> </form> The problem is that TagId validation gets generated althoug thare is no Required attribute set on TagId property. Because of that I can't even pass the client-side validation in order to create new Tag in db. What am I missing?

    Read the article

  • jQuery: modify href attribute for first level list only

    - by bloggerious
    I'm a noob in jQuery and have stuck at this. I have the following HTML code output from a PHP page: <ul class="cats"> <li><span><a href="cant_post_link_yet1">Lifestyle</a></span></li> <li><span><a href="cant_post_link_yet2">Entertainment</a></span></li> <li class="has_child"> <span><a href="cant_post_link_yet3">Technology</a></span> <ul class="subcats"> <li><span><a href="cant_post_link_yet4">Gadgets</a></span></li> <li><span><a href="cant_post_link_yet5">Hardware</a></span></li> </ul> </li> <li><span><a href="cant_post_link_yetsports">Sports</a></span></li> <li class="has_child"> <span><a href="cant_post_link_yet6">Design</a></span> <ul class="subcats"> <li class="has_child"> <span><a href="cant_post_link_yet7">Web Design</a></span> <ul class="subcat"> <li><span><a href="cant_post_link_yet8">Adobe Photoshop</a></span></li> </ul> </li> <li><span><a href="cant_post_link_yet9">Graphics and Print</a></span></li> </ul> </li> What's the correct jQuery code so that I can modify the href attribute for the first-level list only? Basically, I want to change the href of Technology and Design to be "#" but will not change the href of Web Design which is already on second-level list. More Info: In the code above, if list has subcategories, then it has the class has_child, whether it's on first-level or not. So I want only the first-level list which has class has_child to be modified the href to "#" I can't alter output anymore because it's in the PHP code. Any help is greatly appreciated.

    Read the article

  • Setting up a "to-many" relationship value dependency for a transient Core Data attribute

    - by Greg Combs
    I've got a relatively complicated Core Data relationship structure and I'm trying to figure out how to set up value dependencies (or observations) across various to-many relationships. Let me start out with some basic info. I've got a classroom with students, assignments, and grades (students X assignments). For simplicity's sake, we don't really have to focus much on the assignments yet. StudentObj <--->> ScoreObj <<---> AssignmentObj Each ScoreObj has a to-one relation with the StudentObj and the AssignmentObj. ScoreObj has real attributes for the numerical grade, the turnInDate, and notes. AssignmentObj.scores is the set of Score objects for that assignment (N = all students). AssignmentObj has real attributes for name, dueDate, curveFunction, gradeWeight, and maxPoints. StudentObj.scores is the set of Score objects for that student (N = all assignments). StudentObj also has real attributes like name, studentID, email, etc. StudentObj has a transient (calculated, not stored) attribute called gradeTotal. This last item, gradeTotal, is the real pickle. it calculates the student's overall semester grade using the scores (ScoreObj) from all their assignments, their associated assignment gradeWeights, curves, and maxPoints, and various other things. This gradeTotal value is displayed in a table column, along with all the students and their individual assignment grades. Determining the value of gradeTotal is a relatively expensive operation, particularly with a large class, therefore I want to run it only when necessary. For simplicity's sake, I'm not storing that gradeTotal value in the core data model. I don't mind caching it somewhere, but I'm having a bitch of a time determining where and how to best update that cache. I need to run that calculation for each student whenever any value changes that affects their gradeTotal. If this were a simple to-one relationship, I know I could use something like keyPathsForValuesAffectingGradeTotal ... but it's more like a many-to-one-to-many relationship. Does anyone know of an elegant (and KVC correct) solution? I guess I could tear through all those score and assignment objects and tell them to register their students as observers. But this seems like a blunt force approach.

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >