refresh

Why do I have to restart apache to properly refresh a Ruby on Rails view in the browser?

浪尽此生 提交于 2019-12-02 08:17:24
I am trying to learn a bit of Ruby. I've installed Ruby on my Ubuntu machine and I am using apache. Everything works fine except to refresh a view I have to restart apache in the console and then hit ctrl-r, just pressing ctrl-r won't refresh the browser. Apparently there's some caching going on, but does it have to be that way i.e. is it inherent to Ruby on Rails? I tried googling on this but it seems the only answer is to install some long-winded routine. For developing it seems like quite the tedious way to go. Apache's a perfectly good choice for development. Just install Passenger (mod

Combobox refresh value and listview when object content change

大憨熊 提交于 2019-12-02 07:50:40
I would like to update my combobox when the content of the object used to display text in combo changes. Here is a sample: package com.javafx.example.combobox; import javafx.application.Application; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.stage.Stage; import javafx.util

Refreshing picture in drawingPanel extends JPanel

浪尽此生 提交于 2019-12-02 07:23:55
I have to load a small icon on the botton of my software. just to have a loading/ok/error icon. as sudgested on "http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter06/images.html" i create a dwowing panel extending JPanel. class drawingPanel extends JPanel { Image img; drawingPanel (Image img){ this.img = img; } public void paintComponent (Graphics g) { super.paintComponent (g); // Use the image width & height to find the starting point int imgX = getSize ().width/2 - img.getWidth (this); int imgY = getSize ().height/2 - img.getHeight (this); //Draw image centered in the

Keep selected value of drop down list after page refresh

谁说胖子不能爱 提交于 2019-12-02 07:04:25
问题 I have a button to filter a list based on the selections from several drop-down values. However I am running into an issue whereby once the button is clicked, the page refreshes and the drop-down values are reset to the default. How could I ensure that after the refresh, the selected values persist on the drop-down? <div><select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select>

Is there a way to detect if the user has pressed the refresh button using jquery or javascript?

感情迁移 提交于 2019-12-02 06:45:37
问题 I want to know if jquery or javascript can detect if the user has pressed the refresh button of their browser? If so can I see an example? 回答1: window.onunload event will be fired before the page is going to be refreshed. window.onunload = function(){ alert("unload event detected!"); } 回答2: There is no way to detect if the user pressed refresh before the page refreshes, but you can use cookies to determine if the page refreshed once it loads the second time. For example, each page could store

Keep selected value of drop down list after page refresh

徘徊边缘 提交于 2019-12-02 06:30:12
I have a button to filter a list based on the selections from several drop-down values. However I am running into an issue whereby once the button is clicked, the page refreshes and the drop-down values are reset to the default. How could I ensure that after the refresh, the selected values persist on the drop-down? <div><select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> <select> <option value="ford">ford</option> <option value="chevy">Chevy</option> <option value="ram">Ram<

VAADIN 7: What is the simplest way to refresh a Vaadin View in 5 minute intervals?

本秂侑毒 提交于 2019-12-02 06:16:46
I'm trying to implement an automatic refresh on a List of components in a Vaadin view. The list gets its contents from a database. I can refresh the list with a button, that is already implemented. However, I would like to know what is the simplest way to make it so, that this refresh event, that I already have, would automatically refresh in 5 minute (300 000 milliseconds) intervals? Here's what I tried and it keeps refreshing even after I exit the view so it doesn't really work. I'd like the refresh to happen in 5 minute intervals only while that certain view is being shown. UI myUI = UI

Asp.Net SQL Refresh page duplicate inserts?

淺唱寂寞╮ 提交于 2019-12-02 05:25:55
I have a *.aspx page that contains a text box and a button. When the user enters information in to the textbox and clicks post, it inserts the data into my sql database. The issue is, that if the user hits refresh, it will keep inserting the same data into the database. I am pretty sure the whole "click" method is called, not just the insert call. I tried messing with sessions but it complains. I am not really sure what to do. I am looking for a simple easy fix. protected void PostButton_Click(object sender, EventArgs e) { string wpost = (string)Session["WallPost"]; DateTime wtime = (DateTime

Trying to get the sorter positon to retain after a table refresh

假如想象 提交于 2019-12-02 04:49:12
I have the following method: private void passStingR(StringBuilder retVal) throws BadLocationException { int scrollPositionR = scrollR.getVerticalScrollBar().getValue();//get value of scroll position stores in javas memory windowR.remove(scrollR); tableR.getModel(); modelR.setRowCount(0); Document docR = null; try { docR = loadXMLFromString(retVal.toString());//pull in the XML data into a new doc } catch (Exception ex) { Logger.getLogger(remit.class.getName()).log(Level.SEVERE, null, ex); } populate1R(docR); tableR.getTableHeader().setReorderingAllowed(false);//prevent user from changing

How to stop jQuery post page refresh

六月ゝ 毕业季﹏ 提交于 2019-12-02 03:49:29
问题 I am getting data from an MySQL database through PHP. I am sending the and getting the data from PHP using jQuery. Here is the code. $.POST("SubmitCode.php", $("#questionCodeForm").serialize(),'json').done(function(data) {}); Now the problem is that once I send this data the page refreshes. How can I stop the page refresh. If I delete 'json' then the page stops refreshing but the problem is that I want to get the json data without page refresh. How can I do this? -----------------------------