Search Results

Search found 1057 results on 43 pages for 'modal'.

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

  • JQuery, JSF and a4j:commandLink

    - by JQueryNeeded
    Hello ppl, I have a problem with using jQuery Dialog and Ajax submit in JSF. I have the following code for displaying Dialog windows: <script type="text/javascript"> jQuery(function(){ // Dialog jQuery('#dialog').dialog({ dialogClass: 'alert', autoOpen: false, width: 300, height: 150, modal: true, resizable: false, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { "Ok": function() { jQuery(this).dialog("close"); return true; }, "Cancel": function() { jQuery(this).dialog("close"); return false; } } }); // Dialog Link jQuery('#dialog_link').click(function(){ jQuery('#dialog').dialog('open'); return false; }) .hover( function() { jQuery(this).addClass('ui-hover-state'); }, function() { jQuery(this).removeClass('ui-hover-state'); } ); }); </script> It works as it should - it displays box when link is clicked. Now, I have something like this, for deleting something: <a4j:commandLink actionListener="#some.action" reRender="something" onclick="if(!jQuery('#dialog').dialog('open')){return false}" ok, this commandLink is rendered as follows: <a href="#" id="some:long:id:j_id338" name="formName:something:j_id338" onclick="if(!jQuery('#dialog').dialog('open')){return false};A4J.AJAX.Submit('something:something'); return false;" >drop</a> now, after displaying the dialog box, the A4j.AJAX.Submit(..) is executed, is there anyway, that I can for example, pass the whole A4J.AJAX.Submit(...) to "dialog" and execute it from "ok" option? I simply need to execute submit if and only if user clicks OK. Thank you for help JQ

    Read the article

  • Force Postback from code behind? Or reload JavaScript from an Asynchronous Postback?

    - by sah302
    Hi all, I've got a Jquery UI dialog that pops up to confirm the creation of an item after filling out a form. I have the form in an update panel due to various needs of the form, and especially because I want validation being done on the form without reloading the page. JavaScript appears to not reload on an asynchronoous postback. This means when the form is a success and I change the variable 'formSubmitPass' to true, it does not get passed to the Javascript via <%= formSubmitPass %. If I add a trigger to the submit button to do a full postback, it works. However I don't want the submit button to do a full postback as I said so I can validate the form within the update panel. How can I have this so my form validates asynchronously, but my javaScript will properly reload when the form is completed successfully and the item is saved to the database? Javascript: var formSubmitPass = '<%= formSubmitPass %>'; var redirectUrl = '<%= redirectUrl %>'; function pageLoad() { $('#formPassBox').dialog({ autoOpen: false, width: 400, resizable: false, modal: true, draggable: false, buttons: { "Ok": function() { window.location.href = redirectUrl; } }, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); var t = window.setTimeout("goToUrl()", 5000); } }); if(formSubmitPass == 'True') { $('#formPassBox').dialog({ autoOpen: true }); } So how can I force a postback from the code behind, or reload the JavaScript on an Asynchronous Postback, or do this in a way that will work such that I can continue to do Async form validation? Edit: I change formSubmitPass at the very end of the code behind: If errorCount = 0 Then formSubmitPass = True upForm.Update() Else formSubmitPass = False End If So on a full postback, the value does change.

    Read the article

  • VB .NET DirectCast and Type Reflection

    - by msarchet
    The application that I am working on has a generic Parent Form called RSChild, that is used to perform some operations depending on whether or not the control that is contained within it is in a MdiTabManager or inside of its own modal form. Then the actual User Controls contained within Inherit from a Interface Called ObjectEdit (Objects that we allow to be edited). At a point in my code I am doing this. Public Function doesTabExist(ByVal id As Integer, ByVal recordType As Enums.eRecordType) As Boolean Dim alikePages As Object = (From tabs In DirectCast(Control.FromHandle(MainForm.SharedHandle), MainForm).XtraTabbedMdiManager1.Pages Where DirectCast(tabs.MdiChild, RSChild).RSObject.RecordType = recordType Select tabs) For Each page As DevExpress.XtraTabbedMdi.XtraMdiTabPage In alikePages Select Case recordType Case Enums.eRecordType.Doctor If id = DirectCast(castTabPageToRSChild(page).RSObject, UI.Doctor).ID Then pageToActive(page) Return True End If 'rest of the cases so the case block is repeated 10 times' End Function And my castTabPageToRSChild(page) is a lambda function as Such Dim castTabPageToRSChild As Func(Of DevExpress.XtraTabbedMdi.XtraMdiTabPage, RSChild) = Function(page) DirectCast(page.MdiChild, RSChild) So my Question is, I have about 10 case statements, all because I can't seem to find a way to use reflection to get the underlying Type of the RSObject Object. So I have the whole If block repeated over and over. I tried doing castTabPageToRSChild(page)RSObject.GetType and using that in the DirectCast and I also tried creating another object that was separate from that and doing the same thing. My code works as intended I'm just trying to see if there is a manner in which I didn't have a lot of replicated code. My vision would be to do something like For Each page As XtraMdiTabPage In alikePages If id = DirectCast(castTabPageToRSchild(page).RSObject, TypeOfThatObject).Id Then Return True Next However I have a feeling this is not possible due to the behavior of DirectCast.

    Read the article

  • Pause code execution until UIAlertView button is pressed?

    - by JuBu1324
    One of my methods sends a message to an object (what do you know about that), and expects a BOOL for an answer. However, BOOL answer it is expecting is based on the answer to a UIAlertView created in the receiving object's method. However, the code doesn't pause while waiting for the user to answer the UIAlertView. My problem is: how do I use -alertView:clickedButtonAtIndex in the method's return value? Here's the code the message runs (in this construction, I was expecting navigateAwayFromTab to change based on the user input in the UIAlertView, but it never gets a chance): - (BOOL)readyToNavigateAwayFromTab { NSLog( @"message received by Medical View"); navigateAwayFromTab = NO; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Navigate Away From Tab?" message:@"Navigating away from this tab will save your work." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil ]; [alert show]; [alert release]; return navigateAwayFromTab; } #define CANCEL 0 #define OK 1 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if( buttonIndex == OK ) navigateAwayFromTab = YES; } I've been reading up on the modal UIAlertView debate, and I agree with apple's implementation - at lest as the rule. However, in this case I don't see any way of solving the problem by putting code in -alertView:clickedButtonAtIndex because I don't need to run code based on the UIAlertView, I just need to read the response. Any suggestions on how I can reach my gaol? I've tried a while loop after [alert show] already, but then the alert doesn't even show then, and for a number of reasons I can't use -viewWillDisapear.

    Read the article

  • How to ajax load a parent-child listbox in JQuery/Asp.net MVC popup?

    - by melaos
    hi guys, i'm new to the asp.net mvc. and i have a link which will popup show a 3 panes listbox which allows the user to select country, region and language. and when the user click on the language, this will redirect back to the controller and refresh the page and show the proper localized content. i was thinking of using a jquery dialog/modal to do this but so i try using fancybox for this which will load the hidden div of the three listbox up. unfortunately, on clicking on the first listbox, the page will call a jquery event which will show the populate the 2nd list box in which the lightbox will close. is there a better way to do this? or i'm not using the proper jquery plugin? i was thinking of putting the whole three panes inside a html file and do ajax call to get the content into that page and load the listbox like that and just use the html popup like a normal popup. Any suggestions? i'm stuck, help!!

    Read the article

  • ASP.NET validation not executing in a JavaScript showModalDialog call

    - by Michael Kniskern
    I currently open a pop up window from my parent page using using a JavaScript .showModalDialog function. The pop up window contains some ASP.NET validation controls which do not display when the user clicks the ASP.NET button to submit the form. If there is an error on the page, the validation message(s) do not display, the record is not updated on the server side and the pop window closes. (The asp.net validation controls do not stop the pop up window from doing a server postback) Has anyone expereinced this behavior before and is there any way to prevent it? Here is my showModalDialong call source code: function OpenChildWindow(id) { var sFeatures = sFeatures="dialogHeight: 525px;"; sFeatures += "dialogWidth: 900px;"; sFeatures += "scroll: yes;"; sFeatures += "status: no;"; sFeatures += "resizeable: no;"; var url = "MyPopUp.aspx?ID=" + id; var childName = "ChildForm"; entryWindow = window.showModalDialog(url, childName, sFeatures); if (entryWindow == true) { window.document.getElementById("<%= btnUpdateParent.ClientID %>").click(); } } Note: When the pop up modal is closed, a ASP.NET button is "clicked" to update an ASP.NET UpdatePanel on the parent to show the changes to the record modified in the pop up window.

    Read the article

  • RichFaces demo dataTableScrollerBean.java location

    - by Mark Lewis
    Hello, I've noticed from here that the contents is only the header Revision 16532: /tags/3.3.2.SR1/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller and no listing of the dataTableScrollerBean.java file which the Edit Table/Modal Panel demo JSF code refers to. Where can I access it? I'd like to try the demo out on my machine. I've posted to RichFaces but SO tends to respond faster. Thanks Mark EDIT I've found some code (here) on a forum fortunately which is as close as I've come so far. Looks like it was written by one of the RichFaces authors, but when I included it, Eclipse is complaining about the Facet object which together with another forum and these import javax.ejb.Stateful; import javax.ejb.Stateless; suggest I may be missing j2ee.jar. But I'm running this out of Tomcat which is not an ejb container. I didn't think this RichFaces component required JBoss or equivalent so I must be doing something wrong. All I'm trying to do is try out an Edit Table! Thanks

    Read the article

  • Why does navigationItem.titleView align left when presentmodalviewcontroller called?

    - by jm333
    I'm using a UILabel for the titleView of a navigation bar (I'm making simple in-app web browser). It works fine, except that when I present a modal view controller, the titleView shifts from the center of the navbar to the far left (underneath the back button). I've tested in 3.0 and up. Here is relevant code: - (void)viewDidLoad { [super viewDidLoad]; // Title view label CGRect labelFrame = CGRectMake(0.0, 0.0, 120.0, 36.0); UILabel *label = [[[UILabel alloc] initWithFrame:labelFrame] autorelease]; label.font = [UIFont boldSystemFontOfSize:14]; label.numberOfLines = 2; label.backgroundColor = [UIColor clearColor]; label.textAlignment = UITextAlignmentCenter; label.textColor = [UIColor whiteColor]; label.shadowColor = [UIColor blackColor]; label.shadowOffset = CGSizeMake(0.0, -1.0); label.lineBreakMode = UILineBreakModeMiddleTruncation; self.navigationItem.titleView = label; } -(void)displayComposerSheet:(NSString*)mailto { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [self presentModalViewController:picker animated:YES]; [picker release]; } Screenshots: http://img689.imageshack.us/img689/7968/titleviewshift.jpg Any idea why this is happening? Thanks.

    Read the article

  • jQuery / jEditable and jQuery UI Dialog. Re-populating table cell.

    - by solefald
    Hello, this is my first time using JS, so i really have no idea what i am doing. I have a table with data, and using jEditable to allow a user to edit the data and POST it to my php script. When user hits "Save", it opens jQuery UI with the data from php script and it seems to work fine, however, if the user hits Cancel or Esc to close the jQuery UI dialog, they and up back on the page, but the cell they tried to edit is now completely empty. How do i get the cell re-populated? Thank you! $(".editable_textarea").editable("/path/to/my/scrip.php", { indicator : "<img src='/images/indicator.gif'>", type : 'textarea', submitdata: { _method: "post", uri: "<?php echo $this->uri->segment(3); ?>" }, select : false, submit : 'Save', cancel : 'Cancel', tooltip : "Click to edit...", cssclass : "editable", onblur: "cancel", cssclass: "edit_destination", callback: function(value, settings) { $(this).dialog({ autoOpen: true, width: 400, modal: true, position: "center", resizable: false, draggable: false, title: "Pending Changes", buttons: { "Cancel": function() { $(this).dialog("close"); }, "Confirm Changes": function() { document.findSameDestination.submit(); } } }); $('form#findSameDestination').submit(function(){ $(this).dialog('open'); return false; }); $(this).editable("disable"); }, data: function(value, settings) { var retval = value.replace(/<br[\s\/]?>/gi, '\n'); retval = retval.replace(/(<([^>]+)>)/gi, ''); return retval; } });

    Read the article

  • How to check if returning View is of type PartialViewResult or a ViewUserControl

    - by mare
    In the method FindView() I have to somehow check if the View we are requesting is a ViewUserControl. Because otherwise I get an error saying: "A master name cannot be specified when the view is a ViewUserControl." This is my custom view engine code right now: public class PendingViewEngine : VirtualPathProviderViewEngine { public PendingViewEngine() { // This is where we tell MVC where to look for our files. /* {0} = view name or master page name * {1} = controller name */ MasterLocationFormats = new[] {"~/Views/Shared/{0}.master", "~/Views/{0}.master"}; ViewLocationFormats = new[] { "~/Views/{1}/{0}.aspx", "~/Views/Shared/{0}.aspx", "~/Views/Shared/{0}.ascx", "~/Views/{1}/{0}.ascx" }; PartialViewLocationFormats = new[] {"~/Views/{1}/{0}.ascx", "~/Views/Shared/{0}.ascx"}; } protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath) { return new WebFormView(partialPath, ""); } protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath) { return new WebFormView(viewPath, masterPath); // this line produces the error because we cannot set master page on ASCXs, so I need an "if" here } public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) { if (controllerContext.HttpContext.Request.IsAjaxRequest()) return base.FindView(controllerContext, viewName, "Modal", useCache); return base.FindView(controllerContext, viewName, "Site", useCache); } } The above ViewEngine fails on calls like this: <% Html.RenderAction("Display", "MyController", new { zoneslug = "some-zone-slug" });%> The action I am rendering here is this: public ActionResult Display(string zoneslug) { WidgetZone zone; if (!_repository.IsUniqueSlug(zoneslug)) zone = (WidgetZone) _repository.GetInstance(zoneslug); else { // do something here } // WidgetZone used here is WidgetZone.ascx, so a partial return View("WidgetZone", zone); } I cannot use RenderPartial because you cannot send route values to RenderPartial the way you can to RenderAction. To my knowledge there is no way to provide RouteValueDictionary to RenderPartial() like the way you can to RenderAction().

    Read the article

  • TinyMCE is glitchy in IE8

    - by Force Flow
    I'm using the jQuery version of TinyMCE 3.3.9.3 In firefox, it works fine (10 sec video depicting it in use): http://www.youtube.com/watch?v=TrAE0igfT3I In IE8 (in IE8 standards mode), I can't type or click any buttons. However, if I use ctrl+v to paste, then I can start typing, but the buttons still don't work (a 45 sec video depicting it in use): http://www.youtube.com/watch?v=iBSRlE8D8F4 The jQuery TinyMCE demo on TinyMCE's site works for me in IE8. Here's the init code: $().ready(function(){ function tinymce_focus(){ $('.defaultSkin table.mceLayout').css({'border-color' : '#6478D7'}); $('.defaultSkin table.mceLayout tr.mceFirst td').css({'border-top-color' : '#6478D7'}); $('.defaultSkin table.mceLayout tr.mceLast td').css({'border-bottom-color' : '#6478D7'}); } function tinymce_blur(){ $('.defaultSkin table.mceLayout').css({'border-color' : '#93a6e1'}); $('.defaultSkin table.mceLayout tr.mceFirst td').css({'border-top-color' : '#93a6e1'}); $('.defaultSkin table.mceLayout tr.mceLast td').css({'border-bottom-color' : '#93a6e1'}); } $('textarea.tinymce').tinymce({ script_url : 'JS/tinymce/tiny_mce.js', theme : "advanced", mode : "exact", theme : "advanced", invalid_elements : "b,i,iframe,font,input,textarea,select,button,form,fieldset,legend,script,noscript,object,embed,table,img,a,h1,h2,h3,h4,h5,h6", //theme options theme_advanced_buttons1 : "cut,copy,paste,pastetext,pasteword,selectall,|,undo,redo,|,cleanup,removeformat,|", theme_advanced_buttons2 : "bold,italic,underline,|,bullist,numlist,|,forecolor,backcolor,|", theme_advanced_buttons3 : "", theme_advanced_buttons4 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "none", theme_advanced_resizing : false, //plugins plugins : "inlinepopups,paste", dialog_type : "modal", paste_auto_cleanup_on_paste : true, setup: function(ed){ ed.onInit.add(function(ed){ //check for addEventListener -- primarily supported by firefox only var edDoc = ed.getDoc(); if ("addEventListener" in edDoc){ edDoc.addEventListener("focus", function(){ tinymce_focus(); }, false); edDoc.addEventListener("blur", function(){ tinymce_blur(); }, false); } }); } }); }); Any ideas as to why it's not working in IE8?

    Read the article

  • Capture keystrokes (e.g., function keys) while a messagebox is up

    - by FastAl
    We have a large WinForms app, and there is a built-in bug reporting system that can be activated during testing via the F5 Key. I am capturing the F5 key with .Net's PreFilterMessage system. This works fine on the main forms, modal dialog boxes, etc. Unfortunately, the program also displays windows messageboxes when it needs to. When there is a bug with that, e.g., wrong text in the messagebox or it shouldn't be there, the messagefilter isn't executed at all when the messagebox is up! I realize I could fix it by either rewriting my own messagebox routine, or kicking off a separate thread that polls GetAsyncKeyState and calls the error reporter from there. However I was hoping for a method that was less of a hack. Here's code that manifests the problem: Public Class Form1 Implements IMessageFilter Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click MsgBox("now, a messagebox is up!") End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Application.AddMessageFilter(Me) End Sub Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) _ As Boolean Implements IMessageFilter.PreFilterMessage Const VK_F5 As Int32 = &H74 Const WM_KEYDOWN As Integer = &H100 If m.Msg = WM_KEYDOWN And m.WParam.ToInt32 = VK_F5 Then ' In reality code here takes a screenshot, saves the program state, and shows a bug report interface ' IO.File.AppendAllText("c:\bugs.txt", InputBox("Describe the bug:")) End If End Function End Class Many thanks.

    Read the article

  • Javascript Print Script Not Working in IE

    - by TY
    Greets! I'm a noob struggling to learn html and javascript - getting there slowly. I'm trying to print a DIV served up by SimpleModal. The page is at: www.planetsarsfield.com This "Print" function is in the recipe box at the bottom. Everything works great in FF, but it doesn't work at all in IE8. I must be doing something fundamentally wrong but I can't spot it. Any ideas? Cheers, TY ++++++++++++++++++++++++++++++++++++++++++++++++ <script type="text/javascript"> function PrintElem(elem) { Popup($(elem).html()); } function Popup(data) { var mywindow = window.open('', 'basic-modal-content', 'height=400,width=600'); mywindow.document.write('<html><head><title>on the grill... latest recipe</title>'); mywindow.document.write('<link href="PATH/print.css" rel="stylesheet" type="text/css" />') mywindow.document.write('</head><body >'); mywindow.document.write(data); mywindow.document.write('</body></html>'); mywindow.document.close(); mywindow.print(); return true; } </script>

    Read the article

  • bootstrap: Uncaught TypeError: Object [object Object] has no method 'tooltip', 'typeahead'

    - by DarkKnightFan
    I am trying to use the tooltip, typeahead, datepicker features of bootstrap. But I keep getting these errors in the console! Uncaught TypeError: Object [object Object] has no method 'tooltip' Uncaught TypeError: Object [object Object] has no method 'typeahead' This is how my imports look like: <link href="css/bootstrap.css" rel="stylesheet"> <link href="css/datepicker.css" rel="stylesheet"> <link href="css/bootstrap-responsive.css" rel="stylesheet"> <script type="text/javascript" src="js/jquery-1.8.0.js"></script> <script type="text/javascript" src="js/bootstrap.js"></script> <script type="text/javascript" src="js/bootstrap-datepicker.js"></script> <script type="text/javascript" src="js/bootstrap-typeahead.js"></script> <script type="text/javascript" src="js/highcharts.js"></script> <script type="text/javascript" src="js/exporting.js"></script> <link type="text/css" rel="stylesheet" href="css/jquery.dropdown.css" /> <script type="text/javascript" src="js/jquery.dropdown.js"></script> Some sample code: <a class="btn btn-success" data-toggle="modal" href="#payments" rel="tooltip" data-placement="top" title="Record your payments"> <i class="icon-check icon-white"></i> Payments</a> $("#payments").tooltip('show'); Similarly I have code for datepicker and typeahead. any solution?

    Read the article

  • jQuery autopopulate select drop down from JSON issues

    - by Jonathon Joyce
    I have an issue regarding to auto populating a select dropdown from jQuery/JSON data which is return from a ColdFusion CFC, the code is below: $(function(){ $("#licences-add").dialog({autoOpen:false,modal:true,title:'Add Licences',height:250,width:380}); }); function openAddLicence(intInstanceID,szName,szDatasourceName){ $.getJSON('/ASPAdmin/billing/handler.cfc?method=ListLicenceTypes&queryformat=column',{szInstanceDatasource:szDatasourceName}, function(data){ $.each(data,function(){ $('<option></option>').val(data.DATA.UUIDLICENCETYPE).text(data.DATA.SZLICENCETYPE).appendTo('#uuidLicenceType'); }); }); $("#intInstanceID").attr('value', intInstanceID); $('span#szInstanceName').text(szName); $("#licences-add").dialog('open');}; The json returned is: {"ROWCOUNT":1,"COLUMNS":["UUIDLICENCETYPE","SZLICENCETYPE"],"DATA":{"UUIDLICENCETYPE":["480CE560-BCD3-C7AC-AF50B3C71BBCC473"],"SZLICENCETYPE":["Standard"]}} However i get the following error: $("").val(this.UUIDLICENCETYPE).text is not a function Any ideas? HTML: <tr> <td><label for="uuidLicenceType" title="Select the licence type (required).">Licence Type</label> <span class="req">*</span></td> <td> <select name="uuidLicenceType" id="uuidLicenceType" class="bmSelect"> <option value=""></option> </select> </td> </tr>

    Read the article

  • Help with pregreplace and uniqid for jquery dialog boxes

    - by Scarface
    First of all, do not be overwhelmed by the long code, I just put it for reference...I have a function that runs preg_replace on each comment users post and puts matches in a jquery dialog box with a matching open-link. For example, if there is a paragraph with two matches, they will be put inside two divs, and a jquery dialog function will be echoed twice; one for each div. While this works for one match, if there are multiple matches, it does not. I am not sure how to distribute unique ids at a point in time for each of the divs and matching dialog open-scripts. Keep in mind, I removed the preg replace function since it kind of complicates the problem. If anyone has any ideas, they will be greatly appreciated. <?php $id=uniqid(); $id2=uniqid(); echo "<div id=\"$id2\"> </div>"; ?> $.ui.dialog.defaults.bgiframe = true; $(function() { $("<?php echo"#$id2"; ?>").dialog({hide: 'clip', modal: true ,width: 600,height: 350,position: 'center', show: 'clip',stack: true,title: 'title', minHeight: 25, minWidth: 100, autoOpen: false}); $('<?php echo"#$id"; ?>').click(function() { $('<?php echo"#$id2"; ?>').dialog('open'); }) .hover( function(){ $(this).addClass("ui-state-hover"); }, function(){ $(this).removeClass("ui-state-hover"); } ).mousedown(function(){ $(this).addClass("ui-state-active"); }) .mouseup(function(){ $(this).removeClass("ui-state-active"); }); });

    Read the article

  • Photo gallery not open in titanium 1.0

    - by user291247
    Hello, I am developing new app. using titanium 1.0 In that I am opening phtogallery in new window but I am not able to open it why this was happened? Code to open photogallery in app.js Titanium.App.addEventListener('recordvideo', function(e) { win1.close(); var w = Titanium.UI.createWindow({ backgroundColor:'#336699', title:'Modal Window', barColor:'black', url:'xhr_testfileupload.js' }); w.open({animated:true}); }); xhr_testfileupload.js code: var win = Titanium.UI.currentWindow; var ind=Titanium.UI.createProgressBar({ width:200, height:50, min:0, max:1, value:0, style:Titanium.UI.iPhone.ProgressBarStyle.PLAIN, top:10, message:'Uploading Image', font:{fontSize:12, fontWeight:'bold'}, color:'#888' }); win.add(ind); ind.show(); Titanium.Media.openPhotoGallery({ success:function(event) { Ti.API.info("success! event: " + JSON.stringify(event)); var image = event.media; var xhr = Titanium.Network.createHTTPClient(); xhr.onerror = function(e) { Ti.API.info('IN ERROR ' + e.error); }; xhr.onload = function() { Ti.API.info('IN ONLOAD ' + this.status + ' readyState ' + this.readyState); }; xhr.onsendstream = function(e) { ind.value = e.progress ; Ti.API.info('ONSENDSTREAM - PROGRESS: ' + e.progress); } // open the client xhr.open('POST','https://twitpic.com/api/uploadAndPost'); // send the data xhr.send({media:image,username:'fgsandford1000',password:'sanford1000',message:'check me out'}); }, cancel:function() { }, error:function(error) { }, allowImageEditing:true, });

    Read the article

  • pushViewController Not Displaying UIView/Nib with tabbar and nav bar

    - by james
    I'm relatively new to objective c but not programming and am stuck with my iphone app. I created a nav based app with both a navbar and a tab bar controller. I set the tab bar as the root controller. I'm able to switch between each tab without any issues to various UIViews and UITableViews. My issue is that in one of my UITableViews that I call from the TabBarController, didSelectRowAtIndexPath function is suppose to display a new UIView. The below code does not give any errors and runs fine but does not show the new Nib. if(newViewController == nil) { NSLog(@"yes nil"); BookViewController *aNewViewController = [[BookViewController alloc] initWithNibName:@"BookOptionView" bundle:nil]; self.newViewController = aNewViewController; [aNewViewController release]; } BookAppDelegate *delegate = (BookAppDelegate *)[[UIApplication sharedApplication] delegate]; [delegate.appNavBar pushViewController:newViewController animated:YES]; Now when I do the below, it works fine but it gets rid of the nav and tab which I'm assuming because its a modal call instead of pushing the view controller. BookViewController *screen = [[BookViewController alloc] initWithNibName:@"BookOptionView" bundle:[NSBundle mainBundle]]; screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:screen animated:YES]; [screen release]; Any ideas why I can't get the View Controller to push correctly? In my application delegate file, I declared an AppNavBarController object (inherit from UINavigationController) called appNavBar. Any help would be appreciated!

    Read the article

  • Custom view in iPhone SDK gets placed incorrectly in realation to statusbar

    - by markqvist
    (ragh, i'm apparently not allowed to post images, so i have included links to the images in this post instead of embedding them) Im writing an iPhone application based on the navigation controller template, but I am not loading the actual navigation controller as the first view in the window. I create a new view controller from a xib, and then add that as a subview, and then only push the navigation view as a modal when i need it. Here's my application: didFinishLaunching ... method in the application deleate RootViewController *rootViewController = (RootViewController *)[navigationController topViewController]; rootViewController.managedObjectContext = self.managedObjectContext; mainViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:[NSBundle mainBundle]]; mainViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [window addSubview:[mainViewController view]]; [[mainViewController view] setNeedsLayout]; [window makeKeyAndVisible]; return YES; It works but the view is not properly aligned with the statusbar: http://img.exdev.dk/1.png When i click "my ambiances" and push the navigation controller view, and then dismiss it again, the layout is fine: same link as above, just replace the 1 with a 2. Sorry for the hassle, apparently I can also only post one link.... Here's the code I use for presenting/dismissing the navigationcontroller: -(void)pushMyAmbiences { [mainViewController presentModalViewController:navigationController animated:TRUE]; } -(void)returnToMainView { [mainViewController dismissModalViewControllerAnimated:TRUE]; } Is there anything I'm missing here? Layout-wise? Something that needs to be set in the xib? In a vain attempt I tried calling setNeedsLayout on the view, no luck. Any help is greatly appreciated!

    Read the article

  • Javascript error when integrating django-tinymce and django-filebrowser

    - by jwesonga
    I've set up django-filebrowser in my app without any bugs, I already had django-tinymce set up and it loads the editor in the admin forms. I now want to use django-filebrowser with django-tinymce, but I keep getting a weird javascript error when I click on "Image URL" in the Image popup: r is undefined the error is js/tiny_mce/tiny_mce.js My settings.py file has the following configuration: TINYMCE_JS_URL=MEDIA_URL + 'js/tiny_mce/tiny_mce.js' TINYMCE_DEFAULT_CONFIG = { 'mode': "textareas", 'theme': "advanced", 'language': "en", 'skin': "o2k7", 'dialog_type': "modal", 'object_resizing': True, 'cleanup_on_startup': True, 'forced_root_block': "p", 'remove_trailing_nbsp': True, 'theme_advanced_toolbar_location': "top", 'theme_advanced_toolbar_align': "left", 'theme_advanced_statusbar_location': "none", 'theme_advanced_buttons1': "formatselect,styleselect,bold,italic,underline,bullist,numlist,undo,redo,link,unlink,image,code,template,visualchars,fullscreen,pasteword,media,search,replace,charmap", 'theme_advanced_buttons2': "", 'theme_advanced_buttons3': "", 'theme_advanced_path': False, 'theme_advanced_blockformats': "p,h2,h3,h4,div,code,pre", 'width': '700', 'height': '300', 'plugins': "advimage,advlink,fullscreen,visualchars,paste,media,template,searchreplace", 'advimage_update_dimensions_onchange': True, 'file_browser_callback': "CustomFileBrowser", 'relative_urls': False, 'valid_elements' : "" + "-p," + "a[href|target=_blank|class]," + "-strong/-b," + "-em/-i," + "-u," + "-ol," + "-ul," + "-li," + "br," + "img[class|src|alt=|width|height]," + "-h2,-h3,-h4," + "-pre," + "-code," + "-div", 'extended_valid_elements': "" + "a[name|class|href|target|title|onclick]," + "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]," + "br[clearfix]," + "-p[class<clearfix?summary?code]," + "h2[class<clearfix],h3[class<clearfix],h4[class<clearfix]," + "ul[class<clearfix],ol[class<clearfix]," + "div[class]," } TINYMCE_FILEBROWSER = False TINYMCE_COMPRESSOR = False i've tried switching back to older versions of tinyMCE Javascript but nothing seems to work. Would appreciate some help

    Read the article

  • Ajax call to parent window after form submission

    - by David
    Hi all, Pardon the complicated title. Here's my situation: I'm working on a Grails app, and using jQuery for some of the more complex UI stuff. The way the system is set up, I have an item, which can have various files (user-supplied) associated with it. On my Item/show view, there is a link to add a file. This link pops up a jQuery modal dialog, which displays my file upload form (a remote .gsp). So, the user selects the file and enters a comment, and when the form is submitted, the dialog gets closed, and the list of files on the Item/show view is refreshed. I was initially accomplishing this by adding onclick="javascript:window.parent.$('#myDialog').dialog('close');" to my submit button. This worked fine, but when submitting some larger files, I end up with a race condition where the dialog closes and the file list is refreshed before the new file is saved, and so the list of files is out of date (the file still gets saved properly). So my question is, what is the best way to ensure that the dialog is not closed until after the form submit operation completes? I've tried using the <g:formRemote tag in Grails, and closing the dialog in the "after" attribute (according to the Grails docs, the script is called after form submission), but I receive an error (taken from FireBug) stating that window.parent.$('#myDialog').dialog is not a function Is this a simple JavaScript/Grails syntax issue that I'm missing here, or am I going about this entirely wrong? Thanks so much for your time and assistance!

    Read the article

  • FireFox Toolbar Prefwindow unload/acceptdialog Event to Update the toolbar

    - by Mark
    Hi all, I'm trying to develop a firefox toolbar ;) so my structure is In the options.xul is an PrefWindow which i'm opening over an <toolbarbutton oncommand="esbTb_OpenPreferences()"/> function esbTb_OpenPreferences() { window.openDialog("chrome://Toolbar/content/options.xul", "einstellungen", "chrome,titlebar,toolbar,centerscreen,modal", this);} so in my preferences i can set some checkboxes which indicates what links are presented in my toolbar. So when the preferences window is Closed or the "Ok" button is hitted I want to raise an event or an function which updates via DOM my toolbar. So this is the function which is called when the toolbar is loaded. It sets the links visibility of the toolbar. function esbTB_LoadMenue() { var MenuItemNews = document.getElementById("esbTb_rss_reader"); var MenuItemEservice = document.getElementById("esbTb_estv"); if (!(prefManager.getBoolPref("extensions.esbtoolbar.ShowNews"))) { MenuItemNews.style.display = 'none'; } if (!(prefManager.getBoolPref("extensions.esbtoolbar.ShowEservice"))) { MenuItemEservice.style.display = 'none'; } } So I tried some thinks like adding an eventlistener to the dialog which doesn't work... in the way I tried... And i also tried to hand over the window object from the root window( the toolbar) as an argument of the opendialog function changed the function to this. function esbTB_LoadMenue(RootWindow) { var MenuItemNews = RootWindow.getElementById("esbTb_rss_reader"); var MenuItemEservice = RootWindow.getElementById("esbTb_estv");} And then tried to Access the elements over the handover object, but this also not changed my toolbar at runtime. So what i'm trying to do is to change the visibile links in my toolbar during the runtime and I don't get it how I should do that... thanks in advance

    Read the article

  • destroy cfwindow in javascript 'is not a function'

    - by Ryan French
    Hi All, Having an issue here that I have tried everything I can think of but cant get it to work. I have a page with a link that creates a cfwindow like so function create_window(ID){ var config = new Object(); config.modal=true; config.center=true; config.height=775; config.width=700; config.resizable=false; config.closable=false; config.draggable=false; config.refreshonshow=true; ColdFusion.Window.create('newWindow','Window Title', '/source/url'+ID, config) The window is created and the URL has the ID parsed to it that is used for displaying the correct item in the window. This all works fine. The problem is when I try and close the window and open a new window with a different item being displayed, the URL is not changed. I realise that this is because the window is being hidden, and not destroyed, and therefore it is the same window being opened. So I have created an onHide event handler to destroy the window like so. function showItemDetails(){ var ID=document.getElementById("sList").value create_window(ID); ColdFusion.Window.onHide('newWindow', refreshList); } function refreshList(){ ColdFusion.bindHandlerCache['sList'].call(); ColdFusion.Window.destroy('newWindow',true); } Now when I close the window Firebug is returning the error "ColdFusion.Window.destroy is not a function" (In IE the error is "Object doesn't support this property or method"). I have made sure we are running the latest version of ColdFusion 8.01 on the server (as I know that .destroy wasnt added until 8.01) and have applied the latest hotfixes to the server as well. Any ideas?

    Read the article

  • Jquery button.click bug?

    - by Chris
    I have the following home-grown jquery plugin: (function($) { $.fn.defaultButton = function(button) { var field = $(this); var target = $(button); if (field.attr('type').toLowerCase() != 'text') return; field.keydown(function (e) { if ((e.which || e.keyCode) == 13) { console.log('enter'); target.click(); return false; } }); } })(jQuery); I'm using it like so: $('#SignUpForm input').defaultButton('#SignUpButton'); $('#SignUpButton').click(function(e) { console.log('click'); $.ajax({ type: 'post', url: '<%=ResolveUrl("~/WebServices/ForumService.asmx/SignUp")%>', contentType: 'application/json; charset=utf-8', dataType: 'json', data: JSON.stringify({ email: $('#SignUpEmail').val(), password: $('#SignUpPassword').val() }), success: function(msg) { $.modal.close(); } }); }); The first time, it works. The second time, nothing happens. I see enter and click the first time in the firebug log, but the second time I only see the enter message. It's almost like the button's click handler is being unregistered somehow. Any thoughts?

    Read the article

  • CKEditor instance in a jQuery dialog

    - by Gazillion
    Hey, I am using jQuery to open a dialog window with a textarea transformed into an instance of CKEditor. I'm using the jQuery adapter provided by the CKEditor team but when the dialog window opens up I cannot interact with the editor (it's created but "null" is written in the content space and I can't click on anything or modify the content). This bug report seems to say that by using a patch provided the issue is fixed but it doesn't seem to be working for me... Here's my code (maybe I did something wrong programmatically): HTML: <div id="ad_div" title="Analyse documentaire"> <textarea id="ad_content" name="ad_content"></textarea> </div> My includes (Everything is included correctly but maybe it's an including order issue?): <script type="text/javascript" src="includes/ckeditor/ckeditor.js"></script> <link rel="stylesheet" type="text/css" href="includes/jquery/css/custom-theme/jquery-ui-1.7.2.custom.css" /> <script type="text/javascript" src="includes/jquery/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="includes/jquery/js/jquery-ui-1.7.2.custom.min.js"></script> <script type="text/javascript" src="includes/jquery/plugins/dialog-patch.js"></script> <script type="text/javascript" src="includes/ckeditor/adapters/jquery.js"></script> Javascript: $('#ad_content').ckeditor(); /* snip */ $('#ad_div').dialog( { modal: true, resizable: false, draggable: false, position: ['center','center'], width: 600, height: 500, hide: 'slide', show: 'slide', closeOnEscape: true, autoOpen: false }); $('.analyse_cell').click(function(){ $('#ad_div').dialog('open'); });

    Read the article

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