Search Results

Search found 10789 results on 432 pages for 'ui scripting'.

Page 86/432 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • Updating Activity UI from Different Activity Method?

    - by stormin986
    I have a tab widget where one of the tabs is a chat-type feature. I want to update the chat data at an interval (variable depending on whether the chat tab is active or not). The best approach seemed to be using an AsyncTask in my main TabActivity class, as that would avoid any issues of the chat activity being destroyed while in the background, while an AsyncTask was running. I wanted to ensure that the Activity isn't destroyed and recreated, thus causing my AsyncTask to be unable to modify the actual active Activity's data. However, now that my AsyncTask is in the TabActivity activity, I don't have a direct way to call my Chat's ListAdapter notifyDataSetChanged() from my onPostExecute() method anymore. Is there a way to get a reference to a given Tab's current Activity from the TabHost/TabActivity? Or, alternatively, can I assume my chat activity will never be destroyed as a child activity of the TabActivity activity (well, never destroyed while the TabActivity is active at least), and then just put the AsyncTask in the Chat Activity?

    Read the article

  • A good UI design for rating in .Net

    - by Ben
    Hi, im trying to add a "rating" system to an existing form (i.e 1 star, 2 Star or poor, average,good,excellent etc). Does anyone know of a way to achieve this that is aesthetically pleasing with good UX either in .Net or a free 3rd party control? Thanks

    Read the article

  • Why does jquery button take a second to refresh after updating a page using ajax

    - by oo
    when i refresh a part of a webpage that has a jquery ui button, it seems like I have to call: $(":button").button(); again or it shows up as a regular button. Thats fine but when i do this, it still shows up as a regular button for a split second before converting to the styling of the jquery theme. is there anyway to avoid this as it looks a bit messy. NOTE: i noticed that this is for anything that i am theming using jquery ui like autocomplete, button, etc. so its not button specific issue.

    Read the article

  • How can I revert a 'draggable' upon failed AJAX request?

    - by Frank
    I have a draggable div, that needs to be dropped on a droppable. If it is dropped correctly, the droppable calls an AJAX request. If the draggable does not have a valid id or the AJAX request fails, the draggable should be reverted to it's original position. Is that something that can be done with jQuery?! Any help is greatly appreciated!! $("div.draggable").livequery(function(){ $(this).draggable({ revert: 'invalid', distance: 20 }) }); $("#trash").droppable({ tolerance: 'touch', drop: function(event, ui) { var item = ui.draggable; var id = item.attr('id'); if (id) { $.ajax( { type: "POST", url: "delete.php", data: "id=" + id, success: function(html) { if (html) { item.remove(); } else { // FAILED AFTER AJAX // is it possible to revert the draggable from here?? } } }); } else { // FAILED BEFORE AJAX // is it possible to revert the draggable from here?? } } });

    Read the article

  • how to use TinyMCE(rich text editor) in google-maps info window..

    - by zjm1126
    this is the demo rar file:http://omploader.org/vM3U1bA when i drag the red block to the google-maps ,it will be changed to a marker, and it will has TinyMCE when you click the info window, but my program is : it can not be written when i click it the second time, the first time: the second time(can not be written): and my code is : <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=0.3,maximum-scale=5.0,user-scalable=yes"> </head> <body onload="initialize()" onunload="GUnload()"> <style type="text/css"> *{ margin:0; padding:0; } </style> <!--<div style="width:100px;height:100px;background:blue;"> </div>--> <div id="map_canvas" style="width: 500px; height: 300px;"></div> <div class=b style="width: 20px; height: 20px;background:red;position:absolute;left:700px;top:200px;"></div> <div class=b style="width: 20px; height: 20px;background:red;position:absolute;left:700px;top:200px;"></div> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script type="text/javascript" src="tiny_mce.js"></script> <script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"></script> <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA-7cuV3vqp7w6zUNiN_F4uBRi_j0U6kJrkFvY4-OX2XYmEAa76BSNz0ifabgugotzJgrxyodPDmheRA&sensor=false"type="text/javascript"></script> <script type="text/javascript"> var aFn; //********** function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); var center=new GLatLng(39.9493, 116.3975); map.setCenter(center, 13); aFn=function(x,y){ var point =new GPoint(x,y) point = map.fromContainerPixelToLatLng(point); //console.log(point.x+" "+point.y) var marker = new GMarker(point,{draggable:true}); var a=$( '<form method="post" action="" style="height:100px;overflow:hidden;width:220px;">'+ '<textarea id="" class="mce" name="content" cols="22" rows="5" style="border:none">sss</textarea>'+ '</form>') a.click(function(){ // }) GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(a[0]); }); /****************** GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml('<div contentEditable="true" ' + 'style="height: 100px; overflow: auto;">' + 'wwww</div>'); }); ***************/ map.addOverlay(marker); /********** var marker = new GMarker(point, {draggable: true}); GEvent.addListener(marker, "dragstart", function() { map.closeInfoWindow(); }); GEvent.addListener(marker, "dragend", function() { marker.openInfoWindowHtml("????..."); }); map.addOverlay(marker); //*/ } $(".b").draggable({ revert: true, revertDuration: 0 }); $("#map_canvas").droppable({ drop: function(event,ui) { //console.log(ui.offset.left+' '+ui.offset.top) aFn(event.pageX-$("#map_canvas").offset().left,event.pageY-$("#map_canvas").offset().top); } }); } } //********** $(".mce").live("click", function(){ var once=0; mce(); }); function mce(once){ if(once)return; tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", // Theme options theme_advanced_buttons1 : "bold,forecolor,|,justifyleft,justifycenter,justifyright,|,fontsizeselect", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_buttons4 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); once=1; } //********** </script> </body> </html>

    Read the article

  • Using jquery ui dialog to confirm action for form submission

    - by redbluegreen
    I have multiple forms on a page, for each of them I want the user to confirm before form submission. but when the user confirms to submit, how do I let this dialog know which form the user is sumbitting? Does it take custom parameters? Thanks. $("#dialog-confirm").dialog({ resizable: false, height:140, modal: true, buttons: { 'Confirm submit': function() { document.______???????_____.submit(); }, Cancel: function() { $(this).dialog('close'); } } }); $('.allForms').submit(function(){ $('#dialog-confirm').dialog('open'); });

    Read the article

  • Manually Dispatching a DocumentEvent for testing UI element validation code

    - by Bassam
    Hi. I'm testing a Swing GUI application using the UISpec4J testing framework. I'm testing validation code on a JTextField, but the framework does not support focus-change events, as it runs the application in a headless fashion. The text field has a DocumentEvent attached to it that activates the validation code. I'm trying to figure out how to dispatch the document event manually to activate the validation code. Trying to dispatch focus or mouse events manually haven't been working for me. Thanks for any help!

    Read the article

  • Getting the position of the element in a list when it's drag/dropped (ui.sortable)

    - by Wurlitzer
    Hi, I have a sortable list like this one: http://jqueryui.com/demos/sortable Is it possible to get the start and end position of the element in the list, when it has been moved? I'm talking about their position number, in the list. For example, if I move element 2 to position 5 in the list, I'd like to assign those two numbers to variables. I'm new to jQuery - any help would be much appreciated.

    Read the article

  • Design pattern to encapsulate common funtionality among UI controls

    - by Dan
    I'm brainstorming some ideas around a pattern to use for the following scenario. I have some 3rd party controls that I want to add common functionality to. Functionality is added by handling several of the the events and doing certain things when the events fire along with adding some private variables to hold some state info between events. I want to reuse the code and functionality so this is what I'd typically do. Create a class for this functionality and pass in the instance of the control that I want to add the functionality to in the constructor. Then I can add event handlers to the control in the instance of the class. Can anyone think of alternative patterns to use in order to create this kind of reusable functionality.

    Read the article

  • Generating jquery 'rules' from business model to UI in asp.net mvc

    - by jim
    Hi all, I've had a good look around and am certain that there's no matching question on SO, so here goes. Has anyone created a 'helper' method on their model that generates jquery (or plain javascript) rules validation dynamically, based on the criteria/rules that are contained within the object and taken from a repository (i.e. DB). What i'm thinking of is a discrete set of partial views (and associated models) that have rules at the business logic 'level' and rather than (or in combination with) validating the rule(s) at postback, translating the same rules into tightly focussed jquery methods that work identically at client (js) and server (c#) levels. I can see benefits here re performance. Also, the rules definitions could be created in a single place (in c#) and the jquery generated off of that, thus allowing single edits to update both code streams. I appreciate that there would be limitations imposed by language specific contstraints but the general principle could be quite interesting if used appropriately. I'm also aware that testibility could be an issue when using two different language structures and hoping to achieve similar test outcomes - but those aside... any thoughts or experiences of similar out there?? cheers jimi

    Read the article

  • "Correct" Dialog / UI font on Windows

    - by peterchen
    When creating a control (e.g. an edit control) on the fly using CreateWindow, it usually starts out with an ugly (boldish sans serif) font. Usually I wok around that by grabbing the parent dialog's font, and setting it to the control - I can't even say if this is a good idea. How do I "legally" fetch the right font?

    Read the article

  • Windows Phone: Updating backend datastore (via web service) while keeping UI very responsive

    - by will
    I am developing a Windows Phone app where users can update a list. Each update, delete, add etc need to be stored in a database that sits behind a web service. As well as ensuring all the operations made on the phone end up in the cloud, I need to make sure the app is really responsive and the user doesn’t feel any lag time whatsoever. What’s the best design to use here? Each check box change, each text box edit fires a new thread to contact the web service? Locally store a list of things that need to be updated then send to the server in batch every so often (what about the back button)? Am I missing another even easier implementation? Thanks in advance,

    Read the article

  • CQRS, Commands, Javascript

    - by Tolu
    I have an architecture where a task-based UI passes commands to a service layer. Now, my intention is to implement the UI in javascript, using KendoUI and the service layer, domain layer etc. in .NET. I'm also looking at future mobile implementations of the client that may use say Java rather than Javascript. If I define the commands in .NET, I'd like to know how to use them from my Javascript client so the client can communicate the commands appropriately to service layer. Do I have to use something like Apache Thrift for this i.e. to define the commands at both the client and service layer?

    Read the article

  • jquery.ui.tabs.js doesn't load tab data in IE9, Chrome - works perfectly fine in firefox

    - by Salma Khan
    I have few issues that I am facing on my site and I have no idea how to fix those. Please go to http://link.zambeel.ca/index.php/component/obituary/detail/52 and click on Photos tab, it doesn't load images promptly in IE9 and Chrome. I have made it work in firefox with the following code: var loadNextTab = function() { if (indexesToLoad.length == 0) return; var index = indexesToLoad.shift(); $("#tabs-1").tabs("load",index); }; $("#tabs-1").tabs({ cache: true, load: loadNextTab }); Please help me resolve this matter as soon as possible. Just to let you guys know, I am not a programmer by any means.

    Read the article

  • jQuery Accordion /Tabs - Call different function upon load of content

    - by Scott
    I have the following markup: <body> <div id="tabs" style="float: left"> <ul> <li><a href="ajax/question_0.html" title="Question 1"><span>Question 1</span></a></li> <li><a href="ajax/question_1.html" title="Question 2"><span>Question 2</span></a></li> <li><a href="ajax/question_2.html" title="Question 3"><span>Question 3</span></a></li> <li><a href="ajax/question_3.html" title="Question 4"><span>Question 4</span></a></li> <li><a href="ajax/question_4.html" title="Question 5"><span>Question 5</span></a></li> <li><a href="ajax/question_5.html" title="Question 6"><span>Question 6</span></a></li> </ul> <div id="dynamicContent"> </div> </div> <div class="demo-description"> <p>Click tabs to see answers to Questions</p> </div> </body> I would like to utilize an accordion or the tabs plugin from the UI. Upon completion of the load event, I'd like to call a JavaScript function, but a different function for each tab -- almost like calling onDocumentReady for a page. I have the following JavaScript: $(function() { $('#tabs').tabs().bind('tabsselect', function(event, ui) { console.log("Loading: ajax/question_" + ui.index + ".html"); return true; //Ensure that the tab gets selected }); ); That's properly loading the Ajax file and all, but whenever I attempt to do something such as evaluating a statement in the JS, it seems to be ignored. Is there any way I can do this, so that once the file is loaded my function is called -- needs to be a different function for each tab.

    Read the article

  • Why does System.Threading.Timer callback successfully update UI?

    - by Geo P
    I have several System.Threading.Timers on my form application with callbacks that update the UI...successfully - i.e. without throwing errors. I had built these earlier, before I knew that UI should not be updated on any thread other than the UI thread. Now I am confused as to why it does not throw cross-thread exceptions when I am updating UI on these separate threading.timer threads? I will be changing these callbacks so that the UI updates are invoked on UI thread, but I am curious as to why this works. Edit: My application is a WinForms Application.

    Read the article

  • Xcode 4: nib files not loading when run, can't find UI elements

    - by Jordan
    So, I just downloaded Xcode 4 and installed it. I was actually quite looking forward to the single window and integrated IB... - However, when I open and run one of my projects, the nib files that the project uses don't seem to load. Instead I'm left looking at a blank white screen (iPhone). This project ran well and fine on Xcode 3.2. So I thought... this can't be that hard to fix. So I opened up a nib file, thinking that maybe editing or creating a new one from scratch could point me in the right direction. But I can't find the old resources panel from interface builder anywhere. How am I meant to create a new view or add buttons? I know I'm probably just missing something obvious :s Did anyone else have the same nib file problems - is there a fix (or something stupidly simple that I'm forgetting about)? - EDIT: Ok. If I background and un-background the app, the view loads fine. But this happens every time I build, on both iPhone and iOS simulator, i.e. the app doesn't work properly until it's been backgrounded. All the code for loading the view follows from - (void)applicationDidFinishLaunching:(UIApplication *)application. Now I am really confused. - Thanks :)

    Read the article

  • Android - Memory leak when dynamically building UI with image resource backgrounds

    - by Rich
    I have an Activity that I swear is leaking memory. The app I'm working on does a lot with images, so I've had to be pretty stingy with memory when working directly with Bitmaps. I added an Activity, and now if you use this new Activity it basically puts me over the edge with mem usage and I end up throwing the "Bitmap exceeds VM budget" exception. If you never launch this Activity, everything is smooth as it was previously. I started reading about memory leaks, and I think that I have a similar situation to what is described in the article in the Android docs. I'm dynamically creating a bunch of image views and adding a BackgroundDrawable from the resources and adding an OnClickListener as well. I imagine I have to do some cleanup when the Activity hits onPause in its life cycle, but I'd like to know specifically what is the correct way. Here is the code that should demonstrate the objects I'm working with... LinearLayout templateContainer; . . . ImageView imgTemplatePreview = (ImageView) item.findViewById(R.id.imgTemplatePreview); . . . imgTemplatePreview.setBackgroundDrawable(getResources().getDrawable(previewId)); imgTemplatePreview.setOnClickListener(imgClick); templateContainer.addView(item);

    Read the article

  • Binding on a port with netpipes/netcat

    - by mindas
    I am trying to write a simple bash script that is listening on a port and responding with a trivial HTTP response. My specific issue is that I am not sure if the port is available and in case of bind failure I fall back to next port until bind succeeds. So far to me the easiest way to achieve this was something like: for (( i=$PORT_BASE; i < $(($PORT_BASE+$PORT_RANGE)); i++ )) do if [ $DEBUG -eq 1 ] ; then echo trying to bind on $i fi /usr/bin/faucet $i --out --daemon echo test 2>/dev/null if [ $? -eq 0 ] ; then #success? port=$i if [ $DEBUG -eq 1 ] ; then echo "bound on port $port" fi break fi done Here I am using faucet from netpipes Ubuntu package. The problem with this is that if I simply print "test" to the output, curl complains about non-standard HTTP response (error code 18). That's fair enough as I don't print HTTP-compatible response. If I replace echo test with echo -ne "HTTP/1.0 200 OK\r\n\r\ntest", curl still complains: user@server:$ faucet 10020 --out --daemon echo -ne "HTTP/1.0 200 OK\r\n\r\ntest" ... user@client:$ curl ip.of.the.server:10020 curl: (56) Failure when receiving data from the peer I think the problem lies in how faucet is printing the response and handling the connection. For example if I do the server side in netcat, curl works fine: user@server:$ echo -ne "HTTP/1.0 200 OK\r\n\r\ntest\r\n" | nc -l 10020 ... user@client:$ curl ip.of.the.server:10020 test user@client:$ I would be more than happy to replace faucet with netcat in my main script, but the problem is that I want to spawn independent server process to be able to run client from the same base shell. faucet has a very handy --daemon parameter as it forks to background and I can use $? (exit status code) to check if bind succeeded. If I was to use netcat for a similar purpose, I would have to fork it using & and $? would not work. Does anybody know why faucet isn't responding correctly in this particular case and/or can suggest a solution to this problem. I am not married neither to faucet nor netcat but would like the solution to be implemented using bash or it's utilities (as opposed to write something in yet another scripting language, such as Perl or Python).

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >