Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 31/584 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • Passing session data to ModelForm inside of ModelAdmin

    - by theactiveactor
    I'm trying to initialize the form attribute for MyModelAdmin class inside an instance method, as follows: class MyModelAdmin(admin.ModelAdmin): def queryset(self, request): MyModelAdmin.form = MyModelForm(request.user) My goal is to customize the editing form of MyModelForm based on the current session. When I try this however, I keep getting an error (shown below). Is this the proper place to pass session data to ModelForm? If so, then what may be causing this error? TypeError at ... Exception Type: TypeError Exception Value: issubclass() arg 1 must be a class Exception Location: /usr/lib/pymodules/python2.6/django/forms/models.py in new, line 185

    Read the article

  • Using Session Variables inside an ajax document

    - by Pete Herbert Penito
    Hi, For some reason I've having problems reading this session variable within an ajax document, I've got this inside online.php: ` session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; } ` For some Reason this is not setting username even when the session var is being used on the host page, i call on the php file every second using this ` $(document).ready(function() { var refreshId = setInterval(function() { $('#timeval').load('online.php'); }, 1000); $("#stop").click(function() { clearInterval(refreshId); }); }); ` Am I doing something wrong, or is this not even possible?? Any advice would really help thanks alot!

    Read the article

  • read java.security.key stored as object inside a file which is in jar

    - by Tal
    I saved a PublicKey instance in a file using ObjectOutputStream. This file is then stored inside a jar file which is then loaded by JBoss. I'm trying to read this file but it throws me an exception telling that it's not serializable. Here is the code : InputStream input = KeyLoader.class.getClassLoader().getResourceAsStream(resource); ObjectInputStream objectInputStream = new ObjectInputStream(input); Object obj = objectInputStream.readObject(); Key output = (Key) obj; objectInputStream.close(); return output; which throws me this exception An exception occurred: java.io.NotSerializableException

    Read the article

  • ASP.net MVC: Getting a Partial View's HTML from inside of the controller

    - by Harry
    I have developed a simple mechanism for my mvc website to pull in html via jquery which then populates a specified div. All is well and it looks cool. My problem is that i'm now creating html markup inside of my controller (Which is very easy to do in VB.net btw) I'd rather not mix up the sepparation of concerns. Is it possible to use a custom 'MVC View User Control' to suit this need? Can I create an instance of a control, pass in the model data and render to html? It would then be a simple matter of rendering and passing back to the calling browser.

    Read the article

  • Create dummy index.html inside a new MKDR directory

    - by jonnypixel
    Hi, I know this may be a silly question but i cant seem to find just a simple answer. I have a php script that makes a directory for me when the user starts a new entry. That directory holds photos for their gallery. What i would like to do is also create One index.html file inside that new directory with a few lines of html code in it. How do i do this? Im guessing that the file would be made like so: mkdir('users/'.$id.'/index.html',0755); But how do i add the html into that index.html file? Or do i have one file on the server and copy it over into there during the MKDIR process? Anyways a really simple answer would be best as i am very slow in this learning thing. Thank you John

    Read the article

  • Setting ID to a control inside repeater itemtemplate

    - by toraan
    Inside repeater's itemtemplate I have a Panel server control. I need to assign special Id for it, because I need to work with some javascript functions that use this Id. In repeater ItemDataBound event I have this: pnlButtonsPanel.ID = pnlButtonsPanel.ID + DataBinder.Eval(e.Item.DataItem, "ID"); But this solution is not good because after a postback the page is re -rendered and I lose the new ID. (And I don't want to rebind repeater after every postback) I tried to set the ID on aspx page like that: <asp:Panel id='<%# Eval("ID") %>' and some other variations but always get compile errors.

    Read the article

  • Flickering when repainting a JPanel inside a JScrollPAne

    - by pR0Ps
    I'm having a problem with repainting a JPanel inside a JScrollPane. Basically, I'm just trying to 'wrap' my existing EditPanel (it originally extended JPanel) into a JScrollPane. It seems that the JPanel updates too often (mass flickering). How would I stop this from happening? I tried using the setIgnoreRepaint() but it didn't seem to do anything. Will this current implementation work or would I need to create another inner class to fine-tune the JPanel I'm using to display graphics? Skeleton code: public class MyProgram extends JFrame{ public MyProgram(){ super(); add(new EditPanel()); pack(); } private class EditPanel extends JScrollPane{ private JPanel graphicsPanel; public EditPanel(){ graphicsPanel = new JPanel(); } public void paintComponent(Graphics g){ graphicsPanel.revalidate(); //update the scrollpane to current panel size repaint(); Graphics g2 = graphicsPanel.getGraphics(); g2.drawImage(imageToDraw, 0, 0, null); } } }

    Read the article

  • Using a set of numbers inside a database without creating a temporary table

    - by Zizzencs
    I have a set of numbers and a table in a database with the id (primary key) and text (not null) columns. I would like to create a query that returns all the numbers in the set and the associated text from the table. Unfortunately not all numbers exist in the database's id column, so this won't work: select id, text from table where id in (<set of numbers>) For the non-existing ids the best would be to return null as the text from the query. Is there a way to produce the desired output without first creating a temporary table from the set inside the database? The database engine in use is a Microsoft SQL Server 2008 SP1 but I'd be interested in any solution with any database engine.

    Read the article

  • ASP.NET 4.0 Route expression builder inside Listview control

    - by Carlos Lone
    One of the features of ASP.NET 4.0 is Route Expression builder which allows you to set up hyperlinks like this: <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl:RouteName=productos,categoria=Cereales,id=2 %>" >Productos</asp:HyperLink> Now I'm wondering if I can use this sort of syntax inside a ListView Control, I know is possible, but the tricky thing is that I want to genereate de route key value dynamically. So instead to write id=2 I would like to write id=<%# Eval("CategoryID") % . Can I do that?, if so, how should I write it. Thanks for your help!

    Read the article

  • Need help getting DIV inside DIV to stretch to width of contents in Firefox

    - by bj.
    I am using a layout similar to the one from Dynamic Drive here: http://www.dynamicdrive.com/style/layouts/item/css-right-frame-layout/ The main content area (white) has overflow set to auto. I have given the innerTube inside this main content area a border. However if the contents within this innerTube are greater than the width of the main content area, a horizontal scroll bar will appear as expected, but in Firefox these contents will 'overlap' the border and go off screen (can be retrieved by scrolling horizontally). In other words, the right hand border remains in place, and the content just goes over the op of it, and disappears behind the right hand column. In IE it behaves exactly as I want - the content pushes the border off screen to be visible only once you scroll over there. I guess the easiest thing is to paste the source code here. If you copy it into a blank file you'll see what I mean. I've just used one really long word to replicate what happens if a wide image is there instead. Thanks in advance to anyone who can help me out. <!--Force IE6 into quirks mode with this comment tag--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> body{ margin: 0; padding: 0; border: 0; overflow: hidden; height: 100%; max-height: 100%; } #framecontent{ position: absolute; top: 0; bottom: 0; right: 0; width: 200px; /*Width of frame div*/ height: 100%; overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/ background: #cccccc; color: white; } #maincontent{ position: fixed; top: 0; left: 0; right: 200px; /*Set right value to WidthOfFrameDiv*/ bottom: 0; overflow: auto; background: #fff; } .innertube{ margin: 15px; /*Margins for inner DIV inside each DIV (to provide padding)*/ } .innertubeWithBorder { margin: 15px; border: solid 1px #666666; } * html body{ /*IE6 hack*/ padding: 0 200px 0 0; /*Set value to (0 WidthOfFrameDiv 0 0)*/ } * html #maincontent{ /*IE6 hack*/ height: 100%; width: 100%; } </style> </head> <body> <div id="framecontent"> <div class="innertube"> <h1>CSS Right Frame Layout</h1> <h3>Sample text here</h3> </div> </div> <div id="maincontent"> <div class="innertubeWithBorder"> <h1>Dynamic Drive CSS Library</h1> <p>AReallyLongWordWhichIsSimilarToHavingAnImageWithWidthGreaterThanTheWidthOfThisDivToShowOverFlowProblemWithBorderSoIfYouResizeThisWindowNarrowerYouWillSeeWhatIMeanWorksFineInIEButNotFirefox</p> <p>So I want that border over there ------> to dissappear behind the right hand column like it does in IE, and be visible once you use the scrollbar below and scroll to the right</p> <p style="text-align: center">Credits: <a href="http://www.dynamicdrive.com/style/">Dynamic Drive CSS Library</a></p> </div> </div> </body> </html>

    Read the article

  • Log information inside a JUnit Suite

    - by Alex Marinescu
    I'm currently trying to write inside a log file the total number of failed tests from a JUnite Suite. My testsuite is defined as follows: @RunWith(Suite.class) @SuiteClasses({Class1.class, Class2.class etc.}) public class SimpleTestSuite {} I tried to define a rule which would increase the total number of errors when a test fails, but apparently my rule is never called. @Rule public MethodRule logWatchRule = new TestWatchman() { public void failed(Throwable e, FrameworkMethod method) { errors += 1; } public void succeeded(FrameworkMethod method) { } }; Any ideas on what I should to do to achieve this behaviour?

    Read the article

  • View code inside Javascript file on Rails

    - by SpyrosP
    Hello, previously i had javascript code right in the top of my view and it would work. Then, i learned that you can include the js file using yield and i did just that. I had rails view code inside my javascript code like : $( "#exp-progressbar" ).progressbar({ value: <%= ((@quest.end_time - Time.now).to_i * 100 ) / (@quest.duration * 60) %> }); Now, after i do it with yield, i get an error when i do that in the separate js file. How can i do it now ?

    Read the article

  • get all widgets inside an element

    - by peirix
    From the dojo documents on dijit.registry, I see the forEach method accepts a last parameter thisObject. But it doesn't way what that object is. Is it a dijit widget or a dojo object? I want to destroy all widgets inside an element (that will be replaced by AJAX) so they can be parsed again without conflicting id's. dijit.registry.forEach(function(w) { w.destroyRecursive(); }, dojo.byId("ajaxElement")); But this destroys ALL widgets on the page...

    Read the article

  • Problem with variable inside gsp

    - by xain
    Hi, I have a loop inside a gsp page, and I want to do a calculation on the fly, so I set a variable: <g:set var="total" value="0" /> And in the loop: <g:each in="${mob}" var="m"> ... <g:set var="total" value="${total+(m.q*m.sts.uf)}"/> ... </g:each> The "total" value does not correspond to the expected calculation. m.q is an integer, and m.sts.uf is a float. Any hints ? Thanks.

    Read the article

  • Storing and retrieving CGPoints inside NSMutableArray

    - by Matt Dice
    I've looked through countless questions on here and elsewhere and cannot for the life of me figure out what I'm doing wrong. I'm trying to store an array of CGPoints as NSValues inside of an NSMutableArray named points like so on the iPhone: NSValue *point = [NSValue valueWithCGPoint:firstTouch]; NSLog(@"NSValue *point = %@", point); [points addObject:point]; NSLOG OUTPUT NSValue *point = NSPoint: {120, 221} Everything is going smooth converting from the CGPoint to NSValue. But when I try to retrieve the point I get nothing. NSValue *getPoint = [points objectAtIndex:0]; CGPoint thePoint = [getPoint CGPointValue]; NSLog(@"Point = %@", NSStringFromCGPoint(thePoint)); NSLOG OUTPUT Point = {0, 0} The points should be the same but I'm getting a null result. For testing purposes this is happening in the touchesBegan method. Does anyone have any idea where I'm going wrong? Thanks in advance.

    Read the article

  • Cell Dequeue problem when table inside another table's cell content view

    - by Shailesh Kanzariya
    I am using two table views (Main Table and Sub Table), one table inside other's cell. I am adding Sub Table in Main Table's cell content view. I am also using different Cell Identifier for both table cells. Now, issue is : When - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath is called, very first time cell of Main Table is generated and when I scroll up/down they all are just dequeued, so it is expected and standard behavior and working fine. But, cell of Sub Table is getting created/allocated every time. It is not dequeued as it should be. I guess, its happening because Sub Table is part of Main Table's Cell Content view. But not sure and don't know how to resolve it. Can somebody help me to find the solution?

    Read the article

  • need code for show result inside table html

    - by klox
    dear all..i have a textfield <tr> <td> <td><input type="text" id="model_name"></td> </td> </tr> and a cell <tr> <td><div id="value">//i want data show here after fill textfield</div> </td> </tr> beside that, i've a table "settingdata" in database it consist of 2 field:itemdata and remark.. itemdata's value are "UD" and remark's value are "FM=87.5-108.0MHZ"... what must i do if i want after type model name "car01UD" at textfield inside <div id="value"></div> can show "FM=87.5-108.0mhz"...

    Read the article

  • load a word document inside window browser

    - by netNewbi3
    Hi, I have a page that dynamically links to a document that opens in a new page (the document is stored in a database as binary data and I loaded using the following code: Response.ClearContent() Response.ContentType = myReader("MIMEType").ToString() Response.AddHeader("Content-Disposition", "inline; filename=" & myReader("Filename")) Response.BinaryWrite(myReader("DocBD")) Response.End() This works ok. However some documents have restricted access and before loading the document the user is redirected to a login page. After entering username and passowrd the document is loaded. If it is a pdf file for example, it loads in the same login page, but when it is a word or excel document it opens outside the browser window and the login page remains in the background. Is ther a way to force a word or excel document to open inside the browser window? Many thanks.

    Read the article

  • Asp.net control inside of fancybox modal is not "working"

    - by studiothat
    Your typical "It doesn't work" freak out going on over here. Any direction would help. I have a login control on my master page and I'm trying to only display it using jquery fancybox and then redirect the user once they are logged in. But any buttons or controls that should do "something" when pressed when I put inside the fancy box are not responding. If I keep the div visible and then use the control not using fancybox I get the expected result. What are my options?

    Read the article

  • Will using https prevent client from accessing any confidential data inside JavaScript

    - by saveing saving
    I am working on an asp.net mvc web application, on the view i wrote the following JavaScript which calls an external web service :- <script type="text/javascript"> $(function() { $.getJSON("https://MyERPsystem.com/jw/web/json/hr/getsalary/byid?master_username=superadmin&password_hash=9449B5ABCFA9AFDA36B801351ED3DF66&employeeid=A200121", { //code goes here }, function(data) { $.each(data.items, function(i,item){ //code goes here }); }); }) </script> So if the external web service implements https, then does this means that the master_username and password_hash inside the javaScript cannot be seen by external users? Best Regards

    Read the article

  • Does dynamic_cast work inside overloaded operator delete ?

    - by iammilind
    I came across this: struct Base { void* operator new (size_t); void operator delete (void*); virtual ~Base () {} // <--- polymorphic }; struct Derived : Base {}; void Base::operator delete (void *p) { Base *pB = static_cast<Base*>(p); if(dynamic_cast<Derived*>(pB) != 0) { /* ... NOT reaching here ? ... */ } free(p); } Now if we do, Base *p = new Derived; delete p; Surprisingly, the condition inside the Base::delete is not satisfied Am I doing anything wrong ? Or casting from void* looses the information of Derived* ?

    Read the article

  • iPhone - UIScrollView is scrolling before UIDatePicker that is placed inside it

    - by Oliver
    Hello, I have a UIDatePicker inside a UIScrollView. But the UIDatePicker does not respond to scroll touches. It's the scrollview that is scrolling. Reading some docs on the net, I've set "Delay Content Touches" to NO, an now I see the datepicker starting a slight scroll, but it's still the scrollview that take the final word. I have some place on the screen where the user can touch to scroll the view. So how may I separate the two kind of scrolls ans make the datepicker scroll in a normal way ? Thank you for your help

    Read the article

  • Detecting keyPress inside an IFRAME using jQuery

    - by Pankaj
    Hello All can i detecting keyPress inside an IFRAME using jQuery? when user paste any copy text in ifram i want to check this text, Is this text contain HTML tags or not. Please help me. <iframe class="abc"> <html> <head> </head> <body> some text here(This text may contain html tag) </body> </html> </iframe>

    Read the article

  • What is the difference between declaring data attributes inside or outside __init__

    - by user1898540
    I'm trying to get my head around OOP in Python and I'm a bit confused when it comes to declare variables within a class. Should I declare them inside of the __init__ procedure or outside it? What's the difference? The following code works just fine: # Declaring variables within __init__ class MyClass: def __init__(self): country = "" city = "" def information(self): print "Hi! I'm from %s, (%s)"%(self.city,self.country) me = MyClass() me.country = "Spain" me.city = "Barcelona" me.information() But declaring the variables outside of the __init procedure also works: # Declaring variables outside of __init__ class MyClass: country = "" city = "" def information(self): print "Hi! I'm from %s, (%s)"%(self.city,self.country) me = MyClass() me.country = "Spain" me.city = "Barcelona" me.information()

    Read the article

  • how XSLT convert tag inside tag?

    - by cc96ai
    I have the following XML <title> This is a <highlight>test</highlight> thanks. </title> and want to convert into <span class="title">this is a <span class="highlight">test</span> thanks.</span> I try this xslt, only can ge the text inside title tag, how can I also convert the highlight tag? <span class="title"><xsl:value-of select="title"/></span>

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >