Search Results

Search found 1976 results on 80 pages for 'helper'.

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

  • asp.net mvc ajax helper/post additional data w/o jquery.

    - by Jopache
    I would like to use the ajax helper to create ajax requests that send additional, dynamic data with the post (for example, get the last element with class = blogCommentDateTime and send the value of that last one to the controller which will return only blog comments after it). I have successfully done so with the help of jQuery Form plugin like so: $(document).ready(function () { $("#addCommentForm").submit(function () { var lastCommentDate = $(".CommentDateHidden:last").val(); var lastCommentData = { lastCommentDateTicks: lastCommentDate }; var formSubmitParams = { data: lastCommentData, success: AddCommentResponseHandler } $("#addCommentForm").ajaxSubmit(formSubmitParams); return false; }); This form was created with html.beginform() method. I am wondering if there is an easy way to do this using the ajax.beginform() helper? When I try to use the same code but replace html.beginform() with ajax.beginform(), when i try to submit the form, I am issuing 2 posts (which is understandable, one being taken care of by the helper, the other one by me with the JS above. I can't create 2 requests, so this option is out) I tried getting rid of the return false and changing ajaxSubmit() to ajaxForm() so that it would only "prepare" the form, and this leads in only one post, but it does not include the extra parameter that I defined, so this is worthless as well. I then tried keeping the ajaxForm() but calling that whenever the submit button on the form gets clicked rather than when the form gets submitted (I guess this is almost the same thing) and that results in 2 posts also. The biggest reason I am asking this question is that I have run in to some issues with the javascript above and using mvc validation provided by the mvc framework (which i will set up another question for) and would like to know this so I can dive further in to my validation issue.

    Read the article

  • Call an member function implementing the {{#linkTo ...}} helper from javascript code

    - by gonvaled
    I am trying to replace this navigation menu: <nav> {{#linkTo "nodes" }}<i class="icon-fixed-width icon-cloud icon-2x"></i>&nbsp;&nbsp;{{t generic.nodes}} {{grayOut "(temporal)"}}{{/linkTo}} {{#linkTo "services" }}<i class="icon-fixed-width icon-phone icon-2x"></i>&nbsp;&nbsp;{{t generic.services}}{{/linkTo}} {{#linkTo "agents" }}<i class="icon-fixed-width icon-headphones icon-2x"></i>&nbsp;&nbsp;{{t generic.agents}}{{/linkTo}} {{#linkTo "extensions" }}<i class="icon-fixed-width icon-random icon-2x"></i>&nbsp;&nbsp;{{t generic.extensions}}{{/linkTo}} {{#linkTo "voiceMenus" }}<i class="icon-fixed-width icon-sitemap icon-2x"></i>&nbsp;&nbsp;{{t generic.voicemenus}}{{/linkTo}} {{#linkTo "queues" }}<i class="icon-fixed-width icon-tasks icon-2x"></i>&nbsp;&nbsp;{{t generic.queues}}{{/linkTo}} {{#linkTo "contacts" }}<i class="icon-fixed-width icon-user icon-2x"></i>&nbsp;&nbsp;{{t generic.contacts}}{{/linkTo}} {{#linkTo "accounts" }}<i class="icon-fixed-width icon-building icon-2x"></i>&nbsp;&nbsp;{{t generic.accounts}}{{/linkTo}} {{#linkTo "locators" }}<i class="icon-fixed-width icon-phone-sign icon-2x"></i>&nbsp;&nbsp;{{t generic.locators}}{{/linkTo}} {{#linkTo "phonelocations" }}<i class="icon-fixed-width icon-globe icon-2x"></i>&nbsp;&nbsp;{{t generic.phonelocations}}{{/linkTo}} {{#linkTo "billing" }}<i class="icon-fixed-width icon-euro icon-2x"></i>&nbsp;&nbsp;{{t generic.billing}}{{/linkTo}} {{#linkTo "profile" }}<i class="icon-fixed-width icon-cogs icon-2x"></i>&nbsp;&nbsp;{{t generic.profile}}{{/linkTo}} {{#linkTo "audio" }}<i class="icon-fixed-width icon-music icon-2x"></i>&nbsp;&nbsp;{{t generic.audio}}{{/linkTo}} {{#linkTo "editor" }}<i class="icon-fixed-width icon-puzzle-piece icon-2x"></i>&nbsp;&nbsp;{{t generic.node_editor}}{{/linkTo}} </nav> With a more dynamic version. What I am trying to do is to reproduce the html inside Ember.View.render, but I would like to reuse as much Ember functionality as possible. Specifically, I would like to reuse the {{#linkTo ...}} helper, with two goals: Reuse existing html rendering implemented in the {{#linkTo ...}} helper Get the same routing support that using the {{#linkTo ...}} in a template provides. How can I call this helper from within javascript code? This is my first (incomplete) attempt. The template: {{view SettingsApp.NavigationView}} And the view: var trans = Ember.I18n.t; var MAIN_MENU = [ { 'linkTo' : 'nodes', 'i-class' : 'icon-cloud', 'txt' : trans('generic.nodes') }, { 'linkTo' : 'services', 'i-class' : 'icon-phone', 'txt' : trans('generic.services') }, ]; function getNavIcon (data) { var linkTo = data.linkTo, i_class = data['i-class'], txt = data.txt; var html = '<i class="icon-fixed-width icon-2x ' + i_class + '"></i>&nbsp;&nbsp;' + txt; return html; } SettingsApp.NavigationView = Ember.View.extend({ menu : MAIN_MENU, render: function(buffer) { for (var i=0, l=this.menu.length; i<l; i++) { var data = this.menu[i]; // TODO: call the ember function implementing the {{#linkTo ...}} helper buffer.push(getNavIcon(data)); } return buffer; } });

    Read the article

  • Why Date Format in ASP NET MVC Differs when used inside Html Helper?

    - by Marcio Gabe
    Hi, I just came across a very interesting issue. If I use ViewData to pass a DateTime value to the view and then display it inside a textbox, even though I'm using String.Format in the exact same manner, I get different formatting results when using the Html.TextBox helper. <%= Html.TextBox("datefilter", String.Format("{0:d}", ViewData["datefilter"]))%> <input id="test" name="test" type="text" value="<%: String.Format("{0:d}", ViewData["datefilter"]) %>" /> The above code renders the following html: <input id="datefilter" name="datefilter" type="text" value="2010-06-18" /> <input id="test" name="test" type="text" value="18/06/2010" /> Notice how the fist line that uses the Html helper produces the date format in one way while the second one produces a very different output. Any ideas why? Note: I'm currently in Brazil, so the standard short date format here is dd/MM/yyyy.

    Read the article

  • What's the preferred way to use helper methods in Ruby?

    - by DR
    Disclaimer: Although I'm asking in context of a Rails application, I'm not talking about Rails helpers (i.e. view helpers) Let's say I have a helper method/function: def dispatch_job(job = {}) #Do something end Now I want to use this from several places (mostly controllers, but also a few BackgrounDRb workers) What's the preferred way to do this? I can think of two possibilities: 1. Use a class and make the helper a static method: class MyHelper def self.dispatch_job(job = {}) end end class MyWorker def run MyHelper.dispatch_job(...) end end 2. Use a module and include the method into whatever class I need this functionality module MyHelper def self.dispatch_job(job = {}) end end class MyWorker include MyHelper def run dispatch_job(...) end end 3. Other possibilities I don't know yet ... The first one is more Java-like, but I'm not sure if the second one is really an appropriate use of Ruby's modules.

    Read the article

  • CakePHP: How do I change page title from helper?

    - by Zeta Two
    Hello! I'm using a helper for static pages to add a part to the title on every page. Currently I have the following code at the top of every static page: <?php $this->set('title_for_layout', $title->output('Nyheter')); ?> The purpose of $title-output is to append " :: MY WEB SITE NAME". This works fine, but for simplicity I would rather just call: $title->title('Nyheter'); At the top of every page to set the title. The problem is that I can't call $this-set() from within the helper. Is there a way to something like this or am I completely on the wrong path here?

    Read the article

  • IP Helper service uses 50-60% CPU every 1 minute for 3-4 seconds on Windows 7

    - by Sarveshwar
    I have checked everything - all the processes in the process explorer. IP Helper service is causing CPU usage of over 50 % every 1 minute for 3-4 seconds then comes back to normal. In the task manager, the process is svchost.exe and the service is iphlpsvc. Here's the result of "ipconfig /all" command: ![alt text][1] [1]: From Snapshots Here's a screenshot of "netsh interface teredo show state" command: ![alt text][1] [1]: From Snapshots Please help me resolve this. Also utorrent is not showing the teredo address.

    Read the article

  • How can I install iTunes in such a way that it can't put any "hooks" or helper programs on my computer?

    - by Joshua Carmody
    I'm buying a new iPad, which means I must once again install iTunes. I've not used iTunes in more than 6 months, since I bought a new computer. I don't like iTunes, but I can live with using it to buy/manage media and sync my Apple devices when the program is open. What I would like to do though, is find a way to install iTunes in such a way that it has absolutely no effect on my system when it is closed. iTunes normally installs several helper programs such as iTunesHelper.exe, and the Bonjour service. These programs run in the background when iTunes is closed. You can force-close them, or remove them from your setup files, but iTunes will often put them right back when you run it. I know these programs are mostly harmless, but they have at times caused issues such as iTunes spending system resources trying to catalog media files or drives connected to VPN, or other issues. At best they're just one more small background process eating up a small piece of my CPU time and RAM. How can I run iTunes without letting it get it's "hooks" into my system? One thought I had is that I could create a Windows user account just for iTunes, and deny it admin privileges. Then if I installed iTunes using that account maybe anything it installed wouldn't affect the "main" account on my PC? But I'm not sure if that would work.... Failing that, maybe some kind of virtualization software or sandbox I could install it in? I'm open to any suggestions. My system is an Intel-based PC running Windows 7 Professional 64-bit. Thanks!

    Read the article

  • Do I need a helper column, or can I do this with a formula?

    - by dwwilson66
    I am using this formula =IF((LEFT($B26,2)="<p"),0,IF($B26="",0,IF($F26<>"",0,(FIND("""../",$B26))))) To parse data similar to the following. <nobr>&nbsp;&nbsp;&nbsp;&nbsp;contractor information</nobr><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../City_Electrical_Inspectors.htm"><b> City Electrical Inspectors</b></a><br> <nobr>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../City_Electrical_Inspectors.htm"><b>inspection</b></a></nobr><br> My problem comes in cases such as the first line, in which the line is not a new paragraph nor a link, and my FIND returns an error of #VALUE! Id like to create an IF test to scan the line for the existence of the pattern in my FIND statement before processing that statement. I figured that looking for an error condition may be the way to go. However, the only way I can envision this is as a self-referential formula, similart to the following pseudocode. IF(ISERROR($L26)=TRUE,$L26=0,L$26=the-result-of-the-formula-above) Can this be done with a formula or do I need to use a new helper column? Thanks.

    Read the article

  • How do you name your personal libraries?

    - by Mehrdad
    I'm pretty bad with naming things. The only name I can every generically come up with is 'helper'. Say, if I have a header file that contains helping functions for manipulating paths, I tend to put it inside my "helper" directory and call it "path-helper.hpp" or something like that. Obviouslly, that's a bad naming convention. :) I want to have a consistent naming scheme for my folder (and namespace) which I can use to always refer to my own headers and libraries, but I have trouble finding names that are easy to type or remember (like boost)... so I end up calling some of them "helper" or "stdext" or whatnot, which isn't a great idea. How do you find names for your libraries that are easy to remember and easy to type, and which aren't too generic (like "helper" or "std" or "stdext" or the like)? Any suggestions on how to go about doing this?

    Read the article

  • How can I have a single helper work on different models passed to it?

    - by Angela
    I am probably going to need to refactor in two steps since I'm still developing the project and learning the use-cases as I go along since it is to scratch my own itch. I have three models: Letters, Calls, Emails. They have some similarilty, but I anticipate they also will have some different attributes as you can tell from their description. Ideally I could refactor them as Events, with a type as Letters, Calls, Emails, but didn't know how to extend subclasses. My immediate need is this: I have a helper which checks on the status of whether an email (for example) was sent to a specific contact: def show_email_status(contact, email) @contact_email = ContactEmail.find(:first, :conditions => {:contact_id => contact.id, :email_id => email.id }) if ! @contact_email.nil? return @contact_email.status end end I realized that I, of course, want to know the status for whether a call was made to a contact as well, so I wrote: def show_call_status(contact, call) @contact_call = ContactCall.find(:first, :conditions => {:contact_id => contact.id, :call_id => call.id }) if ! @contact_call.nil? return @contact_call.status end end I would love to be able to just have a single helper show_status where I can say show_status(contact,call) or show_status(contact,email) and it would know whether to look for the object @contact_call or @contact_email. Yes, it would be easier if it were just @contact_event, but I want to do a small refactoring while I get the program up and running, and this would make the ability to do a history for a given contact much easier. Thanks!

    Read the article

  • linq Multiple Where based on conditions.

    - by Bathan
    I want to query a table with some conditions based on user input. I wrote this : IQueryable turnoQuery = dc.Turno; if (helper.FechaUltimaCitaDesde != DateTime.MinValue) { turnoQuery = turnoQuery.Where(t => t.TurnoFecha >= helper.FechaUltimaCitaDesde); } if (helper.FechaUltimaCitaHasta != DateTime.MinValue) { turnoQuery = turnoQuery.Where(t => t.TurnoFecha <= helper.FechaUltimaCitaHasta); } if (helper.SoloCitasConsumidas) { turnoQuery = turnoQuery.Where(t => t.Estado == Convert.ToInt32(EnmEstadoDelTurno.Consumido)); } else if(helper.AnuladoresDeCitas) { turnoQuery = turnoQuery.Where(t => t.Estado == Convert.ToInt32(EnmEstadoDelTurno.Cancelado) || t.Estado == Convert.ToInt32(EnmEstadoDelTurno.Ausente)); } The problem I'm having is that the "where" clause gets stepped over with the last one. Whats the correct way to do something like this on LINQ? The "helper" object is a custom class storing the user input dates for this example.

    Read the article

  • How do I stop Gimp from autolaunching on startup?

    - by Joshua Fox
    Gimp launches every time I log into Xubuntu (v. 13.10). Gimp is not shown under Settings Manager- Sessions and startup. It does not appear in ~/.config/autostart. I immediately close Gimp in these cases, so it is not running when I shut down the session. How do I stop Gimp from autolaunching on startup? Diagnostic Info: Note that cd / find . -name gimp.desktop Only produces ./usr/share/applications/gimp.desktop and nothing else Here is the output of grep -lIr 'gimp' ~/ ~/Gimp-search-results.txt sbin/vgimportclone home/joshua/.gimp-2.8/controllerrc home/joshua/.gimp-2.8/tags.xml home/joshua/.gimp-2.8/dockrc home/joshua/.gimp-2.8/gimprc home/joshua/.gimp-2.8/themerc home/joshua/.gimp-2.8/templaterc home/joshua/.gimp-2.8/gtkrc home/joshua/.gimp-2.8/sessionrc home/joshua/.gimp-2.8/toolrc home/joshua/.gimp-2.8/pluginrc home/joshua/.gimp-2.8/menurc home/joshua/Gimp-search-results.txt home/joshua/.local/share/ristretto/mime.db home/joshua/.wine/drive_c/windows/system32/gecko/1.4/wine_gecko/dictionaries/en-US.dic home/joshua/.wine/drive_c/windows/syswow64/gecko/1.4/wine_gecko/dictionaries/en-US.dic home/joshua/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,skype,,0495938f41334883bd3a67d3b164c1d1 home/joshua/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,gnome-utils,,91bba9b826fb21dbfc3aad6d3bd771cb home/joshua/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,icedtea-plugin,,7bb5e4ad0469ef8277032c048b9d7328 home/joshua/.cache/software-center/piston-helper/reviews.ubuntu.com,reviews,api,1.0,review-stats,any,any,,1c66e24123164bb80c4253965e29eed7 home/joshua/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,wine1.4,,2bac05a75dcec604ee91e58027eb4165 home/joshua/.cache/software-center/piston-helper/software-center.ubuntu.com,api,2.0,applications,en,ubuntu,saucy,amd64,,32b432ef7e12661055c87e3ea0f3b5d5 home/joshua/.cache/software-center/apthistory.p home/joshua/.cache/software-center/reviews.ubuntu.com_reviews_api_1.0_review-stats-pkgnames.p home/joshua/.cache/oneconf/861c4e30b916e750f16fab5652ed5937/package_list_861c4e30b916e750f16fab5652ed5937 home/joshua/.cache/sessions/xfwm4-23e853443-fb4b-42fd-aa61-33fa99fdc12c.state home/joshua/.cache/sessions/xfce4-session-athena:0 home/joshua/.config/abiword/profile

    Read the article

  • How do I use a spark variable in an html helper?

    - by Quintin Par
    Can I use a spark variable inside an html helper? Say we have <var url="Url.Action(“get”)" /> !{Html.Image("~/Content/up.png")} Now if I need to use the url inside Html.Image as an attribute(part of the 2nd param) to get <img src="~/Content/up.png" type="~/engine/get" /> how do I go about doing it?

    Read the article

  • In a PHP project, how do you organize and access your helper objects?

    - by Pekka
    How do you organize and manage your helper objects like the database engine, user notification, error handling and so on in a PHP based, object oriented project? Say I have a large PHP CMS. The CMS is organized in various classes. A few examples: the database object user management an API to create/modify/delete items a messaging object to display messages to the end user a context handler that takes you to the right page a navigation bar class that shows buttons a logging object possibly, custom error handling etc. I am dealing with the eternal question, how to best make these objects accessible to each part of the system that needs it. my first apporach, many years ago was to have a $application global that contained initialized instances of these classes. global $application; $application->messageHandler->addMessage("Item successfully inserted"); I then changed over to the Singleton pattern and a factory function: $mh =&factory("messageHandler"); $mh->addMessage("Item successfully inserted"); but I'm not happy with that either. Unit tests and encapsulation become more and more important to me, and in my understanding the logic behind globals/singletons destroys the basic idea of OOP. Then there is of course the possibility of giving each object a number of pointers to the helper objects it needs, probably the very cleanest, resource-saving and testing-friendly way but I have doubts about the maintainability of this in the long run. Most PHP frameworks I have looked into use either the singleton pattern, or functions that access the initialized objects. Both fine approaches, but as I said I'm happy with neither. I would like to broaden my horizon on what is possible here and what others have done. I am looking for examples, additional ideas and pointers towards resources that discuss this from a long-term, real-world perspective. Also, I'm interested to hear about specialized, niche or plain weird approaches to the issue. Bounty I am following the popular vote in awarding the bounty, the answer which is probably also going to give me the most. Thank you for all your answers!

    Read the article

  • Making "helper" text in a form be a different color then typed text.

    - by aslum
    <input name="phone" type="text" id="phone" value="Phone #" onfocus="value=''"> I've got two problems here. The main one is I would like the helper text (in this case "Phone Number") to be a different color then the inputted text from the user, to make it easier for the user to differentiate between filled and unfilled fields. The second is that with this methodology (onfocus="value''") if you mistype something in a field and come back to it you have to retype the whole thing which isn't really acceptable.

    Read the article

  • jQuery UI sortable issue with helper Y offset value being same as scroll offset on FireFox only

    - by James
    I have a problem with a jQuery UI 1.7.2 sortable list in Firefox, IE7-8 work fine. When I'm scrolled down a bit, the helper element seems to have an offset of the same height that I'm scrolled down from the mouse pointer which makes it impossible to see which item you originally started dragging. How do I fix this or work around the issue? If there is no fix what is a really good alternative drag-able plugin? Here are my initialization parameters for the sortable. $("#sortable").sortable( {placeholder: 'ui-state-highlight' } ); $("#sortable").disableSelection();

    Read the article

  • How do I set a time in a time_select view helper?

    - by brad
    I have a time_select in which I am trying to set a time value as follows; <%= f.time_select :start_time, :value => (@invoice.start_time ? @invoice.start_time : Time.now) %> This always produces a time selector with the current time rather than the value for @invoice.start_time. @invoice.start_time is in fact a datetime object but this is passed to the time selector just fine if I use <%= f.time_select :start_time %> I guess what I'm really asking is how to use the :value option with the time_select helper. Attempts like the following don't seem to produce the desired result; <%= f.time_select :start_time, :value => (Time.now + 2.hours) %> <%= f.time_select :start_time, :value => "14:30" %>

    Read the article

  • Is it possible to use IPC inside of a IE8 Browser Helper Object?

    - by Joel
    I need to communicate with a Service using IPC from inside of a Browser Helper Object (registered with IE8). Unfortunately, all of this communication is done through an Assembly API that I have no control over. Whenever this API starts up I get the following error: ExceptionSystem.Runtime.Remoting.RemotingException: Failed to connect to an IPC Port: The system cannot find the file specified. I realize that it is difficult to discern what the issue is without source. However I am curious if anyone knows of anything sort of permissions or DLL issues that would prevent IPC from working in this case.

    Read the article

  • IOC - Should util classes with static helper methods be wired up with IOC?

    - by Greg
    Hi, Just trying to still get my head around IOC principles. Q1: Static Methods - Should util classes with static helper methods be wired up with IOC? For example if I have a HttpUtils class with a number of static methods, should I be trying to pass it to other business logic classes via IOC? Follow on questions for this might be: Q2: Singletons - What about things like logging where you may typically get access to it via a Logger.getInstance() type call. Would you normally leave this as is, and NOT use IOC for injecting the logger into business classes that need it? Q3: Static Classes - I haven't really used this concept, but are there any guidelines for how you'd typically handle this if you were moving to an IOC based approach. Thanks in advance.

    Read the article

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