Search Results

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

Page 37/584 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • cannot eliminate space between 2 horizontal divs inside containing div

    - by wantTheBest
    Should be easy, right? Just set the outer containing div's padding to zero, and set the two side-by-side divs inside the outer div to have margin:0 but that's having no effect on the space between the 2 horizontal divs. What I need is the red-outlined left div to touch the green-outlined right-side div. Despite my effort using padding and margin, the space between the 2 divs will not go away. I have looked at many answers on SO but so far no one's broken it down to this simple example -- my fiddle shows this issue, at http://jsfiddle.net/Shomer/tLZrm/7/ And here is the very simple code: <div style="border: 4px solid blue; white-space:nowrap; margin:0; padding:0; width:80%"> <div style="display:inline-block; width:45%; overflow:hidden; margin:0; border: 1px solid red"> Flimmy-flammy </div> <div style="display:inline-block; width:50%; overflow:hidden; margin:0px; border: 1px solid green"> Hambone-Sammy </div> </div>

    Read the article

  • jquery select this parent from inside image.

    - by michael
    I have the following code, i'm trying to make a loader appear then the image fade in once it is loaded. I want to make the function reusable so i can just add an image to a div with the loader id and it will work. I cant figure out how to select the parent loader div from inside the image. the commented line works fine but, i think that will select all divs. i just want to select the parent loader div. can anyone help, thanks. <div id="loader" class="loading"> <img src="http://www.inhousedesign.co.nz/images10/caravan_01.jpg" style="display: none;"/> </div> $("#loader").each(function(){ var source = $(this).find("img").attr('src'); var img = new Image(); $(img).load(function(){ $(this).hide(); //$("#loader").removeClass('loading').append(this); $(this).parents("div:first").removeClass('loading').append(this); $(this).fadeIn(800); }).attr('src', source); });

    Read the article

  • Pointer inside a struct / thread

    - by bruno
    Hi! I have this warning "warning: assignment from incompatible pointer type " in this line: data1->transformed_block[l] = &transformed_block[l]; - void print_message_function ( void *ptr ) { dt *data; data = (dt *) ptr; printf("Dentro da thread Numero0: %ld\n", data->L_norm_NewBlock); pthread_exit(0); } typedef struct data_thread { long L_norm_NewBlock; int Bsize_X; int Bsize_Y; int *transformed_block[MAX_LEVEL]; long L_norm_OrigBlock; } dt; void function() { int *transformed_block[MAX_LEVEL]; pthread_t thread1; dt *data1; pthread_attr_t attr; pthread_attr_init(&attr); //Fills structure data1 = (dt *) malloc(sizeof(dt)); data1->transformed_block[l] = &transformed_block[l]; data1->L_norm_NewBlock=0; data1->Bsize_Y = Bsize_Y; data1->Bsize_X = Bsize_X; pthread_create(&thread1, &attr, (void *) &print_message_function, (void *) &data1); } I want to get rid of that warning, and the values i get inside the thread are wrong. For example data1-L_norm_NewBlock=0; in the thread guives me a differente value (not 0 like it should be).

    Read the article

  • Images not shown when publishing MVC application to virtual directory inside default web-site

    - by Michael Sagalovich
    Hi! I am developing an application using ASP.NET MVC 1 and VS2008. When I deploy it to the default web-site in my IIS6 on WinXP, all images are shown correctly, path to any given image is localhost/Content/ImagesUI/[image].[ext] When I deploy it to the virtual directory, created inside the same site, any image request returns IIS standard 404 error page, while the path is localhost/[DirectoryName]/Content/ImagesUI/[image].[ext] - that seems to be correct, true? I am mapping .* to c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll in both site and directory configurations. When this mapping is removed, images are shown correctly. However, all other URLs do not work, of course. When I am trying to open an image in browser using the URL to it, aspnet_wp.exe process is not even started (I restarted IIS to test it) - I merely get 404 or the image, depending on the presence of * mapping. Thus, I suppose it has nothing to do neither with routes registered for MVC, nor with ASP. The solution that I found is to make Content folder a virtual directory and remove * mapping from its configuration. While that's OK to some extent, I want a better solution, which will explain and eliminate the cause of the problem, not just workaround it. Thanks for your help!

    Read the article

  • How to hadle a tags inside another tags in NSXMLParser

    - by SimpleMan
    I have a file: <xml> <component>something <system>somethingDeeper <value>somethingDeepest</value> </system> </component> <component>somethinfDifferent <value>somethingDifferentDeeper</value> </component> <value>somethingNew</value> </xml> So i want to distinguish what is inside another tag (ex. <system>) what is not. How to do this with NSXMLParser ? I currently use BOOL ivar's but this is a lot of tags and this is not as elegant as i want it to be. I know that NSXMLParser is a SAX parser and i understand that. In above example I will be enter to didEndElement method three times with: elementName equal value Is there a more elegant way to distinguish what entry was from <component> tag above what not?

    Read the article

  • Make a <div> disappear inside a javascript script

    - by KeenClock
    First of all, I have this line of code on a random page : <script type="text/javascript" src="script.php"></script> On the page named "script.php", I have a <div class="something">random text</div> and the random text is displayed and everything is working fine. Now, I would like to know if it's possible to make that specific <div> to disappear without having to modify the code inside the "script.php" page. Thank you ! Edit: Thank you to all of you, you helped me found a solution, here is an example : <!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" xml:lang="fr" lang="fr"><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Random page</title> <style type="text/css"> div.something { font-family: Tahoma; font-size: 12px; font-weight: bold; text-decoration: underline; } </style> <script type="text/javascript"> function hideSomething() { document.getElementsByClassName("something")[2].style.display = "none"; } </script> </head> <body> <div class="something">random text 1</div> <div class="something">random text 2</div> <div class="something">random text 3</div> <br /><input type="submit" value="Disappear" onclick="hideSomething()" /> </body> </html>

    Read the article

  • Using list() to extract a data.table inside of a function

    - by Nathan VanHoudnos
    I must admit that the data.table J syntax confuses me. I am attempting to use list() to extract a subset of a data.table as a data.table object as described in Section 1.4 of the data.table FAQ, but I can't get this behavior to work inside of a function. An example: require(data.table) ## Setup some test data set.seed(1) test.data <- data.table( X = rnorm(10), Y = rnorm(10), Z = rnorm(10) ) setkey(test.data, X) ## Notice that I can subset the data table easily with literal names test.data[, list(X,Y)] ## X Y ## 1: -0.8356286 -0.62124058 ## 2: -0.8204684 -0.04493361 ## 3: -0.6264538 1.51178117 ## 4: -0.3053884 0.59390132 ## 5: 0.1836433 0.38984324 ## 6: 0.3295078 1.12493092 ## 7: 0.4874291 -0.01619026 ## 8: 0.5757814 0.82122120 ## 9: 0.7383247 0.94383621 ## 10: 1.5952808 -2.21469989 I can even write a function that will return a column of the data.table as a vector when passed the name of a column as a character vector: get.a.vector <- function( my.dt, my.column ) { ## Step 1: Convert my.column to an expression column.exp <- parse(text=my.column) ## Step 2: Return the vector return( my.dt[, eval(column.exp)] ) } get.a.vector( test.data, 'X') ## [1] -0.8356286 -0.8204684 -0.6264538 -0.3053884 0.1836433 0.3295078 ## [7] 0.4874291 0.5757814 0.7383247 1.5952808 But I cannot pull a similar trick for list(). The inline comments are the output from the interactive browser() session. get.a.dt <- function( my.dt, my.column ) { ## Step 1: Convert my.column to an expression column.exp <- parse(text=my.column) ## Step 2: Enter the browser to play around browser() ## Step 3: Verity that a literal X works: my.dt[, list(X)] ## << not shown >> ## Step 4: Attempt to evaluate the parsed experssion my.dt[, list( eval(column.exp)] ## Error in `rownames<-`(`*tmp*`, value = paste(format(rn, right = TRUE), (from data.table.example.R@1032mCJ#7) : ## length of 'dimnames' [1] not equal to array extent return( my.dt[, list(eval(column.exp))] ) } get.a.dt( test.data, "X" ) What am I missing? Update: Due to some confusion as to why I would want to do this I wanted to clarify. My use case is when I need to access a data.table column when when I generate the name. Something like this: set.seed(2) test.data[, X.1 := rnorm(10)] which.column <- 'X' new.column <- paste(which.column, '.1', sep="") get.a.dt( test.data, new.column ) Hopefully that helps.

    Read the article

  • dwoo template variables inside JavaScript?

    - by user344711
    Hi everyone! i have this code. {if $loginUrl} {literal} <script type="text/javascript"> var newwindow; var intId; function login() { var screenX = typeof window.screenX != 'undefined' ? window.screenX : window.screenLeft, screenY = typeof window.screenY != 'undefined' ? window.screenY : window.screenTop, outerWidth = typeof window.outerWidth != 'undefined' ? window.outerWidth : document.body.clientWidth, outerHeight = typeof window.outerHeight != 'undefined' ? window.outerHeight : (document.body.clientHeight - 22), width = 500, height = 270, left = parseInt(screenX + ((outerWidth - width) / 2), 10), top = parseInt(screenY + ((outerHeight - height) / 2.5), 10), features = ( 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top ); newwindow=window.open('{$loginUrl}','Login by facebook',features); if (window.focus) {newwindow.focus()} return false; } </script> {/literal} {/if} It is dwoo templates, i wonder how can i use my dwoo variables inside javascript? im trying to do it just at you can see at the code, but it doesnt work. I need to warp my code between {literal} so it can work.

    Read the article

  • DIV inside TD to make it appear correctly

    - by Daniel Svensson
    Hi, I have a <table> generated from code-behind and now facing a problem. In one of the TD i need to have a DIV that is setup with JQuery so that when i click a link the DIV slideToggles. Now i need the TD belonging to that TR not to expand the TR. To solve this i have used an old trick that is to place the JQuery DIV inside another surrounding DIV with height 1px and make the TR not expanding with the heigth of the DIV that slides out. In IE the sliding DIV is partially under the table and in Firefox the DIV appears over the table but it's trasparent, the text from the data in the table shows thru. I have tried to alter the Z-index in various ways but it's no good. Anyone that has an idea or alternatively solution that has worked for them. HtmlGenericControl containerDiv = new HtmlGenericControl("div"); containerDiv.ID = "containerDiv"; containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Width, "100%"); containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Height, "1px"); containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.ZIndex, "999"); HtmlGenericControl innerDiv = new HtmlGenericControl("div"); innerDiv.ID = System.Guid.NewGuid().ToString() + "_annualDiv"; inner.Style.Add(System.Web.UI.HtmlTextWriterStyle.Width, "100%"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Height, "300px"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.ZIndex, "1000"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderStyle, "solid"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderColor, "Black"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderWidth, "1px"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BackgroundColor, "white"); innerDiv.InnerHtml = "Here is a list of links coming later"; conDiv.Controls.Add(innerDiv);

    Read the article

  • jQuery plugin Private functions inside Vs. Outside the each loop

    - by Pablo
    What is the difference between including private functions in a jQuery plugin in the examples below: Outside the loop: (function( $ ){ var defaults = {}; $.fn.cmFlex = function(opts) { this.each(function() { var $this = $(this); //Element specific options var o = $.extend({}, defaults, opts); //Code here }); function f1(){.... function f3(){.... function f2(){.... }; })( jQuery ); Inside the loop: (function( $ ){ var defaults = {}; $.fn.cmFlex = function(opts) { this.each(function() { var $this = $(this); //Element specific options var o = $.extend({}, defaults, opts); function f1(){.... function f3(){.... function f2(){.... }); }; })( jQuery ); The advantage of including the functions in the loop is that i will be able to access the $this variable as well as the Element specific options from f1() f2() f3(), are there any disadvantages to this?

    Read the article

  • plot 4 different plots inside 1 pdf

    - by ifreak
    I have 2 data frames which i want to generate 3 plots from them and place them inside 1 pdf file as a single column. i want all the plots to have the same x-axis limits(basically the same x-axis) even thought they differ in the name and how they were obtained. the dataframes looks something like that: d1 X Y Z 0.04939317 -0.4622222 13651 0.03202451 -0.4261000 13401 0.09950793 -0.3233025 13151 0.11548556 -0.4637981 12486 0.09817597 -0.4751886 12236 0.15770701 -0.5819355 11986 and d2 V0 V1 V2 V3 sign 1 1 0.379 0.612 pos 2 1 0.378 0.620 pos 3 1 0.578 0.571 neg 4 1 0.978 0.561 pos 5 1 0.758 0.261 neg 6 1 0.378 0.126 neg P.S : both data frames are bigger than this, this is only a part of them V0, V1 and Z range from 1 to 20000 the plots that i created are : From d2 d2plot=ggplot(d1, aes(V0,V1, fill=sign)) + geom_tile()+ scale_fill_manual(values = c("neg" = "yellow", "pos"="red")) +geom_vline(xintercept =10000 ) +geom_text(mapping=aes(x=10000,y=0, label="Stop"), size=4, angle=90, vjust=-0.4, hjust=0) From d1 d1plot = ggplot(d2) + geom_errorbarh(aes(x=z,xmin=z-50,xmax=z+50, y=Y, height = 0.02),color="red")+ opts(legend.position = "none") +geom_vline(xintercept = 10000) +geom_text(mapping=aes(x=10000,y=-0.3, label="Stop"), size=4, angle=90, vjust=-0.4, hjust=0) i've tried grid.arrange(d1plot,d2plot,ncol=1) but the x-axis is different for each plot, i tried changing the aspect ratio, but this will change the y-axis ..i've also tried to use facet_wrap but the problem that my x-axis values have different values, i just want the limits and breaks to be the same and the plots all be aligned in 1 column based on 1 x-axis to comapre the value of the statistical methods in an easy way.

    Read the article

  • GLSL point inside box test

    - by wcochran
    Below is a GLSL fragment shader that outputs a texel if the given texture coord is inside a box, otherwise a color is output. This just feels silly and the there must be a way to do this without branching? uniform sampler2D texUnit; varying vec4 color; varying vec2 texCoord; void main() { vec4 texel = texture2D(texUnit, texCoord); if (any(lessThan(texCoord, vec2(0.0, 0.0))) || any(greaterThan(texCoord, vec2(1.0, 1.0)))) gl_FragColor = color; else gl_FragColor = texel; } Below is a version without branching, but it still feels clumsy. What is the best practice for "texture coord clamping"? uniform sampler2D texUnit; varying vec4 color; varying vec4 labelColor; varying vec2 texCoord; void main() { vec4 texel = texture2D(texUnit, texCoord); bool outside = any(lessThan(texCoord, vec2(0.0, 0.0))) || any(greaterThan(texCoord, vec2(1.0, 1.0))); gl_FragColor = mix(texel*labelColor, color, vec4(outside,outside,outside,outside)); } I am clamping texels to the region with the label is -- the texture s & t coordinates will be between 0 and 1 in this case. Otherwise, I use a brown color where the label ain't. Note that I could also construct a branching version of the code that does not perform a texture lookup when it doesn't need to. Would this be faster than a non-branching version that always performed a texture lookup? Maybe time for some tests...

    Read the article

  • looping array inside list in c#

    - by 3yoon af
    I have a list of array that contains multiple arrays. each array has 2 index .. First, I want to loop the list. Then i want to loop the array inside the list .. How can i do that ? I try to use this way, but it doesn't work ! foreach (string[] s in ArrangList1) { int freq1 = int.Parse(s[1]); foreach (string[] s1 in ArrangList) { int freq2 = int.Parse(s1[1]); if (freq1 < freq2) { backup = s; index1 = ArrangList1.IndexOf(s); index2 = ArrangList.IndexOf(s1); ArrangList[index1] = s1; ArrangList[index2] = s; } backup = null; } } it give me error in line 4.. I try to do the loop using other way .. but i don't know how to continue ! for (int i = 0; i < ArrangList1.Count; i++) { for (int j = 0; j < ArrangList1[i].Length; j++) { ArrangList1[i][1]; } } I use C# language .. Can someone help me, please?

    Read the article

  • call function inside a nested jquery plugin

    - by tchoesang
    There are many topics related to my question and i have been through most of them, but i haven't got it right. The closest post to my question is the following: http://stackoverflow.com/questions/1042072/how-to-call-functions-that-are-nested-inside-a-jquery-plugin Below is the jquery plugin i am using. On resize, the element sizes are recalculated. I am now trying to call the function resizeBind() from outside of the jquery plugin and it gives me error I tried the following combinations to call the function $.fn.splitter().resizeBind() $.fn.splitter.resizeBind() Any ideas, where i am getting wrong? ;(function($){ $.fn.splitter = function(args){ //Other functions ...... $(window).bind("resize", function(){ resizeBind(); }); function resizeBind(){ var top = splitter.offset().top; var wh = $(window).height(); var ww = $(window).width(); var sh = 0; // scrollbar height if (ww <0 && !jQuery.browser.msie ) sh = 17; var footer = parseInt($("#footer").css("height")) || 26; splitter.css("height", wh-top-footer-sh+"px"); $("#tabsRight").css("height", splitter.height()-30+"px"); $(".contentTabs").css("height", splitter.height()-70+"px"); } return this.each(function() { }); }; })(jQuery);

    Read the article

  • PHP - Calling function inside another class -> function

    - by Kolind
    I'm trying to do this: class database { function editProvider($post) { $sql = "UPDATE tbl SET "; foreach($post as $key => $val): if($key != "providerId") { $val = formValidate($val); $sqlE[] = "`$key`='$val'"; } endforeach; $sqlE = implode(",", $sqlE); $where = ' WHERE `id` = \''.$post['id'].'\''; $sql = $sql . $sqlE . $where; $query = mysql_query($sql); if($query){ return true; } } // }//end class And then use this function * INSIDE of another class *: function formValidate($string){ $string = trim($string); $string = mysql_real_escape_string($string); return $string; } // .. on $val. Why doesn't this work? if I write in a field of the form, it's not escaping anything at all. How can that be? * UPDATE * handler.php: if(isset($_GET['do'])){ if($_GET['do'] == "addLogin") { $addLogin = $db->addLogin($_POST); } if($_GET['do'] == "addProvider") { $addProvider = $db->addProvider($_POST); } if($_GET['do'] == "editProfile") { $editProfile = $db->editProfile($_POST); } if($_GET['do'] == "editProvider") { $editProvider = $db->editProvider($_POST); } } //end if isset get do ** The editProvider function works fine except for this :-) **

    Read the article

  • Mapping a URL to a service inside a class library

    - by johnk82swe
    I'm developing a small content management solution than can be used in any ASP.NET 3.5 website. The website references some dll's and then lets the aspx's inherit my page baseclass. Some configuration in web.config is also needed, but thats it. Now I'm building a standalone Silverlight editor for the CMS. My idea is that it should communicate with the server using web services. But the question is how to make this service available to the editor? I don't want the website developers having to bother with it. If I used a REST API rather than SOAP I could just create an HttpHandler in my class library and let the website developers add a handler to it in web.config with the path "editor" and then the editor could communicate with that handler on mywebsite.com/editor. Is there any way to achieve the same with a asmx or wcf service? The important thing is that the website developers never have to set up any asmx files or anything. They should only have to specify a url and map that url to a service inside my class library. Thanks in advance!

    Read the article

  • Target to a page inside an iframe

    - by Marcelo Srougi
    I will try to explain again: I have 3 images in my index.html that when clicked i'd like to point respectively to ourmission.html, ourvalues.html and ourvision.html. But this 3 pages are inside an iframe located in the page ourcompany.html as you can see below: <aside class="sidebar"> <h4>Our Company</h4> <ul class="nav nav-list primary pull-bottom"> <li><a href="contactus.html"target="conteudo">Contact Us</a></li> <li><a href="ourmission.html" target="conteudo">Our Mission</a></li> <li><a href="ourvalues.html" target="conteudo">Our Values</a></li> <li><a href="ourvision.html"target="conteudo">Our Vision</a></li> </ul> </aside> <iframe src="contactus.html" frameborder='0' name="conteudo" width="700" height="700"> </iframe> How do i to point them directly, so the page ourcompany.html will load with the specific iframe opened.

    Read the article

  • .find replacing content inside html tags

    - by Woz
    I want to sanitize html tags from my wysiwyg. I want to replace certain tags with another. This almost works only the replaceWith() is also removing the content from within the tags. I dont want to do this. I just want to replace the tags. Here is what I have so far. Text for Testing: This<div>is</div><div>a test</div><div>to clean&nbsp;</div><div>some tags</div><div><br></div> Expected Result: This<p>is</p><p>a test</p><p>to clean</p><p>some tags</p><p><br></p> Actual Result: This<p></p><p></p><p></p><p></p><p></p> This is the code I am using to find and replace var thebad = ["h1","h2","h3","h4","h5","h6","div"]; var thegood = ["","","","","","","<p>"]; for(var i = 0; i < thebad.length; i++){ $('.content').contents().find('body').find(thebad[i]).replaceWith(thegood[i]); } I need to figure out how to keep the text inside the html tags when i replace them. Thanks in advance

    Read the article

  • 100% height div inside 100% td

    - by Brizio
    Ok, so here is my problem.. and its buggin me for a while...  i need to set the following DIV 100% height inside this TD without any side-effects (by that i mean scrolling), because for some unknown reason, when i set it to 100% height, looks like IE 8 does some wrong calculations.. I tried a lot of combinations but no success.. transitional doctype is required... thanks in advance for any help! <!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"> <style> html, body { height:100%; margin:0px; padding:0px; } </style> <head> <body> <table style="height:100%" border="1"> <tr> <td>TOP</td> </tr> <tr style="height:100%"> <td style="height:100%"> <div style="border:1px dotted blue; height:100%">CONTENT</div> </td> </tr> </table> </body> </html>

    Read the article

  • Run function in current element by get short code inside

    - by happi
    In stead of adding an ID (IdAddMore) to run script inside ID(widget1) like that : <div class="widget" id="widget1"> <div class="content"> <div id="IdAddMore"></div> <script type='text/javascript'> $("#IdAddMore").selectme({ Numpost:3, Postyle : "Enter your style", }); </script> </div> </div> (widget is added automatically when I add more new widget, It means I can have widget3, widget10, ....Index(3,10..) is any and is not sorted.) Widget is a HTML/JS widget. I want run selectme by short code instead of repeating script in each widget. <div class="widget" id="widget1"> <div class="content"> [3][mystyle] </div> </div> <div class="widget" id="widget50"> <div class="content"> [4][yourstyle] </div> </div> ........... How can I write only script to catch short code in current element is added : I write script below but it does not work. Check for me, thanks your help. <script type='text/javascript'> var getdata = document.getElementsByClassName(".content").innerText || document.getElementById(".content").textContent; var thevalue = []; getdata.replace(/\[(.*?)\]/g, function(g0,g1){thevalue.push(g1);}); $(".widget").selectme({ Numpost:thevalue[0], Postyle: ""+thevalue[1]+"", }); </script>

    Read the article

  • Wrapping <%= f.check_box %> inside <label>

    - by Ben Scheirman
    I have a list of checkboxes on a form. Due to the way the CSS is structured, the label element is styled directly. This requires me to nest the checkbox inside of the tag. This works in raw HTML, if you click on the label text, the state of the checkbox changes. It doesn't work with the rails <%= f.check_box %> helper, however, because it outputs a hidden input tag first. In summary, <label> <%= f.check_box :foo %> Foo </label> this is the output I want: <label> <input type="checkbox" ... /> <input type="hidden" ... /> Foo </label> ...but this is what rails is giving me: <label> <input type="hidden" ... /> <input type="checkbox" ... /> Foo </label> So the label behavior doesn't actually work :(. Is there any way to get around this?

    Read the article

  • php in_array() inside a foreach

    - by 432skronker
    I am having issues with using in_array() inside a foreach loop. Not sure if this is even possible or if I am doing something ridiculous where there are better ways. What I want to do is go through all the items and if their item id matches one thats in the array, return true and add the price of the item to a runninng total. $price = 0; $result = false; $array = array(1533, 2343, 2333); foreach($order['items'] as $item){ if(in_array($item['Item'], $array)){ $result = true; $price += $item['Price']; } } **UPDATED** Here is the order array [items] => Array ( [0] => Array ( [Item] => 139957 [OrderID] => 16025 [SizeID] => 24 [Price] => 46.00 ) [1] => Array ( [Item] => 2343 [OrderID] => 16025 [SizeID] => 12 [Price] => 32.00 ) ) [data] => Array ( )

    Read the article

  • a4j:jsFunction with actionListener inside of h:dataTable

    - by JQueryNeeded
    Hello all, I'm having problem with using a4j:jsFunction with actionListener inside of h:dataTable, when I want to invoke an action over particular row with a4j:commandLink it works flawless but when I want to invoke the action with a4j:jsFunction & actionListener it's always invoked over the last element in dataTable Let me give you an example: <a4j:form ajaxSubmit="true" reRender="mainForm" id="mainForm"> <a4j:region> <t:saveState value="#{ts.list}" /> </a4j:region> <h:dataTable value="#{ts.list}" var="el" binding="#{ts.bind}"> <h:column>#{el}</h:column>> <h:column> <a4j:commandLink actionListener="#{ts.rem}"> <h:outputText value="delete by CMDLink" /> </a4j:commandLink> </h:column> <h:column> <a href="#" onclick="okClicked();">delete by okClicked</a> <a4j:jsFunction name="okClicked" actionListener="#{ts.rem}" /> </h:column> </h:dataTable> </a4j:form> now, the bean's code: package com.sth; import java.util.ArrayList; import java.util.List; import javax.faces.component.UIData; import javax.faces.event.ActionEvent; public class Ts { private List<String> list = new ArrayList<String>(); private UIData bind; public Ts(){ list.add("element1"); list.add("element2"); list.add("element3"); list.add("element4"); } public List<String> getList() { return list; } public void setList(List<String> list) { this.list = list; } public void rem(ActionEvent ae) { String toRem = (String) bind.getRowData(); System.out.println("Deleting " + toRem); list.remove(toRem); } public UIData getBind() { return bind; } public void setBind(UIData bind) { this.bind = bind; } } when I use a4j:commandLink to remove element, it works as its expected, but when I use a4j:jsFunction to invoke actionListener it invokes action against last element :( Any ideas? Cheers

    Read the article

  • AjaxControlToolkit DropDownExtender inside a table always displays associated panel

    - by Amanda Myer
    I have a textarea that has the ajaxcontroltoolkit dropdownextender associated with it, and a panel that contains a gridview with the options for the user to select from. Here is the code for these items: <asp:UpdatePanel ID="updPnlView" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSiteName" runat="server" TextMode="MultiLine" Rows="4" Columns="33" ReadOnly="true" /></td> <ajaxToolkit:DropDownExtender runat="server" ID="popupdropdown" DropDownControlID="pnlGrid" TargetControlID="txtSiteName" /> <asp:Panel runat="server" ID="pnlGrid" Style="display: none; visibility: hidden" Height="300" ScrollBars="Vertical"> <asp:GridView ID="gvSite" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyNames="ID,FullAddress" DataSourceID="odsSite" OnRowDataBound="gvSite_RowDataBound" ShowFooter="false" ShowHeader="false" OnSelectedIndexChanged="gvSite_SelectedIndexChanged" > <Columns> <asp:CommandField ButtonType="Link" SelectText="Select" ShowSelectButton="true" ItemStyle-CssClass="HiddenColumn" /> <asp:TemplateField > <ItemTemplate> <asp:Label ID="FullAddress" runat="server" Text='<%# Eval("FullAddress").ToString().Replace("\n", "<br/>") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:CheckBoxField DataField="DisabledFLG" ItemStyle-CssClass="HiddenColumn" /> </Columns> </asp:GridView> </asp:Panel> <asp:ObjectDataSource ID="odsSite" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetList" TypeName="SOM.DCO.MOGWAI.Bll.SiteManager" onselecting="odsSite_Selecting" SortParameterName="SortExpression" onselected="odsSite_Selected" > <SelectParameters> <asp:Parameter Name="myCriteria" Type="Object" /> <asp:Parameter Name="myIDs" Type="Object" /> <asp:Parameter Name="sortExpression" Type="String" /> <asp:Parameter Name="bypassCache" Type="Boolean" /> </SelectParameters> </asp:ObjectDataSource> </ContentTemplate> </asp:UpdatePanel> When I place this item inside a table (i.e. <table><tr><td>THE CODE ABOVE</td></tr></table>) the panel always shows completely open never hidden. It also completely fills out the available space within the TD and pushes all other text on the page down the screen. If I take the associated controls out of the table, it works as expected. I have duplicated this issue in both Firefox and IE8. What gives?

    Read the article

  • Problems with makeObjectsPerformSelector inside and outside a class?

    - by QuakAttak
    A friend and I are creating a card game for the iPhone, and in these early days of the project, I'm developing a Deck class and a Card class to keep up with the cards. I'm wanting to test the shuffle method of the Deck class, but I am not able to show the values of the cards in the Deck class instance. The Deck class has a NSArray of Card objects that have a method called displayCard that shows the value and suit using console output(printf or NSLog). In order to show what cards are in a Deck instance all at once, I am using this, [deck makeObjectsPerformSelector:@selector(displayCard)], where deck is the NSArray in the Deck class. Inside of the Deck class, nothing is displayed on the console output. But in a test file, it works just fine. Here's the test file that creates its own NSArray: #import <Foundation/Foundation.h> #import "card.h" int main (int argc, char** argv) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; Card* two = [[Card alloc] initValue:2 withSuit:'d']; Card* three = [[Card alloc] initValue:3 withSuit:'h']; Card* four = [[Card alloc] initValue:4 withSuit:'c']; NSArray* deck = [NSArray arrayWithObjects:two,three,four,nil]; //Ok, what if we release the objects in the array before they're used? //I don't think this will work... [two release]; [three release]; [four release]; //Ok, it works... I wonder how... //Hmm... how will this work? [deck makeObjectsPerformSelector:@selector(displayCard)]; //Yay! It works fine! [pool release]; return 0; } This worked beautifully, so I created an initializer around this idea, creating 52 card objects one at a time and adding them to the NSArray using deck = [deck arrayByAddingObject:newCard]. Is the real problem with how I'm using makeObjectsPerformSelector or something before/after it?

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >