Search Results

Search found 1653 results on 67 pages for 'defaults'.

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

  • Getting output parameter(SYS_REFCURSOR) from Oracle stored procedure in iBATIS 3(by using annotation

    - by yjacket
    I got an example how to call oracle SP in iBATIS 3 without a map file. And now I understand how to call it. But I got another problem that how to get a result from output parameter(Oracle cursor). A part of exception messages is "There is no setter for property named 'rs' in 'class java.lang.Class". Below is my code. Does anyone can help me? Oracle Stored Procedure: CREATE OR REPLACE PROCEDURE getProducts ( rs OUT SYS_REFCURSOR ) IS BEGIN OPEN rs FOR SELECT * FROM Products; END getProducts; Interface: public interface ProductMapper { @Select("call getProducts(#{rs,mode=OUT,jdbcType=CURSOR})") @Options(statementType = StatementType.CALLABLE) List<Product> getProducts(); } DAO: public class ProductDAO { public List<Product> getProducts() { return mapper.getProducts(); // mapper is ProductMapper } } Full Error Message: Exception in thread "main" org.apache.ibatis.exceptions.IbatisException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:61) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:53) at org.apache.ibatis.binding.MapperMethod.executeForList(MapperMethod.java:82) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35) at $Proxy8.getList(Unknown Source) at com.dao.ProductDAO.getList(ProductDAO.java:42) at com.Ibatis3Test.main(Ibatis3Test.java:30) Caused by: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:154) at org.apache.ibatis.reflection.wrapper.BeanWrapper.set(BeanWrapper.java:36) at org.apache.ibatis.reflection.MetaObject.setValue(MetaObject.java:120) at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleOutputParameters(FastResultSetHandler.java:69) at org.apache.ibatis.executor.statement.CallableStatementHandler.query(CallableStatementHandler.java:44) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:94) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:59) ... 7 more Caused by: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.reflection.Reflector.getSetInvoker(Reflector.java:300) at org.apache.ibatis.reflection.MetaClass.getSetInvoker(MetaClass.java:97) at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:146) ... 16 more

    Read the article

  • Extjs internet explorer object not found problem.

    - by john misoskian
    hi; this code run firefox , but error on ie why ? please help me. xxx.js code: var gridFormf = new Ext.FormPanel({ id: 'company-form', frame: true, labelAlign: 'left', title: 'Is Emri', bodyStyle:'padding:5px', width: 1, tbar: [ newIsEmri,delIsEmri,edIsEmri,rapIsEmri,serIsEmri ], layout: 'column', // Specifies that the items will now be arranged in columns items: [ { columnWidth: 0.3, layout: 'fit', items: [{ columnWidth: 1, xtype: 'fieldset', labelWidth: 90, title:'Ekip / Servis', defaults: {width: 120, border:false}, // Default config options for child items defaultType: 'textfield', autoHeight: true, bodyStyle: Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;', border: true, style: { "margin-left": "10px", // when you add custom margin in IE 6... "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0" // you have to adjust for it somewhere else }, items: [{ fieldLabel: 'Ekip / Personel', name: 'SERVIS_VEREN' }] },{ columnWidth: 1, xtype: 'fieldset', labelWidth: 90, title:'Ürün', defaults: {width: 120, border:false}, // Default config options for child items defaultType: 'textfield', autoHeight: true, bodyStyle: Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;', border: true, style: { "margin-left": "10px", // when you add custom margin in IE 6... "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0" // you have to adjust for it somewhere else }, items: [{ fieldLabel: 'Cihaz', name: 'URUN_CIHAZ_ADI' }, { fieldLabel: 'Marka', name: 'URUN_MARKA_ADI' }, { fieldLabel: 'Model', name: 'URUN_MODEL_ADI' },{ fieldLabel: 'Seri No', name: 'URUN_SERI_NO' } ] }] },{ columnWidth: 0.3, layout: 'fit', items: [{ columnWidth: 1, xtype: 'fieldset', labelWidth: 90, title: 'Servis Gelis Türü', defaults: { width: 140, border: false }, // Default config options for child items defaultType: 'textfield', autoHeight: true, bodyStyle: Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;', border: true, style: { "margin-left": "10px", // when you add custom margin in IE 6... "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0" // you have to adjust for it somewhere else }, items: [{ fieldLabel: 'Gelis Türü', name: 'SERVIS_GELIS_TURU' }] },RadioPanels ] },{ columnWidth: 0.3, layout: 'fit', items: [{ columnWidth:1, autoHeight: true, border: true, items: [gridAksesuar] },gridAriza,{ columnWidth: 1, xtype: 'textarea', labelWidth: 0, width:250, defaultType: 'textarea', autoHeight: true, border: false, name:'ARIZA_ACIKLAMASI' }] },{ columnWidth: 1.0, layout: 'fit', items: gridFormx }] }); My html code : <script src="/ApplicationJs/xxx.js" type="text/javascript"></script> <script type="text/javascript"> Ext.onReady(function() { var viewport = new Ext.Viewport({ layout:'fit', items: [gridFormf] }); </script> Internet explorer return to error. Error description is object gridFormf is not found.

    Read the article

  • How can you get NVelocity to initialize correctly?

    - by Deane
    I can't get NVelocity to initialize. I'm not trying to do anything complicated, so it's just fine if it initializes at the defaults, but it won't even do that. This: VelocityEngine velocity = new VelocityEngine(); ExtendedProperties props = new ExtendedProperties(); velocity.Init(props); Results in: "It appears that no class was specified as the ResourceManager..." So does this: VelocityEngine velocity = new VelocityEngine(); velocity.Init(); I can find precious little documentation on what the properties should be, nor how to get it to initialize with the simple defaults. Can anyone point to a resource? A lot of pages point back to this page: http://www.castleproject.org/others/nvelocity/usingit.html But this page skips over the (seemingly) most important point -- how to set the properties and what to set them to. I just want to load a simple template from a file.

    Read the article

  • How to get a result from output parameter(SYS_REFCURSOR) of Oracle stored procedure in iBATIS 3(by u

    - by yjacket
    I got an example how to call oracle SP in iBATIS 3 without a map file. And now I understand how to call it. But I got another problem that how to get a result from output parameter(Oracle cursor). A part of exception messages is "There is no setter for property named 'rs' in 'class java.lang.Class". Below is my code. Does anyone can help me? Oracle Stored Procedure: CREATE OR REPLACE PROCEDURE getProducts ( rs OUT SYS_REFCURSOR ) IS BEGIN OPEN rs FOR SELECT * FROM Products; END getProducts; Interface: public interface ProductMapper { @Select("call getProducts(#{rs,mode=OUT,jdbcType=CURSOR})") @Options(statementType = StatementType.CALLABLE) List<Product> getProducts(); } DAO: public class ProductDAO { public List<Product> getProducts() { return mapper.getProducts(); // mapper is ProductMapper } } Full Error Message: Exception in thread "main" org.apache.ibatis.exceptions.IbatisException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:61) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:53) at org.apache.ibatis.binding.MapperMethod.executeForList(MapperMethod.java:82) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35) at $Proxy8.getList(Unknown Source) at com.dao.ProductDAO.getList(ProductDAO.java:42) at com.Ibatis3Test.main(Ibatis3Test.java:30) Caused by: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:154) at org.apache.ibatis.reflection.wrapper.BeanWrapper.set(BeanWrapper.java:36) at org.apache.ibatis.reflection.MetaObject.setValue(MetaObject.java:120) at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleOutputParameters(FastResultSetHandler.java:69) at org.apache.ibatis.executor.statement.CallableStatementHandler.query(CallableStatementHandler.java:44) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:94) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:59) ... 7 more Caused by: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.reflection.Reflector.getSetInvoker(Reflector.java:300) at org.apache.ibatis.reflection.MetaClass.getSetInvoker(MetaClass.java:97) at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:146) ... 16 more

    Read the article

  • ASP.NET MVC 2 RC2 Routing - How to clear low-level values when using ActionLink to refer to a higher

    - by Gary McGill
    [NOTE: I'm using ASP.NET MVC2 RC2.] I have URLs like this: /customer/123/order/456/item/index /customer/123/order/456/item/789/edit My routing table lists the most-specific routes first, so I've got: // customer/123/order/456/item/789/edit routes.MapRoute( "item", // Route name "customer/{customerId}/order/{orderId}/item/{itemId}/{action}", // URL with parameters new { controller = "Items", action = "Details" }, // Parameter defaults new { customerId = @"\d+", orderId = @"\d+", itemId = @"\d+" } // Constraints ); // customer/123/order/456/item/index routes.MapRoute( "items", // Route name "customer/{customerId}/order/{orderId}/item/{action}", // URL with parameters new { controller = "Items", action = "Index" }, // Parameter defaults new { customerId = @"\d+", orderId = @"\d+" } // Constraints ); When I'm in the "Edit" page, I want a link back up to the "Index" page. So, I use: ActionLink("Back to Index", "index") However, because there's an ambient order ID, this results in the URL: /Customer/123/Order/456/Item/789/Index ...whereas I want it to "forget" the order ID and just use: /Customer/123/Order/456/Item/Index I've tried overriding the order ID like so: ActionLink("Back to Index", "index", new { orderId=string.empty }) ...but that doesn't work. How can I persuade ActionLink to "forget" the order ID?

    Read the article

  • In Django, what's the best way to handle optional url parameters from the template?

    - by Thierry Lam
    I have the following type of urls which are both valid: hello/ hello/1234/ My urls.py has the following: urlpatterns = patterns('hello.views', url(r'^$', 'index', name='index'), url(r'^(?P<user_id>\d+)/$', 'index', name='index'), ) In my views.py, when I pass user_id to the template, it defaults to 0 if not specified. My template looks like the following, I'm using namespace hello for my hello app: {% url hello:index user_id %} If user_id is not specified, the url defaults to hello/0/. The only way I can think of preventing the default 0 from showing in the url is by an if stmt: {% if user_id %} {% url hello:index user_id %} {% else %} {% url hello:index %} {% endif %} The above will give me hello/ if there are no user_id and hello/1234/ if it's present. Is the above solution the best way to solve this issue?

    Read the article

  • In ExtJS, how do I place two fieldsets side-by-side in a panel with a hbox layout?

    - by Daniel T.
    In ExtJS, I'm having a little trouble placing two fieldsets side-by-side in a panel with a hbox layout. The hbox layout seems to be unaware of the fieldset's height, and cuts it off, even if I explicitly set the panel's height to something large. Here's what it looks like: The blue border is the hbox panel, and there's 2 fieldsets inside, 'Client Info' and 'Owner Info'. The code is like so (simplified and runnable in Firebug): var clientInfo = { xtype: 'fieldset', defaultType: 'textfield', title: 'Client Info', items: [ { fieldLabel: 'First Name' }, { fieldLabel: 'Last Name' }, { fieldLabel: 'Cell Phone #' }, { fieldLabel: 'Work Phone #' } ] }; var ownerInfo = { xtype: 'fieldset', defaultType: 'textfield', title: 'Owner Info', items: [ { fieldLabel: 'First Name' }, { fieldLabel: 'Last Name' }, { fieldLabel: 'Cell Phone #' }, { fieldLabel: 'Work Phone #' } ] }; new Ext.Panel({ layout: 'hbox', frame: true, height: 400, width: 800, defaults: { flex: 1 }, items: [ clientInfo, ownerInfo ] }).render(document.body); P.S. If you remove defaults: { flex: 1 }, the fieldsets render correctly, but doesn't automatically resize to fit the container, which is something I need. Does anybody know how to fix this rendering issue? Thanks.

    Read the article

  • MVC ActionLink omits action when action equals default route value

    - by rjygraham
    I have the following routes defined for my application: routes.MapRoute( "Referral", // Route name "{referralCode}", // URL with parameters new { controller = "Home", action = "Index" } // Parameter defaults ); routes.MapRoute( "Default", // Route name "{controller}/{action}", // URL with parameters new { controller = "Home", action = "Index" } // Parameter defaults ); And I'm trying to create an ActionLink to go on the Index action on my AdminController: @Html.ActionLink("admin", "Index", "Admin") However, when the view is executed the ActionLink renders as (Index action value is omitted): <a href="/Admin">admin</a> Normally this would be ok, but it's causing a collision with the "Referral" route. NOTE: If I instead use ActionLink to render a different action like "Default," the ActionLink renders correctly: <a href="/Admin/Default">admin</a> The fact that the "Default" action renders correctly leads me to believe the problem has to do with the default value specified for the route. Is there anyway to force ActionLink to render the "Index" action as well?

    Read the article

  • $().mouseMove <-- Empty selector in jQuery 1.4

    - by Matrym
    The following bit of code breaks in the upgrade to jquery 1.4: $().mousemove( function (e) { defaults.mouseX = e.pageX; defaults.mouseY = e.pageY; }); }; What appeared to be a reasonable fix was adding "html" as the selector, ex: $("html"). The fix works fine - except now when the user mouses off the page, it doesn't register the mouse position beyond the boundaries. When attempting to use the mouse position for a drag, for example, the amount of movement beyond the screen is really important. Anyone got any ideas? Thanks in advance.

    Read the article

  • Confusion about MVC Routes

    - by yang
    What is the problem below? routes.MapRoute( "Default2", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "test" } // Parameter defaults ); routes.MapRoute( "Default1", // Route name "{controller}/{action}/{name}", // URL with parameters new { controller = "Home", action = "Report", name = "" } // Parameter defaults ); When I navigate to /home/index "id" parameter takes the default value of "test" but when I navigate to home/report the name parameter is null. In short, if the route definition is the first in the route table, then the parameter takes its default value. But the others below don't.

    Read the article

  • Jquery Table sorter and special characters

    - by kevin
    Hi there, am using jquery tablesorter plugin and in my "country" column i got special characters like this: Índia. The fact is that when i hit the header of the column to sort it, it puts my "Índia" at the end of the column. I guess the nav sees the Í instead of the real "I" with an accent. Any clue on how to make it work even with accents ? Here's the js code in my domready: $.tablesorter.defaults.widgets = ['zebra']; $.tablesorter.defaults.sortList = [[0,0]]; $("table").tablesorter(); Thanks in advance.

    Read the article

  • cu3er background issue

    - by bradenkeith
    I'm using a set of PNGs to run my cu3er slides. They keep the transparency, until the transition and then they're boxed with a white background. Is there a way to either keep it transparent or set the background color? http://205.186.139.193/ is the test site Javascript: <script type="text/javascript"> var flashvars = {}; flashvars.xml = "<?php bloginfo('stylesheet_directory');?>/slider/cu3er.php"; flashvars.font = "font.swf"; var attributes = {}; attributes.wmode = "transparent"; attributes.id = "slider"; swfobject.embedSWF("<?php bloginfo('stylesheet_directory');?>/slider/cu3er.swf", "cu3er-container", "963", "283", "9", "expressInstall.swf", flashvars, attributes); </script> CSS: #cu3er-container{ background: #000; } #header_cu3er { background: #000; } cu3er Settings: <cu3er> <settings> <auto_play > <defaults symbol="circular" /> <tweenIn tint="0xFFFFFF" alpha="0.65" /> <tweenOut tint="0xffffff" alpha="0" /> <tweenOver alpha="0" /> </auto_play> <prev_button> <defaults round_corners="5,5,5,5"/> <tweenOver tint="0xFFFFFF" scaleX="1.1" scaleY="1.1"/> <tweenOut tint="0x000000" /> </prev_button> <prev_symbol> <tweenOver tint="0x000000" /> </prev_symbol> <next_button> <defaults round_corners="5,5,5,5"/> <tweenOver tint="0xFFFFFF" scaleX="1.1" scaleY="1.1"/> <tweenOut tint="0x000000" /> </next_button> <next_symbol> <tweenOver tint="0x000000" /> </next_symbol> </settings>

    Read the article

  • How to figure out optimal C / Gamma parameters in libsvm?

    - by Cuga
    I'm using libsvm for multi-class classification of datasets with a large number of features/attributes (around 5,800 per each item). I'd like to choose better parameters for C and Gamma than the defaults I am currently using. I've already tried running easy.py, but for the datasets I'm using, the estimated time is near forever (ran easy.py at 20, 50, 100, and 200 data samples and got a super-linear regression which projected my necessary runtime to take years). Is there a way to more quickly arrive at better C and Gamma values than the defaults? I'm using the Java libraries, if that makes any difference.

    Read the article

  • ASP.NET MVC Custom Error Pages with Magical Unicorn

    - by FLClover
    my question is regarding Pure.Kromes answer to this post. I tried implementing my pages' custom error messages using his method, yet there are some problems I can't quite explain. a) When I provoke a 404 Error by entering in invalid URL such as localhost:3001/NonexistantPage, it defaults to the ServerError() Action of my error controller even though it should go to NotFound(). Here is my ErrorController: public class ErrorController : Controller { public ActionResult NotFound() { Response.TrySkipIisCustomErrors = true; Response.StatusCode = (int)HttpStatusCode.NotFound; var viewModel = new ErrorViewModel() { ServerException = Server.GetLastError(), HTTPStatusCode = Response.StatusCode }; return View(viewModel); } public ActionResult ServerError() { Response.TrySkipIisCustomErrors = true; Response.StatusCode = (int)HttpStatusCode.InternalServerError; var viewModel = new ErrorViewModel() { ServerException = Server.GetLastError(), HTTPStatusCode = Response.StatusCode }; return View(viewModel); } } My error routes in Global.asax.cs: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" }); routes.MapRoute( name: "Error - 404", url: "NotFound", defaults: new { controller = "Error", action = "NotFound" } ); routes.MapRoute( name: "Error - 500", url: "ServerError", defaults: new { controller = "Error", action = "ServerError" } ); And my web.config settings: <system.web> <customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="/ServerError"> <error statusCode="404" redirect="/NotFound" /> </customErrors> ... </system.web> <system.webServer> <httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" path="/NotFound" responseMode="ExecuteURL" /> <remove statusCode="500" subStatusCode="-1" /> <error statusCode="500" path="/ServerError" responseMode="ExecuteURL" /> </httpErrors> ... The Error views are located in /Views/Error/ as NotFound.cshtml and ServerError.cshtml. b) One funny thing is, When a server error occurs, it does in fact display the Server Error view I defined, however it also outputs a default error message as well saying that the Error page could not be found. Here's how it looks like: Do you have any advice how I could fix these two problems? I really like Pure.Kromes approach to implementing these error messages, but if there are better ways of achieving this don't hestitate to tell me. Thanks! *EDIT : * I can directly navigate to my views through the ErrorController by accessing /Error/NotFound or Error/ServerError. The views themselves only contain some text, no markup or anything. As I said, it actually works in some way, just not the way I intended it to work. There seems to be an issue with the redirect in the web.config, but I haven't been able to figure it out.

    Read the article

  • How to have member variables and public methods in a jQuery plugin?

    - by user169867
    I'm trying to create a jQuery plugin that will create something like an autoCompleteBox but with custom features. How do I store member variables for each matching jQuery element? For example I'll need to store a timerID for each. I'd also like to store references to some of the DOM elements that make up the control. I'd like to be able to make a public method that works something like: $("#myCtrl").autoCompleteEx.addItem("1"); But in the implementation of addItem() how can I access the member variables for that particular object like its timerID or whatever? Below is what I have so far... Thanks for any help or suggestions! (function($) { //Attach this new method to jQuery $.fn.autoCompleteEx = function(options) { //Merge Given Options W/ Defaults, But Don't Alter Either var opts = $.extend({}, $.fn.autoCompleteEx.defaults, options); //Iterate over the current set of matched elements return this.each(function() { var acx = $(this); //Get JQuery Version Of Element (Should Be Div) //Give Div Correct Class & Add <ul> w/ input item to it acx.addClass("autoCompleteEx"); acx.html("<ul><li class=\"input\"><input type=\"text\"/></li></ul>"); //Grab Input As JQ Object var input = $("input", acx); //Wireup Div acx.click(function() { input.focus().val( input.val() ); }); //Wireup Input input.keydown(function(e) { var kc = e.keyCode; if(kc == 13) //Enter { } else if(kc == 27) //Esc { } else { //Resize TextArea To Input var width = 50 + (_txtArea.val().length*10); _txtArea.css("width", width+"px"); } }); }); //End Each JQ Element }; //End autoCompleteEx() //Private Functions function junk() { }; //Public Functions $.fn.autoCompleteEx.addItem = function(id,txt) { var x = this; var y = 0; }; //Default Settings $.fn.autoCompleteEx.defaults = { minChars: 2, delay: 300, maxItems: 1 }; //End Of Closure })(jQuery);

    Read the article

  • Attach fancybox/lightbox/idontknowbox function on an element

    - by tanathos
    I'm developing a jquery gallery, and I want to parametrize the highlighter function to support any kind of lightboxes (fancybox for example). In my defaults I did something like: $.fn.mygallery.defaults = { functionHighlighter: null } so in the code, creating the item, I'll check this property, and if it's setted to a function, I want to call it on the element: if ((typeof opt.functionHighlighter) === "function") { opt.functionHighlighter.call(link); } where link is the anchor element containing the miniature image, with href setted to the original image. In my idea, when the plugin is called, I set the function with: $("#gallery").mygallery({ functionHighlighter: $.fancybox }); but the "call" on the functionHighlighter executes directly the fancybox, that returns an empty area. What I want to emulate is the execution of link.fancybox(); that correctly builds the plugin on link. Any ideas?

    Read the article

  • jQuery tag editor function

    - by Mad Hatter
    I'm using jQuery Tag Editor (http://blog.crazybeavers.se/wp-content/demos/jquery.tag.editor/) for a school project. Everything works perfect, but i'm not able to retrieve the array of tags that I added. This is my code: $("#allTags").click(function () { var tags = $("#tagEditor").tagEditor().getTags(); alert(tags); }); The array doesn't return anything. This is the code from the jQuery Tag Editor: (function ($) { $.fn.extend({ tagEditor: function (options) { var defaults = { separator: ',', items: [], className: 'tagEditor', confirmRemoval: false, confirmRemovalText: 'Do you really want to remove the tag?', completeOnSeparator: false, completeOnBlur: false, initialParse: true, } var options = $.extend(defaults, options); var listBase, textBase = this, hiddenText; var itemBase = []; this.getTags = function () { return itemBase.join(options.separator); }; ...

    Read the article

  • How does one pre-populate a Python Formish form?

    - by Jace
    How does one pre-populate a Formish form? The obvious method as per the documentation doesn't seem right. Using one of the provided examples: import formish, schemaish structure = schemaish.Structure() structure.add( 'a', schemaish.String() ) structure.add( 'b', schemaish.Integer() ) schema = schemaish.Structure() schema.add( 'myStruct', structure ) form = formish.Form(schema, 'form') If we pass this a valid request object: form.validate(request) The output is a structure like this: {'myStruct': {'a': 'value', 'b': 0 }} However, pre-populating the form using defaults requires this: form.defaults = {'myStruct.a': 'value', 'myStruct.b': 0} The dottedish package has a DottedDict object that can convert a nested dict to a dotted dict, but this asymmetry doesn't seem right. Is there a better way to do this?

    Read the article

  • Inherit all methods of object (including "constructor"), but modify some of them.

    - by Kirzilla
    Hello, Let's imagine that we have object Animal $.Animal = function(options) { this.defaults = { name : null } this.options = $.extend(this.defaults, options); } $.Animal.prototype.saySomething = function() { alert("I'm animal!"); } Now I'd like to create Cat object. It is absolutely similar to $.Annimal, but method saySomething() will look like this one... $.Cat.prototype.saySomething = function() { alert("I'm cat!"); } How can I inherit from Animal to create new object Cat and redefine saySomething() method? Thank you.

    Read the article

  • Stop setInterval within jQuery plugin

    - by Romelus
    I am trying to wrap up a plugin that I am writing but am stumped on a very trivial problem that I cant seem to find a solution for. I have tracked down almost every forum and related problem discussion. Any ways here is what I want to happen, my plugin has a timer that I would like the user to be able to handle its termination. (function ($) { ... var defaults = { callback : function(){}, crossfadeTime : 1000, easing : 'linear', running : 'true', // Here is where I would like the user to send a parameter // to invoke a different result. i.e. 'false' => clearing // the timer. Such as... var timer = setInterval(function(){ // Do Something; },3000); if(defaults.running == 'false'){ clearInterval(timer); }

    Read the article

  • Simple ASP.NET MVC Routing question

    - by Robert
    Hi there, I have two pages in my simple MVC App with two defined routes: routes.MapRoute( "Results", // Route name "Results/{id}", // URL with parameters new { controller = "Results", action = "Index", id = "" } // Parameter defaults ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Main", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); I needed to have the results page load with just a product ID such as this: [MyDomain....]/Results/12345. But also the main page does a POST (using JQuery) to the Results Controller for updates using this route: [MyDomain....]/Main/Update along with a data bag. This works fine when I only have the "Default" route. But when I added the other "Results" route, all the POST calls to update are failing. Any ideas what I'm doing wrong??? Thanks a lot.

    Read the article

  • Including a Django app's url.py is resulting in a 404

    - by 828
    I have the following code in the urls.py in mysite project. /mysite/urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^gallery/$', include('mysite.gallery.urls')), ) This results in a 404 page when I try to access a url set in gallery/urls.py. /mysite/gallery/urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^gallery/browse/$', 'mysite.gallery.views.browse'), (r'^gallery/photo/$', 'mysite.gallery.views.photo'), ) 404 error Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^gallery/$ The current URL, gallery/browse/, didn't match any of these. Also, the site is hosted on a media temple (dv) server and using mod_wsgi

    Read the article

  • NSTextField (Label) Attributed Text: Select

    - by huntaub
    I have a NSTextField Label that has attributed text in it. The color and size are different from the defaults. (The text is a bit larger and green) Now, I need to be able to select the text in the label so as the click the hyperlinks embedded in the attributed text. This works fine; however, when selecting the text the format of the text reverts back to the defaults (a smaller, black font). Is there anyway to stop this behavior so that my styling is preserved when the user clicks (selects text) on a Label?

    Read the article

  • PHP 5.3: Late static binding doesn't work for properties when defined in parent class while missing in child class

    - by DavidPesta
    Take a look at this example, and notice the outputs indicated. <?php class Mommy { protected static $_data = "Mommy Data"; public static function init( $data ) { static::$_data = $data; } public static function showData() { echo static::$_data . "<br>"; } } class Brother extends Mommy { } class Sister extends Mommy { } Brother::init( "Brother Data" ); Sister::init( "Sister Data" ); Brother::showData(); // Outputs: Sister Data Sister::showData(); // Outputs: Sister Data ?> My understanding was that using the static keyword would refer to the child class, but apparently it magically applies to the parent class whenever it is missing from the child class. (This is kind of a dangerous behavior for PHP, more on that explained below.) I have the following two things in mind for why I want to do this: I don't want the redundancy of defining all of the properties in all of the child classes. I want properties to be defined as defaults in the parent class and I want the child class definition to be able to override these properties wherever needed. The child class needs to exclude properties whenever the defaults are intended, which is why I don't define the properties in the child classes in the above example. However, if we are wanting to override a property at runtime (via the init method), it will override it for the parent class! From that point forward, child classes initialized earlier (as in the case of Brother) unexpectedly change on you. Apparently this is a result of child classes not having their own copy of the static property whenever it isn't explicitly defined inside of the child class--but instead of throwing an error it switches behavior of static to access the parent. Therefore, is there some way that the parent class could dynamically create a property that belongs to the child class without it appearing inside of the child class definition? That way the child class could have its own copy of the static property and the static keyword can refer to it properly, and it can be written to take into account parent property defaults. Or is there some other solution, good, bad, or ugly?

    Read the article

  • working validation hint, working word counter but not working together

    - by Sriyani Rathnayaka
    I added a word counter to a my form's textarea... it is something like this... <div> <label>About you:</label> <textarea id="qualification" class="textarea hint_needed" rows="4" cols="30" ></textarea> <span class="hint">explain about you</span> <script type="text/javascript"> $("textarea").textareaCounter(); </script> </div> My problem is when I add textaracounter() like this my validation hint is not working.. when I remover the counter function validation hint is working... this is the jquery for hint message.. $(".hint").css({ "display":"none" }); $("input.hint_needed, select.hint_needed, textarea.hint_needed, radio.hint_needed").on("mouseenter", function() { $(this).next(".hint").css({ "display":"inline" }); }).on("mouseleave", function() { $(this).next(".hint").css({ "display":"none" }); }); this is for the word counter.. (function($){ $.fn.textareaCounter = function(options) { // setting the defaults // $("textarea").textareaCounter({ limit: 100 }); var defaults = { limit: 150 }; var options = $.extend(defaults, options); // and the plugin begins return this.each(function() { var obj, text, wordcount, limited; obj = $("#experience"); obj.after('<span style="font-weight: bold; color:#6a6a6a; clear: both; margin: 3px 0 0 150px; float: left; overflow: hidden;" id="counter-text">Max. '+options.limit+' words</span>'); obj.keyup(function() { text = obj.val(); if(text === "") { wordcount = 0; } else { wordcount = $.trim(text).split(" ").length; } if(wordcount > options.limit) { $("#counter-text").html('<span style="color: #DD0000;">0 words left</span>'); limited = $.trim(text).split(" ", options.limit); limited = limited.join(" "); $(this).val(limited); } else { $("#counter-text").html((options.limit - wordcount)+' words left'); } }); }); }; })(jQuery); can anybody tell me what is the problem there? Thank you..

    Read the article

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