Search Results

Search found 4316 results on 173 pages for 'disabled'.

Page 44/173 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • Doctrine unsigned validation error storing created_at

    - by Alex Dean
    Hi, I'm having problems with the Timestampable functionality in Doctrine 1.2.2. The error I get on trying to save() my Record is: Uncaught exception 'Doctrine_Validator_Exception' with message 'Validation failed in class XXX 1 field had validation error: * 1 validator failed on created_at (unsigned) ' in ... I've created the relevant field in the MySQL table as: created_at DATETIME NOT NULL, Then in setTableDefinition() I have: $this->hasColumn('created_at', 'timestamp', null, array( 'type' => 'timestamp', 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, )); Which is taken straight from the output of generateModelsFromDb(). And finally my setUp() looks like: public function setUp() { parent::setUp(); $this->actAs('Timestampable', array( 'created' => array( 'name' => 'created_at', 'type' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'disabled' => false, 'options' => array() ), 'updated' => array( 'disabled' => true ))); } (I've tried not defining all of those fields for 'created', but I get the same problem.) I'm a bit stumped as to what I'm doing wrong - for one thing I can't see why Doctrine would be running any unsigned checks against a 'timestamp' datatype... Any help gratefully received! Alex

    Read the article

  • Writing to a log4net FileAppender with multiple threads performance problems

    - by Wayne
    TickZoom is a very high performance app which uses it's own parallelization library and multiple O/S threads for smooth utilization of multi-core computers. The app hits a bottleneck where users need to write information to a LogAppender from separate O/S threads. The FileAppender uses the MinimalLock feature so that each thread can lock and write to the file and then release it for the next thread to write. If MinimalLock gets disabled, log4net reports errors about the file being already locked by another process (thread). A better way for log4net to do this would be to have a single thread that takes care of writing to the FileAppender and any other threads simply add their messages to a queue. In that way, MinimalLock could be disabled to greatly improve performance of logging. Additionally, the application does a lot of CPU intensive work so it will also improve performance to use a separate thread for writing to the file so the CPU never waits on the I/O to complete. So the question is, does log4net already offer this feature? If so, how do you do enable threaded writing to a file? Is there another, more advanced appender, perhaps? If not, then since log4net is already wrapped in the platform, that makes it possible to implement a separate thread and queue for this purpose in the TickZoom code. Sincerely, Wayne

    Read the article

  • CharField values disappearing after save (readonly field)

    - by jamida
    I'm implementing simple "grade book" application where the teacher would be able to update the grades w/o being allowed to change the students' names (at least not on the update grade page). To do this I'm using one of the read-only tricks, the simplest one. The problem is that after the SUBMIT the view is re-displayed with 'blank' values for the students. I'd like the students' names to re-appear. Below is the simplest example that exhibits this problem. (This is poor DB design, I know, I've extracted just the relevant parts of the code to showcase the problem. In the real example, student is in its own table but the problem still exists there.) models.py class Grade1(models.Model): student = models.CharField(max_length=50, unique=True) finalGrade = models.CharField(max_length=3) class Grade1OForm(ModelForm): student = forms.CharField(max_length=50, required=False) def __init__(self, *args, **kwargs): super(Grade1OForm,self).__init__(*args, **kwargs) instance = getattr(self, 'instance', None) if instance and instance.id: self.fields['student'].widget.attrs['readonly'] = True self.fields['student'].widget.attrs['disabled'] = 'disabled' def clean_student(self): instance = getattr(self,'instance',None) if instance: return instance.student else: return self.cleaned_data.get('student',None) class Meta: model=Grade1 views.py from django.forms.models import modelformset_factory def modifyAllGrades1(request): gradeFormSetFactory = modelformset_factory(Grade1, form=Grade1OForm, extra=0) studentQueryset = Grade1.objects.all() if request.method=='POST': myGradeFormSet = gradeFormSetFactory(request.POST, queryset=studentQueryset) if myGradeFormSet.is_valid(): myGradeFormSet.save() info = "successfully modified" else: myGradeFormSet = gradeFormSetFactory(queryset=studentQueryset) return render_to_response('grades/modifyAllGrades.html',locals()) template <p>{{ info }}</p> <form method="POST" action=""> <table> {{ myGradeFormSet.management_form }} {% for myform in myGradeFormSet.forms %} {# myform.as_table #} <tr> {% for field in myform %} <td> {{ field }} {{ field.errors }} </td> {% endfor %} </tr> {% endfor %} </table> <input type="submit" value="Submit"> </form>

    Read the article

  • In JSF How can I understand of multi checkboxes whether all of them is checked or not?

    - by Bariscan
    As you understand from the title above, I have a datatable and checkboxes in each row. I want to enable a button when at least one checkbox is selected, and disable it when there is no selected checkboxes (I mean all of them is unselected). I could achieve this as like if one of the checkboxes is selected, the button becomes enable. However, the reversable case I have to do is when the checkboxes is being unselected, when the last selected checbox becomes unselected, the button immediately must become disabled... BTW, I must do it without using a setter method nor a backing bean. Can I perform it by using jquery or a jsfunction, richfaces, etc? As a result, I want to learn how I can disable a button at the moment when all of the checkboxes are unselected? In order to clarify the case, here is my code below; <h:selectBooleanCheckbox id="selectionCheck" onclick="document.getElementById('form1:button1').disabled=false" value="#{_apiV2Product.selectValue}" > </h:selectBooleanCheckbox> Any help would be appreciated, Many thanks, Baris

    Read the article

  • Can't disable method parenthesis auto-complete in Eclipse

    - by cvig
    I'm trying to disable the automatic closing of brackets in Eclipse, and while I've mostly succeeded, I can't stop the editor from inserting a closing parenthesis for a method call. The result is that when I type: myBool.equals(true); it inserts a closing parenthesis as soon as I type the opening parenthesis, and what I actually get is: myBool.equals(true);) I've disabled all of the auto-complete options in the Preferences - Java - Editor - Typing menu, as well as Preferences - Java - Editor - Content Assist - Fill method arguments and show guessed arguments. I also disabled the smart insert mode option under the Edit menu. Is there another option somewhere else I need to use to stop Eclipse from doing this? This is with Eclipse 3.5.2 (Build ID M20100211-1343) in case it matters. Edited to add: I should also mention that this only happens if I wait for the "intellisense" pop-up with suggested method names to appear after I type the period. If I just continuously type the code without waiting for the suggestion box to appear, the closing parenthesis doesn't get inserted.

    Read the article

  • use of assertions for type checking in php?

    - by user151841
    I do some checking of arguments in my classes in php using exception-throwing functions. I have functions that do a basic check ( ===, in_array etc ) and throw an exception on false. So I can do assertNumeric($argument, "\$argument is not numeric."); instead of if ( ! is_numeric($argument) ) { throw new Exception("\$argument is not numeric."); } Saves some typing I was reading in the comments of the php manual page on assert() that As noted on Wikipedia - "assertions are primarily a development tool, they are often disabled when a program is released to the public." and "Assertions should be used to document logically impossible situations and discover programming errors— if the 'impossible' occurs, then something fundamental is clearly wrong. This is distinct from error handling: most error conditions are possible, although some may be extremely unlikely to occur in practice. Using assertions as a general-purpose error handling mechanism is usually unwise: assertions do not allow for graceful recovery from errors, and an assertion failure will often halt the program's execution abruptly. Assertions also do not display a user-friendly error message." This means that the advice given by "gk at proliberty dot com" to force assertions to be enabled, even when they have been disabled manually, goes against best practices of only using them as a development tool So, am I 'doing it wrong'? What other/better ways of doing this are there?

    Read the article

  • dynamic date formats in eyecon's Bootstrap Datepicker

    - by Jennifer Michelle
    I need to update my datepickers' date format (mm.dd.yyyy etc) using a select box. I am currently using Eyecon's Bootstrap Datepicker because it had the smallest files size that I could find (8k minified), and includes the date formats I need. I also tried to trigger date format changes in several other datepickers without any success. Fiddle: http://jsfiddle.net/Yshy7/8/ Is there an obvious way to trigger a change from the select box to the datepickers? //date format var dateFormat = $('#custom_date_format').val() || "mm/dd/yyyy"; $('#custom_date_format').change(function() { var dateFormat = $(this).val(); }); //start and end dates var nowTemp = new Date(); var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0); var checkin = $('.j-start-date').datepicker({ format: dateFormat, onRender: function(date) { //return date.valueOf() < now.valueOf() ? 'disabled' : ''; } }).on('changeDate', function(ev) { if (ev.date.valueOf() > checkout.date.valueOf()) { var newDate = new Date(ev.date) newDate.setDate(newDate.getDate()); checkout.setValue(newDate); } checkin.hide(); $('.j-end-date')[0].focus(); }).data('datepicker'); var checkout = $('.j-end-date').datepicker({ format: dateFormat, onRender: function(date) { return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : ''; } }).on('changeDate', function(ev) { checkout.hide(); }).data('datepicker');

    Read the article

  • How to build Graceful Degradation AJAX web page?

    - by Morgan Cheng
    I want to build web page with "Graceful Degradation". That is, the web page functions even javascript is disabled. Now I have to make design decision on the format of AJAX response. If javascript is disabled, each HTTP request to server will generate HTML as response. The browser refreshes with the returned HTML. That's fine. If javascript is enabled, each AJAX HTTP request to server will generate ... well, JSON or HTML. If it is HTML, it is easy to implement. Just have javascript to replace part of page with the returned HTML. And, in server side, not much code change is needed. If it is JSON, then I have to implement JSON-to-html logic in javascript again which is almost duplicate of server side logic. Duplication is evil. I really don't like it. The benefit is that the bandwidth usage is better than HTML, which brings better performance. So, what's the best solution to Graceful Degradation? AJAX request better to return JSON or HTML?

    Read the article

  • UPDATE query that fixes orphaned records

    - by Jed
    I have an Access database that has two tables that are related by PK/FK. Unfortunately, the database tables have allowed for duplicate/redundant records and has made the database a bit screwy. I am trying to figure out a SQL statement that will fix the problem. To better explain the problem and goal, I have created example tables to use as reference: You'll notice there are two tables, a Student table and a TestScore table where StudentID is the PK/FK. The Student table contains duplicate records for students John, Sally, Tommy, and Suzy. In other words the John's with StudentID's 1 and 5 are the same person, Sally 2 and 6 are the same person, and so on. The TestScore table relates test scores with a student. Ignoring how/why the Student table allowed duplicates, etc - The goal I'm trying to accomplish is to update the TestScore table so that it replaces the StudentID's that have been disabled with the corresponding enabled StudentID. So, all StudentID's = 1 (John) will be updated to 5; all StudentID's = 2 (Sally) will be updated to 6, and so on. Here's the resultant TestScore table that I'm shooting for (Notice there is no longer any reference to the disabled StudentID's 1-4): Can you think of a query (compatible with MS Access's JET Engine) that can accomplish this goal? Or, maybe, you can offer some tips/perspectives that will point me in the right direction. Thanks.

    Read the article

  • Multiple autocompletes on same form in socialengine

    - by Mirza Awais
    I am quite new to socialegine module development. I want to use multiple autocomplets on my one form. I have no problem of showing multiple auto completes but problem comes when one selects options from auto complete. I have seen that autocompet.js uses id toValues to show selected option from autocomlte. So if there is only one autocomplete on one form then we can have one element as toValues to show the selected value. But if we have multiple auto completes then how to show the selected item of each auto complete as separately? Using the following code for autocomplete en4.core.runonce.add(function() { new Autocompleter.Request.JSON('to', '<?php echo $this->url(array('module' => 'localspots', 'controller' => 'lookup', 'action' => 'city'), 'default', true) ?>', { 'minLength': 2, 'delay' : 1, 'selectMode': 'pick', 'autocompleteType': 'message', 'multiple': false, 'className': 'message-autosuggest', 'filterSubset' : true, 'tokenFormat' : 'object', 'tokenValueKey' : 'label', 'injectChoice': function(token){ console.log(token.type); var choice = new Element('li', {'class': 'autocompleter-choices', 'html': token.photo, 'id':token.label}); new Element('div', {'html': this.markQueryValue(token.label),'class': 'autocompleter-choice'}).inject(choice); this.addChoiceEvents(choice).inject(this.choices); choice.store('autocompleteChoice', token); }, onPush : function(){ if( $('toValues').value.split(',').length >= maxRecipients ){ $('to').disabled = true; $('to').setAttribute("class", "disabled"); } }, }); });

    Read the article

  • How do I create a custom text field in Tapestry5 that renders some Javascript onto the page?

    - by shane87
    I have been trying to create a custom textfield in tapestry which will render some javascript when it gains focus. But I have been having trouble trying to find an example of this. Here is some of the code i have started off with: package asc.components; import org.apache.tapestry5.ComponentResources; import org.apache.tapestry5.Field; import org.apache.tapestry5.annotations.Parameter; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.services.ComponentDefaultProvider; public class DahserTextField implements Field { @Parameter (defaultPrefix = "literal") private String label; @Inject private ComponentResources resources; @Inject private ComponentDefaultProvider defaultProvider; @Parameter private boolean disabled; @Parameter private boolean required; String defaultLabel(){ return defaultProvider.defaultLabel(resources); } public String getControlName() { return null; } public String getLabel() { return label; } public boolean isDisabled() { return disabled; } public boolean isRequired() { return required; } public String getClientId() { return resources.getId(); } } I have been unsure on what to do next. I do not know what to put into the .tml file. I would be grateful if anyone could help or point me in the right direction.

    Read the article

  • JavaScript: count minimal length of characters in text, ignoring special codes inside

    - by ilnur777
    I want to ignore counting the length of characters in the text if there are special codes inside in textarea. I mean not to count the special codes characters in the text. I use special codes to define inputing smileys in the text. I want to count only the length of the text ignoring special code. Here is my approximate code I tried to write, but can't let it work: // smileys // ======= function smileys(){ var smile = new Array(); smile[0] = "[:rolleyes:]"; smile[1] = "[:D]"; smile[2] = "[:blink:]"; smile[3] = "[:unsure:]"; smile[4] = "[8)]"; smile[5] = "[:-x]"; return(smile); } // symbols length limitation // ========================= function minSymbols(field){ var get_smile = smileys(); var text = field.value; for(var i=0; i<get_smile.length; i++){ for(var j=0; j<(text.length); j++){ if(get_smile[i]==text[j]){ text = field.value.replace(get_smile[i],""); } } } if(text.length < 50){ document.getElementById("saveB").disabled=true; } else { document.getElementById("saveB").disabled=false; } } How the script should be in order to let it work? Thank you!

    Read the article

  • How would I send a POST Request via Ajax?

    - by Gotactics
    I have a php page, Post.php it recieves the POST's Action, and that has two functions. Insert, and Update.Now how would I go about posting INSERT with this Ajax code. The code posts update fine but is doesnt post insert at all. $(document).ready(function(){ //global vars var inputUser = $("#nick"); var inputMessage = $("#message"); var loading = $("#loading"); var messageList = $(".content ul"); //functions function updateShoutbox(){ //just for the fade effect messageList.hide(); loading.fadeIn(); //send the post to shoutbox.php $.ajax({ type: "POST", url: "Shoutbox.php", data: "action=update", complete: function(data){ loading.fadeOut(); messageList.html(data.responseText); messageList.fadeIn(2000); } }); } //check if all fields are filled function checkForm(){ if(inputUser.attr("value") && inputMessage.attr("value")) return true; else return false; } //Load for the first time the shoutbox data updateShoutbox(); //on submit event $("#form").submit(function(){ if(checkForm()){ var nick = inputUser.attr("value"); var message = inputMessage.attr("value"); //we deactivate submit button while sending $("#send").attr({ disabled:true, value:"Sending..." }); $("#send").blur(); //send the post to shoutbox.php $.ajax({ type: "GET", url: "Shoutbox.php", data: "action=insert&nick=" + nick + "&message=" + message, complete: function(data){ messageList.html(data.responseText); updateShoutbox(); //reactivate the send button $("#send").attr({ disabled:false, value:"Shout it!" }); } }); } else alert("Please fill all fields!"); //we prevent the refresh of the page after submitting the form return false; }); });emphasized text

    Read the article

  • JavaScript on jQuery created code never gets called

    - by mare
    This is my view in ASP.NET MVC. <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Administration.Master" Inherits="System.Web.Mvc.ViewPage" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server"> <script type="text/javascript"> var ddlContentTypes; $(document).ready(function () { ddlContentTypes = $("#ContentTypes"); ddlContentTypes.bind("change", loadCreate); loadCreate(); }); function loadCreate() { var typeId = $("#ContentTypes option:selected").val(); $.get('~/' + typeId + '/Create', function (data) { $("#CreateForm").html(data); }); $("fieldset input").each(function (index, item) { $(item).attr("disabled", true); }); } </script> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"> <h2> <%=Resources.Localize.CreateWidget %></h2> <p> <% Html.RenderPartial("ContentTypeSelector"); %></p> <div id="CreateForm"> </div> </asp:Content> As you can see, it loads some HTML (actually user control) and adds it to the CreateForm div. This actually works fine. The problem is this $("fieldset input").each(function (index, item) { $(item).attr("disabled", true); }); never runs. The fieldset tag is in the response, so you don't see it here but it's there - everything is returned back fine (I checked with Firebug). Why do the above two lines of JS never run or have any effect?

    Read the article

  • Need help coming up with a better HtmlHelper Extension method.

    - by zSysop
    Hi all, I've inherited the following code and i was wondering if i could pick at your brains to see if there's a nicer way to do duplicate this. Heres the html for most of our partial input views <% if (Html.IsInputReadOnly()) { %> <td> Id </td> <td> <%= Html.TextBox( "Id" , (Model == null ? null : Model.Id) , new { @readonly = "readonly", @disabled="disabled" } )%> <% } elseif (Html.IsInputDisplayable() == false) { %> <td></td> <td></td> <% } else { %> <td>Id</td> <td><%= Html.TextBox("Id")%> <%= Html.ValidationMessage("Id", "*")%> </td> <%} %> Here are my entension methods public static bool IsInputReadOnly(this HtmlHelper helper) { string actionName = ActionName(helper); // The Textbox should be read only on all pages except for the lookup page if (actionName.ToUpper().CompareTo("EDIT") == 0) return true; return false; } public static bool IsInputDisplayable(this HtmlHelper helper) { string actionName = ActionName(helper); // The Textbox should be read only on all pages except for the lookup page if (actionName.ToUpper().CompareTo("CREATE") == 0) return true; return false; } Thanks in advance

    Read the article

  • tried to update hudson via dashboard and now it doesn;t work (windows)

    - by Tim
    I get the following now in the output log. I really wish I hadn't attempted to update teh version. What a hassle. Can anyone diagnose the issue here? Running from: C:\hudson\hudson.war [Winstone 2010/06/14 23:33:54] - Beginning extraction from war file hudson home directory: C:\hudson [Winstone 2010/06/14 23:33:56] - Error during HTTP listener init or shutdown java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.(Unknown Source) at java.net.ServerSocket.(Unknown Source) at winstone.HttpListener.getServerSocket(HttpListener.java:102) at winstone.HttpListener.run(HttpListener.java:116) at java.lang.Thread.run(Unknown Source) [Winstone 2010/06/14 23:33:56] - HTTP Listener shutdown successfully [Winstone 2010/06/14 23:33:56] - Winstone Servlet Engine v0.9.10 running: controlPort=disabled [Winstone 2010/06/14 23:33:56] - Error during AJP13 listener init or shutdown java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.(Unknown Source) at java.net.ServerSocket.(Unknown Source) at winstone.ajp13.Ajp13Listener.run(Ajp13Listener.java:99) at java.lang.Thread.run(Unknown Source) [Winstone 2010/06/14 23:33:56] - AJP13 Listener shutdown successfully Running from: C:\hudson\hudson.war [Winstone 2010/06/14 23:38:49] - Beginning extraction from war file hudson home directory: C:\hudson [Winstone 2010/06/14 23:38:51] - Winstone Servlet Engine v0.9.10 running: controlPort=disabled [Winstone 2010/06/14 23:38:51] - Error during AJP13 listener init or shutdown java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.(Unknown Source) at java.net.ServerSocket.(Unknown Source) at winstone.ajp13.Ajp13Listener.run(Ajp13Listener.java:99) at java.lang.Thread.run(Unknown Source) [Winstone 2010/06/14 23:38:51] - AJP13 Listener shutdown successfully [Winstone 2010/06/14 23:38:51] - Error during HTTP listener init or shutdown java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.(Unknown Source) at java.net.ServerSocket.(Unknown Source) at winstone.HttpListener.getServerSocket(HttpListener.java:102) at winstone.HttpListener.run(HttpListener.java:116) at java.lang.Thread.run(Unknown Source) [Winstone 2010/06/14 23:38:51] - HTTP Listener shutdown successfully

    Read the article

  • databind the Source property of the WebBrowser in WPF

    - by Russ
    Does anyone know how to databind the .Source property of the WebBrowser in WPF ( 3.5SP1 )? I have a listview that I want to have a small WebBrowser on the left, and content on the right, and to databind the source of each WebBrowser with the URI in each object bound to the list item. This is what I have as a proof of concept so far, but the "<WebBrowser Source="{Binding Path=WebAddress}"" does not compile. <DataTemplate x:Key="dealerLocatorLayout" DataType="DealerLocatorAddress"> <StackPanel Orientation="Horizontal"> <!--Web Control Here--> <WebBrowser Source="{Binding Path=WebAddress}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" Width="300" Height="200" /> <StackPanel Orientation="Vertical"> <StackPanel Orientation="Horizontal"> <Label Content="{Binding Path=CompanyName}" FontWeight="Bold" Foreground="Blue" /> <TextBox Text="{Binding Path=DisplayName}" FontWeight="Bold" /> </StackPanel> <TextBox Text="{Binding Path=Street[0]}" /> <TextBox Text="{Binding Path=Street[1]}" /> <TextBox Text="{Binding Path=PhoneNumber}"/> <TextBox Text="{Binding Path=FaxNumber}"/> <TextBox Text="{Binding Path=Email}"/> <TextBox Text="{Binding Path=WebAddress}"/> </StackPanel> </StackPanel> </DataTemplate>

    Read the article

  • ASP.Net IE6 disable button

    - by RemotecUk
    Hi, I have the following code running as part of my OnClientclick attribute on my custom ASP.Net button.... function clickOnce(btnSubmit) { if ( typeof( Page_ClientValidate ) == 'function' ) { if ( ! Page_ClientValidate() ) { return false; } } btnSubmit.disabled = true; } There is a validator on the page. If a given text box is empty then the validator activates no problem. If a given text box is populated then the button disables but a post back does not occur. The rendered markup looks like this... <input type="submit" name="TestButton" value="Test Button" onclick="clickOnce(this);WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;TestButton&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="TestButton" class="euva-button-decorated" /> This works nicely in Firefox but not in IE6. Its almost like after the button has been disabled it simply does not run the post back javascript. Any ideas welcomed. EDIT: I have tried returning true from the function as well.

    Read the article

  • Reading only one row from table in model binder

    - by user281180
    I am filling a table dynamically. I can see the table filled with 3 rows, but in my model binder I can read only one value. How can I solve this problem? My code is as follows: function AddTableRow(jQtable, value, text){ var count = 0; jQtable.each(function() { var $table = $(this); var tds = '<tr>'; tds += '<td>' + '<input type="text" value = ' + text + ' disabled ="disabled" style="width:auto"/>' + '<input type="hidden" name="projectList[' + count + '].ID" value = ' + value + ' /></td>' + '<td><input type="button" value="Remove"/></td>'; tds += '</tr>'; if ($('tbody', this).length > 0) { $('tbody', this).append(tds); } else { $(this).append(tds); } count++;}); } function ReadSelectedProject() { $("#Selected option").each(function() { AddTableRow($('#projectTable'), $(this).val(), $(this).text()); }); }

    Read the article

  • python gui events out of order

    - by dave
    from Tkinter import * from tkMessageBox import * class Gui: def __init__(self, root): self.container = Frame(root) self.container.grid() self.inputText = Text(self.container, width=50, height=8) self.outputText = Text(self.container, width=50, height=8, bg='#E0E0E0', state=DISABLED) self.inputText.grid(row=0, column=0) self.outputText.grid(row=0, column=1) self.inputText.bind("<Key>", self.translate) def translate(self, event): input = self.inputText.get(0.0, END) output = self.outputText.get(0.0, END) self.outputText.config(state=NORMAL) self.outputText.delete(0.0, END) self.outputText.insert(INSERT, input) self.outputText.config(state=DISABLED) showinfo(message="Input: %s characters\nOutput: %s characters" % (len(input), len(input))) root = Tk() #toplevel object app = Gui(root) #call to the class where gui is defined root.mainloop() #enter event loop Working on a gui in tkinter I'm a little confused as to the sequence the event handlers are run. If you run the above code you'll hopefully see... 1) Editing the text widget triggers the event handler but it seems to fire it off without registering the actual change, 2) Even when the text widget is cleared (ie, keep pressing BackSpace) it still seems to have a one character length string, 3) The output widget only receives its update when the NEXT event trigger is fired despite the fact the data came on the previous event. Is this just how bindings work in tkinter or am i missing something here? The behaviour i would like when updating the input widget is: 1) Show the change, 2) Enter event handler, 3) Update output widget, 4) Show message box.

    Read the article

  • Applying the Decorator Pattern to Forms

    - by devoured elysium
    I am trying to apply the Decorator Design Pattern to the following situation: I have 3 different kind of forms: Green, Yellow, Red. Now, each of those forms can have different set of attributes. They can have a minimize box disabled, a maximized box disabled and they can be always on top. I tried to model this the following way: Form <---------------------------------------FormDecorator /\ /\ |---------|-----------| |----------------------|-----------------| GreenForm YellowForm RedForm MinimizeButtonDisabled MaximizedButtonDisabled AlwaysOnTop Here is my GreenForm code: public class GreenForm : Form { public GreenForm() { this.BackColor = Color.GreenYellow; } public override sealed Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } } FormDecorator: public abstract class FormDecorator : Form { private Form _decoratorForm; protected FormDecorator(Form decoratorForm) { this._decoratorForm = decoratorForm; } } and finally NoMaximizeDecorator: public class NoMaximizeDecorator : FormDecorator { public NoMaximizeDecorator(Form decoratorForm) : base(decoratorForm) { this.MaximizeBox = false; } } So here is the running code: static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(CreateForm()); } static Form CreateForm() { Form form = new GreenForm(); form = new NoMaximizeDecorator(form); form = new NoMinimizeDecorator(form); return form; } The problem is that I get a form that isn't green and that still allows me to maximize it. It is only taking in consideration the NoMinimizeDecorator form. I do comprehend why this happens but I'm having trouble understanding how to make this work with this Pattern. I know probably there are better ways of achieving what I want. I made this example as an attempt to apply the Decorator Pattern to something. Maybe this wasn't the best pattern I could have used(if one, at all) to this kind of scenario. Is there any other pattern more suitable than the Decorator to accomplish this? Am I doing something wrong when trying to implement the Decorator Pattern? Thanks

    Read the article

  • Jquery UI Datepicker disabling wrong days

    - by Nazariy
    I have run in to issue that days that have to be disabled are shifted to the next day. The idea is that day that does not exist in our booking object or have a value less than 1 should be disabled on calendar. here is simplified version of my script and demonstration on jsfiddle: var bookings = { "2012-09-01": 24, "2012-09-03": 31, "2012-09-05": 27, "2012-09-06": 9, "2012-09-07": 18, "2012-09-08": 0, "2012-09-10": 20, "2012-09-12": 19, "2012-09-13": 0, "2012-09-14": 9, "2012-09-15": 24, "2012-09-17": 19, "2012-09-19": 28, "2012-09-20": 15, "2012-09-21": 12, "2012-09-22": 25, "2012-09-24": 19, "2012-09-26": 0, "2012-09-27": 0, "2012-09-28": 0, "2012-09-29": 0 }; function MyEvent(date) { bookings = bookings || {}; this.date = date.toISOString().substr(0, 10); this.display = (typeof bookings[this.date] == 'number' && bookings[this.date] > 0); return this; } MyEvent.prototype.toArray = function () { return [this.display, null, null]; }; $(function () { $('#eventCalendar').datepicker({ dateFormat: "yy-mm-dd", firstDay: 1, defaultDate: "2012-09-24", beforeShowDay: function (date) { return new MyEvent(date).toArray(); } } ); }); Can some one suggest me what am I doing wrong or is it a bug?

    Read the article

  • How do I enable SVN menu in an editor window in Eclipse?

    - by Jordan Reiter
    The SVN menu is disabled whenever I'm in an edit window; it's enabled when I'm in the Navigator or similar file browsing windows. I'd like to have the SVN menu enabled while the editor window is open in order so that I can set up a key binding and commit while editing the document rather than having to switch over to the navigation view to commit a file. This is Eclipse 3.5 using Eclipse's Subversion Connectors plugin. This may be related: I had to do a reinstall of eclipse and a fair number of the keybindings no longer work the way the once did. In addition, many keystrokes now only work in windows only instead of windows and dialogs (specifically select all, copy, and paste). If these problems are related and there's an easy way to repair or refresh my keybindings without having to start over completely that would be great. Clarification I know how to set up key mappings. That's not a problem. I have them set up. The problem is that the SVN menu is disabled in the editor pane. I can access the SVN menu from the Navigator or similar panes, and I've set up the keymappings exactly the way I want them. They just aren't working in all contexts.

    Read the article

  • How can I stop the browser viewport moving to the top of the page when the user clicks on a jQueryUI radio button?

    - by ben
    I have got some radio buttons setup like this: <div id="typeRadios"> <input id="note_notetype_note1" name="note[notetype]" type="radio" value="note1" /><label for="note_notetype_note1">note1</label> <input id="note_notetype_note2" name="note[notetype]" type="radio" value="note2" /><label for="note_notetype_note2">note2</label> </div> That I turn into jQueryUI buttons like this: $("#typeRadios").buttonset(); This is the resulting HTML: <input type="radio" value="note1" name="note[notetype]" id="note_notetype_note1" class="ui-helper-hidden-accessible"> <label for="note_notetype_note1" aria-pressed="false" class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-left" role="button" aria-disabled="false"><span class="ui-button-text">note1</span></label> <input type="radio" value="note2" name="note[notetype]" id="note_notetype_note2" class="ui-helper-hidden-accessible"> <label for="note_notetype_note2" aria-pressed="false" class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-left" role="button" aria-disabled="false"><span class="ui-button-text">note2</span></label> The buttons work, but whenever I click one, the browser view-port gets returned to the top of the page, the same way it happens when you click on a <a href="#">link</a> link. I am using jQuery 1.4.2 and jQueryUI 1.8.7. How can I prevent this behaviour? Thanks for reading. EDIT: The <a href="#">link</a> part was missing.

    Read the article

  • jQuery: bind generated elements

    - by superUntitled
    Hello, thank you for taking time to look at this. I am trying to code my very first jQuery plugin and have run into my first problem. The plugin is called like this <div id="kneel"></div> <script type="text/javascript"> $("#kneel").zod(1, { }); </script> It takes the first option (integer), and returns html content that is dynamically generated by php. The content that is generated needs to be bound by a variety of functions (such as disabling form buttons and click events that return ajax data. The plugin looks like this (I have included the whole plugin in case that matters)... (function( $ ){ $.fn.zod = function(id, options ) { var settings = { 'next_button_text': 'Next', 'submit_button_text': 'Submit' }; return this.each(function() { if ( options ) { $.extend( settings, options ); } // variables var obj = $(this); /* these functions contain html elements that are generated by the get() function below */ // disable some buttons $('div.bario').children('.button').attr('disabled', true); // once an option is selected, enable the button $('input[type="radio"]').live('click', function(e) { $('div.bario').children('.button').attr('disabled', false); }) // when a button is clicked, return some data $('.button').bind('click', function(e) { e.preventDefault(); $.getJSON('/returnSomeData.php, function(data) { $('.text').html('<p>Hello: ' + data + '</p>'); }); // generate content, this is the content that needs binding... $.get('http://example.com/script.php?id='+id, function(data) { $(obj).html(data); }); }); }; })( jQuery ); The problem I am having is that the functions created to run on generated content are not binding to the generated content. How do I bind the content created by the get() function?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >