Search Results

Search found 3457 results on 139 pages for 'displaying'.

Page 10/139 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Problem with displaying image from DB using asp.net MVC 2

    - by Renato
    Hello! I'm having trouble with displaying image from db. I think that method for saving image is working, because I see in DB that varbinary fields have some value, and that image type is correct. Also the size of image. But when I want to display image for product i don't get anything. Just blank space.. here is my code... public byte[] GetImage(int productID) { Product product = products.GetByID(productID); byte[] imageData = product.ImageData.ToArray(); return imageData; } That code is in my controller. Second is code from view : <% if (product.ImageData != null) { %> <img src='/product/getimage/<%= Html.Encode(product.ID) %>' alt=""/> <% } %> I tried some solutions found here on stack overflow, and everyone do it like this, but it's working for them. I dont have any idea why images aren't displayed. When i look at source code of page at debugging i have : <img src='/product/getimage/18' alt=""/> I'm using .net 4.0, MVC 2, VS 2010... Thanks in advance

    Read the article

  • Loading/Displaying large amount of data on webpage.

    - by jb
    I have a webpage which contains a table for displaying a large amount of data (on average from 2,000 to 10,000 rows). This page takes a long time to load/render. Which is understandable. The problem is, while the page is loading the PCs memory usage skyrockets (500mb on my test system is in use by iexplorer) and the whole PC grinds to a halt until it has finished, which can take a minute or two. IE hangs until it is complete, switching to another running program is the same. I need to fix this - and ideally i want to accomplish 2 things: 1) Load individual parts of the page seperately. So the page can render initially without the large data table. A loading div will be placed there until it is ready. 2) Dont use up so much memory or local resources while rendering - so at least they can use a different tab/application at the same time. How would I go about doing both or either of these? I'm an applications programmer by trade so i am still a little fizzy on the things I can do in a web environment. Cheers all.

    Read the article

  • CGGradient Not Displaying Correctly on iPad 1 and 2

    - by daveMac
    I have been experimenting with creating my own gradients for the UI in my iOS app. I first used a CAGradientLayer but I was disappointed with the "stepped" look so I have been trying out CGGradient. enter code here I am having an issue with the Gradient displaying correctly. I have three iPads—one for each generation. The gradient looks right on the iPad 3 but not on the iPad 1 or 2. This is really strange. I was going to take a screenshot and post the two differences but even more strange, the screenshot look the same (and yes, the brightness is the same on both). The colors seem really washed out on the older iPads. I know the iPad 3 is a retina display, but I think it must be something more than that. Here is the code I am using: - (void)drawRect:(CGRect)rect { CGContextRef currentContext = UIGraphicsGetCurrentContext(); CGGradientRef skyGradient; CGColorSpaceRef rgbColorspace; size_t num_locations = 3; CGFloat locations[3] = { 0.0, .5, 1.0 }; CGFloat components[12] = { .106, .73, .93333, 1., 0.0, 0.0 , 1.0, 1., .106, .73, .93333, 1. }; rgbColorspace = CGColorSpaceCreateDeviceRGB(); skyGradient = CGGradientCreateWithColorComponents(rgbColorspace, components, locations, num_locations); CGRect currentBounds = self.bounds; CGPoint topLeft = CGPointMake(0.0f, 0.0f); CGPoint bottomRight = CGPointMake(CGRectGetMaxX(currentBounds), CGRectGetMaxY(currentBounds)); CGContextDrawLinearGradient(currentContext, skyGradient, topLeft, bottomRight, 0); CGGradientRelease(skyGradient); CGColorSpaceRelease(rgbColorspace); }

    Read the article

  • DataGridView not displaying data in ToolStripControlHost

    - by jblaske
    I'm utilizing the code posted by Jesper Palm here: http://stackoverflow.com/questions/280891/make-user-control-display-outside-of-form-boundry /// <summary> /// A simple popup window that can host any System.Windows.Forms.Control /// </summary> public class PopupWindow : System.Windows.Forms.ToolStripDropDown { private System.Windows.Forms.Control _content; private System.Windows.Forms.ToolStripControlHost _host; public PopupWindow(System.Windows.Forms.Control content) { //Basic setup... this.AutoSize = false; this.DoubleBuffered = true; this.ResizeRedraw = true; this._content = content; this._host = new System.Windows.Forms.ToolStripControlHost(content); //Positioning and Sizing this.MinimumSize = content.MinimumSize; this.MaximumSize = content.Size; this.Size = content.Size; content.Location = Point.Empty; //Add the host to the list this.Items.Add(this._host); } } I've translated it to VB: Public Class PopupWindow Inherits System.Windows.Forms.ToolStripDropDown Private _content As System.Windows.Forms.Control Private _host As System.Windows.Forms.ToolStripControlHost Public Sub New(ByVal content As System.Windows.Forms.Control) Me.AutoSize = False Me.DoubleBuffered = True Me.ResizeRedraw = True Me._content = content Me._host = New System.Windows.Forms.ToolStripControlHost(content) Me.MinimumSize = content.MinimumSize Me.MaximumSize = content.MaximumSize Me.Size = content.Size content.Location = Point.Empty Me.Items.Add(Me._host) End Sub End Class It works great with a PictureBox showing its information. But for some reason I cannot get the DataGridView to display anything when it is in the popup. If I pull the grid out of the popup it displays all of its information fine. If I pause during debug, the grid shows that it has all the data in it. It's just not displaying anything. Does anybody have any ideas?

    Read the article

  • Why doesn't my text be bold when displaying on device screen

    - by john123
    My string.xml: <!--I try to bold my argument %s, like below:--> <string name="hello">Hello to: <b>%s</b> !</string> My layout main.xml: <LinearLayout ...> <TextView android:id="@+id/hello_txt" ... .../> </LinearLayout> My Fragment class: public class MyFragment extends Fragment{ TextView helloTxt; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); helloTxt = (TextView) findViewById(R.id.hello_txt); } @Override public void onStart() { super.onStart(); //pass "Monday" as the argument to my string helloTxt.setText(String.format(getString(R.string.hello), "Monday")); } } When I run my app on my device, I got "Hello to: Monday !" displaying on screen, but the "Monday" is not bold, but I used <b> in my string.xml. Why it is not bold??

    Read the article

  • Django extending user model and displaying form

    - by MichalKlich
    Hello, I am writing website and i`d like to implement profile managment. Basic thing would be to edit some of user details by themself, like first and last name etc. Now, i had to extend User model to add my own stuff, and email address. I am having troubles with displaying form. Example will describe better what i would like achieve. This is mine extended user model. class UserExtended(models.Model): user = models.ForeignKey(User, unique=True) kod_pocztowy = models.CharField(max_length=6,blank=True) email = models.EmailField() This is how my form looks like. class UserCreationFormExtended(UserCreationForm): def __init__(self, *args, **kwargs): super(UserCreationFormExtended, self).__init__(*args, **kwargs) self.fields['email'].required = True self.fields['first_name'].required = False self.fields['last_name'].required = False class Meta: model = User fields = ('username', 'first_name', 'last_name', 'email') It works fine when registering, as i need allow users to put username and email but when it goes to editing profile it displays too many fields. I would not like them to be able to edit username and email. How could i disable fields in form? Thanks for help.

    Read the article

  • jQuery prevAll displaying text in backward ordering

    - by SoulieBaby
    hi all, I'm trying to use jQuery to get all the paragraphs before the first h2 tag in my content. Here's the code I'm using: $(".content").find("h2:first").prevAll().text() Which is grabbing the content, although it's displaying it in backwards order. Example content: <div class="content"> <p>paragraph 1</p> <p>paragraph 2</p> <p>paragraph 3</p> <h2>First h2 tag</h2> <p>paragraph 4</p> <p>paragraph 5</p> <p>paragraph 6</p> <h2>Second h2 tag</h2> </div> The above code is outputting: <p>paragraph 3</p> <p>paragraph 2</p> <p>paragraph 1</p> Is there any way of reversing this, so it's in the correct order? I have tried using nextAll using different codes, but it seems to grab all of my content, or not work at all lol

    Read the article

  • Background image is not displaying in IE6 and IE7

    - by saorabh
    I Have 3 divs HTML MARKUP <div class="top-content-wrapper"></div> <div id="content-wrapper"> </div> <div class="bottom-content-wrapper"> </div> Applied CSS on .top-content-wrapper { background:url("img/white-box-top-bg.gif") no-repeat scroll left top transparent; height:10px; margin:0 auto; padding:0 30px; width:686px; } #content-wrapper { background:url("img/white-box-middle-bg.gif") repeat-y scroll left top transparent; margin:0 auto; padding:10px 25px 70px; width:696px; } .bottom-content-wrapper { background:url("img/white-box-bottom-bg.gif") no-repeat scroll left top transparent; height:53px; margin:0 auto; padding:0 30px; width:686px; } In all major browsers its working fine but in IE6 and iE7 the background is not displaying please help me. Thank you.

    Read the article

  • Aggregating and displaying content from hundreds of RSS feeds

    - by Andrew LeClair
    I'd like to build a website that aggregates and displays content from hundreds of RSS feeds. The feeds will be from different sites: Twitter, Flickr, Tumblr, etc, so the content will be very heterogenous. In a perfect world — and this is more of a side issue — I would like to allow other people to help manage the list of feeds and assign tags to the content from each individual feed so that you can filter the items that are displayed. What I've tried so far: Google Feeds API – I thought this would be the answer, but unless I'm missing something, the FeedController will only output the collected feed content as separate lists. Is there any way to ask the Google Feeds API to aggregate and sort the content from many RSS feeds before displaying? Yahoo! Pipes – This also seemed like a good solution at first. I setup a Pipe that accesses a list of RSS feeds stored in a Google Doc spreadsheet and then aggregates the content. However, the output leaves a lot to be desired; Tumblr video posts, for example, only show a title and a permalink to the post, the embedded Youtube video is lost. PHP – I've seen this question, which looks like a good approach. I'm less proficient in PHP, so although I'm willing to learn, I'd ideally like to find a different approach. Any thoughts? Thanks.

    Read the article

  • query not displaying proper result

    - by ravindra
    In my Rails 3 project I have the following code for My controller: class TasksController < ApplicationController def today @tasks = Task.today @task = Task.new respond_to do |format| format.html { render :text=> "Sorry , you don't have any task pending today." } format.html # new.html.erb format.xml { render :xml => @tasks } end end def this_week @tasks = Task.this_week @task = Task.new respond_to do |format| format.html { render :text => "Sorry , No content for selected period." } format.html # new.html.erb format.xml { render :xml => @tasks } end end end My model: class Task < ActiveRecord::Base def self.today Task.where(:due_date => "Date.today" , :task_status => "open").order("due_date ASC") end def self.this_week Task.where(:due_date =>"Time.now.this_week" , :task_status => "open" ).order("due_date ASC") end end Why it does not displaying anything in the relative view. Please help me. Thanks

    Read the article

  • Finding and displaying image src attributes

    - by MIF
    Hi I have a problem and an try to find in one week. I need help :( I have a script work with : <script type="text/javascript"> var list_images = 'image1.jpg|image2.jpg|image3.jpg|image4.jpg|image5.jpg|image6.jpg|image7.jpg'; var images = list_images.split('|'); </script> but know in blogger always give more tab in my script <script type="text/javascript"> var list_images = ' <div></div> <a href="anything"><img src="image1.jpg"><a/> <a href="anything"><img src="image2.jpg"><a/> <a href="anything"><img src="image3.jpg"><a/> <a href="anything"><img src="image4.jpg"><a/> <a href="anything"><img src="image5.jpg"><a/> <li><img src="image6.jpg"></li> <li><img src="image7.jpg"></li> <br/> '; var images = list_images.split('|'); </script> I want remove all tabs and convert them like var list_images = 'image1.jpg|image2.jpg|image3.jpg|image4.jpg|image5.jpg|image6.jpg|image7.jpg'; Finding and displaying image src attributes - Old question http://manhualayout.blogspot.com/2011/03/httpcomic.html - Work good http://manhualayout.blogspot.com/2011/02/blog-post.html - My problem make my crazy in one week :( I Can't just edit the variable of the block HTML ...I want find a way to search and replace to remove all and got the link with the | Please help me . Very very thanks .. Me so stupid :(

    Read the article

  • displaying a physical webpage with frames in iframe

    - by ksa
    i have iframe in my webpage, i have done the coding part for browsing the folders and viewing files in iframe.each folder has a index.html.now i need to display the index.html in iframe.index.html page contains frames divided into 2,each from different sources.i tried to display a sample webpage without frames and it was a success,page with frames spoils the party. my code for getting the html file <% String path=request.getParameter("name"); File directory = new File(path); FileFilter fileFilter=new FileFilter() { @Override public boolean accept(File file) { return file.getName().endsWith("html"); } }; File[] files = directory.listFiles(fileFilter); for (int index = 0; index < files.length; index++) { String s= files[index].getName(); String s1=files[index].getAbsolutePath(); %> <a href="fileview?name=<%=s1%>" target="sss"><%=s%></a> <% } %> mycode for displaying the page in iframe. public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException { res.setContentType("text/html"); PrintWriter out=res.getWriter(); String name=req.getParameter("name"); res.setHeader("Content-Disposition", "inline; filename=\""+name+"\""); java.io.FileInputStream fis=new java.io.FileInputStream(name); int i; while((i=fis.read())!=-1) { out.write(i); } fis.close(); out.close(); }

    Read the article

  • Background-image is not displaying in Firefox

    - by goa
    Strange thing happens. Background-image is not displaying in Firefox under some versions of WindowsXP and Windows Vista, but displays in Firefox under Mac OSX. It also displays in IE. This is CSS: .cherry_banner { background: url("library/media/images/cherry_banner_top.png") no-repeat; width: 276px; display:block; min-height:100px; padding-top: 13px; color: #fdfdfd; margin-bottom:20px; } .cherry_banner a { color: #fdfdfd; } .cherry_banner a:hover { text-decoration:underline; } .cherry_banner li { list-style-type:none; } .cherry_banner h2 { font-size: 18px; margin-bottom: 10px; } .chb_text1 { background: url("library/media/images/cherry_banner_pixel.png") repeat-y; } .chb_text2 { background: url("library/media/images/cherry_banner_bottom.gif") bottom no-repeat; padding: 4px 14px 24px 25px; } And this is html: <div id="linkcat-8" class="cherry_banner tpt"><div class="chb_text1"><div class="chb_text2"> <h2>??? ?????????</h2> <ul class='xoxo blogroll'> <li><a href="http://inveda.ru/jyotish/naksatra-calendar/">???????? ?????????? ?????????????? ????????? ????????????? ??? ?? 2010?.</a></li> </ul> </div></div></div> You can see on http://www.inveda.ru - right column - red banner.

    Read the article

  • Displaying text in correct column

    - by wrongusername
    After getting a helpful answer here, I have run into yet another problem: displaying two or more strings in the column I want it to be displayed in. For an example of the problem I have, I want this output: Come here! where? not here! but instead get Come here! where? not here! when I use the code cout << left << setw(30) << "Come here!" << " where? " << setw(20) << "not here!" << endl; I made sure (I think) that the width of both columns could contain the two strings, but no matter how large I set the width of the columns to be, the error is still there.

    Read the article

  • fetching rows from mysql table and displaying them as JGROWL notifications

    - by jeansymolanza
    hey guys, i am having problems implementing my php/mysql code into a jgrowl if you are familiar with jgrowl you will know it delivers notifications like Growl does for OS X i am trying to get it read all the records from my table but at the moment it is only displaying one record as a notification and it loops through it 4 times another problem is that if i have 5 rows in the table then jgrowl will only display 4 notifications are going to be viewed how do i get it to view all the records in the table as notifications and how do i display the total number of records (5) as notifications and account for the missing one at the moment thanking you guys in advance... God bless <script type="text/javascript"> // In case you don't have firebug... if (!window.console || !console.firebug) { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {}; } (function($){ $(document).ready(function(){ // This specifies how many messages can be pooled out at any given time. // If there are more notifications raised then the pool, the others are // placed into queue and rendered after the other have disapeared. $.jGrowl.defaults.pool = 5; var i = 1; var y = 1; setInterval( function() { if ( i < <?php echo $totalRows_comment; ?> ) { <?php echo '$.jGrowl("'.$row_comment['comment'].'",'; ?> { sticky: true, log: function() { console.log("Creating message " + i + "..."); }, beforeOpen: function() { console.log("Rendering message " + y + "..."); y++; } }); } i++; } , 1000 ); }); })(jQuery); </script> <p> </span> <p>

    Read the article

  • PHP: Displaying Dom object and Creating xml file

    - by pavun_cool
    <?php $books = array(); $books [] = array( 'title' => 'PHP Hacks', 'author' => 'Jack Herrington', 'publisher' => "O'Reilly" ); $books [] = array( 'title' => 'Podcasting Hacks', 'author' => 'Jack Herrington', 'publisher' => "O'Reilly" ); $doc = new DOMDocument(); $doc->formatOutput = true; $r = $doc->createElement( "books" ); $doc->appendChild( $r ); foreach( $books as $book ) { $b = $doc->createElement( "book" ); $author = $doc->createElement( "author" ); $author->appendChild( $doc->createTextNode( $book['author'] ) ); #$author->appendChild( $doc->createTextNode( 'pavunkumar')); $new = $doc->createElement("Developer"); $a=$doc->createTextNode('I am developer ' ); $new->appendChild($a); $b->appendChild( $author ); $b->appendChild($new); $b->appendChild($new); $title = $doc->createElement( "title" ); $title->appendChild( $doc->createTextNode( $book['title'] ) ); $b->appendChild( $title ); $publisher = $doc->createElement( "publisher" ); $publisher->appendChild( $doc->createTextNode( $book['publisher'] ) ); $b->appendChild( $publisher ); $r->appendChild( $b ); } echo $doc->SaveXml() ; ?> When I run this code in command line. I am getting following things <?xml version="1.0"?> <books> <book> <author>Jack Herrington</author> <Developer>I am developer </Developer> <title>PHP Hacks</title> <publisher>O'Reilly</publisher> </book> <book> <author>Jack Herrington</author> <Developer>I am developer </Developer> <title>Podcasting Hacks</title> <publisher>O'Reilly</publisher> </book> </books> When I run the code in web browser it gives me following things Jack Herrington I am developer O'Reilly Jack Herrington I am developer O'Reilly I want to above output to be like command line output. And one more things is that instead of displaying , how could I create a xml file using $doc Dom object.

    Read the article

  • Displaying an Image in an activity using URI

    - by evkwan
    Hi, I'm writing an application that uses Intent(MediaStore.ACTION_IMAGE_CAPTURE) to capture and image. On the process of capturing the image, I noted the output of the image's URI. Right after finishing the camera activity, I wish to display the image using this specific URI. The method I used to capture images is: private void saveFullImage() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File file = new File(Environment.getExternalStorageDirectory(), "test.jpg"); outputFileUri = Uri.fromFile(file); intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); startActivityForResult(intent, TAKE_PICTURE); } Which is a method taken from Reto Meier's book Professional Android 2 Application Development. The method works fine, and I assume that the URI of the picture I just took is stored in the outputFileUri variable. Then at this point of the code is where I want to display the picture: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == TAKE_PICTURE) { //I want to display the picture I just took here //using the URI } } I'm not sure how to do it. I tried creating a new layout object and a new ImageView object using the method setImageURI(outputFileUri). My main layout (xml) did not have a ImageView object. But even when I set the contentView to the new layout with the ImageView attached to it, it doesn't display anything. I tried creating a Bitmap object from the URI and set it to the ImageView, but I get an unexpected error and forced exit. I have seen examples from here here which creates a Bitmap from URI, but it's not displaying it? My question is just how to display an image in the middle of a running activity? Do I need to get the File Path (like this) in order to display it? If I make a Bitmap out of the URI, how do I display the Bitmap? I'm just probably missing something simple...so any help would be a greatly appreciated! Also additional question for thought: If I were to take multiple pictures, would you recommend me to use the SimpleCursorAdapter instead? Thanks!

    Read the article

  • Best practices for displaying large number of images as thumbnails in c#

    - by andySF
    I got to a point where it's very difficult to get answers by debugging and tracing object, so i need some help. What I'm trying to do: A history form for my screen capture pet project. The history must list all images as thumbnails (ex: picasa). What I've done: I created a HistoryItem:UserControl. This history item has a few buttons, a check box, a label and a picture box. The buttons are for delete/edit/copy image. The check box is used for selecting one or more images and the label is for some info text. The picture box is getting the image from a public property that is a path and a method creates a proportional thumbnail to display it when the control has been loaded. This user control has two public events. One for deleting the image and one for bubbling the events for mouse enter and mouse leave trough all controls. For this I use EventBroadcastProvider. The bubbling is useful because wherever I move the mouse over the control, the buttons appear. The dispose method has been extended and I manually remove the events. All images are loaded by looping a xml file that contains the path of all images. For each image in this XML I create a new HitoryItem that is added (after a little coding to sort and limit the amount of images loaded) to a flow layout panel. The problem: When I lunch the history form, and the flow layout panel is populated with my HistoryItem custom control, my memory usage increases drastically.From 14Mb to around 100MB with 100 images loaded. By closing the history form and disposing whatever I could dispose and even trying to call GC.Collect() the memory increase remain. I search for any object that could not be disposed properly like an image or event but wherever I used them they are disposed. The problem seams to be from multiple sources. One is that the events for bubbling are not disposing properly, and the other is from the picture box itself. All of this i could see by commenting all the code to a limited version when only the custom control without any image processing and even events is loaded. Without the events the memory consumption is reduced by axiomatically 20%. So my real question is if this logic, flow layout panels and custom controls with picture boxes, is the best solution for displaying large amounts of images as thumbnails. Thank you!

    Read the article

  • using AsyncTask class for parallel operationand displaying a progress bar

    - by Kumar
    I am displaying a progress bar using Async task class and simulatneously in parallel operation , i want to retrieve a string array from a function of another class that takes some time to return the string array. The problem is that when i place the function call in doing backgroung function of AsyncTask class , it gives an error in Doing Background and gives the message as cant change the UI in doing Background .. Therefore , i placed the function call in post Execute method of Asynctask class . It doesnot give an error but after the progress bar has reached 100% , then the screen goes black and takes some time to start the new activity. How can i display the progress bar and make the function call simultaneously.??plz help , m in distress here is the code package com.integrated.mpr; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class Progess extends Activity implements OnClickListener{ static String[] display = new String[Choose.n]; Button bprogress; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.progress); bprogress = (Button) findViewById(R.id.bProgress); bprogress.setOnClickListener(this); } @Override public void onClick(View v) { // TODO Auto-generated method stub switch(v.getId()){ case R.id.bProgress: String x ="abc"; new loadSomeStuff().execute(x); break; } } public class loadSomeStuff extends AsyncTask<String , Integer , String>{ ProgressDialog dialog; protected void onPreExecute(){ dialog = new ProgressDialog(Progess.this); dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); dialog.setMax(100); dialog.show(); } @Override protected String doInBackground(String... arg0) { // TODO Auto-generated method stub for(int i = 0 ;i<40;i++){ publishProgress(5); try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } dialog.dismiss(); String y ="abc"; return y; } protected void onProgressUpdate(Integer...progress){ dialog.incrementProgressBy(progress[0]); } protected void onPostExecute(String result){ display = new Logic().finaldata(); Intent openList = new Intent("com.integrated.mpr.SENSITIVELIST"); startActivity(openList); } } }

    Read the article

  • Need help displaying a dynamic table

    - by Gideon
    I am designing a job rota planner for a company and need help displaying a dynamic table containing the staff details. I have the following tables in MySQL database: Staff, Event, and Job. The staff table holds staff details (staffed, name, address...etc), the Event table (eventide, eventName, Fromdate, Todate...etc) and the Job table holds (Jobid, Jobdate, Eventid(fk), Staffid (fk)). I need to dynamically display the available staff list from the staff table when the user selects the EVENT and the DATE (3 drop downs: date, month, and year) from a PHP form. I need to display staff members that have not been assigned work on the selected date by checking the Jobdate in the Job table. I have been at this for all day and can't get around it. I am still learning PHP and would surely appreciate any help I can get. My current code displays all staff members when an event is selected: if(isset($_POST['submit'])) { $eventId = $_POST['eventradio']; } $timePeriod = $_POST['timeperiod']; $Day = $_POST['day']; $Month = $_POST['month']; $Year = $_POST['year']; $dateValue = $Year."-".$Month."-".$Day; $selectedDate = date("Y-m-d", strtotime($dateValue)); //construct the available staff list if ($selectedDate) { $staffsql = "SELECT s.StaffId, s.LastName, s.FirstName FROM Staff s WHERE s.StaffId NOT IN (SELECT J.StaffId FROM Job J WHERE J.JobDate != ".$selectedDate.")"; $staffResult = mysql_query($staffsql) or die (mysql_error()); } if ($staffResult){ echo "<p><table cellspacing='1' cellpadding='3'>"; echo "<th colspan=6>List of Available Staff</th>"; echo "</tr><tr><th> Select</th><th>Id</th><th></th><th>Last Name </th><th></th><th>First Name </th></tr>"; while ($staffarray = mysql_fetch_array($staffResult)) { echo "<tr onMouseOver= this.bgColor = 'red' onMouseOut =this.bgColor = 'white' bgcolor= '#FFFFFF'> <td align=center><input type='checkbox' name='selectbox[]' id='selectbox[]' value=".$staffarray['StaffId']."> </td><td align=left>".$staffarray['StaffId']." </td><td>&nbsp&nbsp</td><td align=center>".$staffarray['LastName']." </td><td>&nbsp&nbsp</td><td align=center>".$staffarray['FirstName']." </td></tr>"; } echo "</table>"; } else { echo "<br> The Staff list can not be displayed!"; } echo "</td></tr>"; echo "<tr><td></td>"; echo "<td align=center><input type='submit' name='Submit' value='Assign Staff'>&nbsp&nbsp"; echo "<input type='reset' value='Start Over'>"; echo "</td></tr>"; echo "</table>";

    Read the article

  • Delay in displaying contents in JDialog

    - by Yohan
    Please have a look at the following code import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.List; import java.util.ArrayList; public class SendEmailForm extends JDialog { private JLabel to, cc, bcc, subject, account; private JTextField toTxt, ccTxt, bccTxt, subjectTxt; private JTextArea messageTxt; private JButton send; private JComboBox accountBox; private JScrollPane scroll; private GridBagLayout gbl; private GridBagConstraints gbc; public SendEmailForm() { //Declaring instance variables to = new JLabel("To: "); cc = new JLabel("CC: "); bcc = new JLabel("BCC: "); subject = new JLabel("Subject: "); account = new JLabel("Select an Account: "); toTxt = new JTextField(20); ccTxt = new JTextField(20); bccTxt = new JTextField(20); subjectTxt = new JTextField(20); messageTxt = new JTextArea(20, 50); messageTxt.setLineWrap(true); scroll = new JScrollPane(messageTxt); scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); accountBox = new JComboBox(); accountBox.addItem("Yahoo"); accountBox.addItem("GMail"); accountBox.addItem("MSN"); //accountBox.addItem("Yahoo"); //accountBox.addItem("Yahoo"); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); send = new JButton("Send"); send.addActionListener(new SendButtonAction()); buttonPanel.add(send); //Creating thr GUI //GUI CREATION IS REMOVED IN THIS POST this.setTitle("Send Emails"); this.setVisible(true); this.pack(); this.setLocationRelativeTo(null); this.validate(); } private class SendButtonAction implements ActionListener { public void actionPerformed(ActionEvent ae) { ProgressMonitor pm = new ProgressMonitor(); //Retreiving the user name and password List userData = new ArrayList(); EmailDBConnector emailCon = new EmailDBHandler(); userData = emailCon.getUserNameAndPassword( accountBox.getSelectedItem().toString().trim()); String userName = userData.get(0).toString(); String password = userData.get(1).toString(); System.out.println(userName); System.out.println(password); pm.setVisible(true); SendEmail sendEmail = new SendEmail(toTxt.getText(), userName.trim(), bccTxt.getText(), ccTxt.getText(), accountBox.getSelectedItem().toString().trim(), messageTxt.getText().trim(), password.trim(), subjectTxt.getText()); String result = sendEmail.send(); //pm.dispose(); JOptionPane.showMessageDialog(null, result); } } private class ProgressMonitor extends JDialog { public ProgressMonitor() { this.setLayout(new BorderLayout()); JLabel text = new JLabel("Sending..Please wait..."); this.add(text, "Center"); this.pack(); this.validate(); this.setLocationRelativeTo(null); } } } First, this is an email program. In here, when the JDialog is called, it just opens as a 100% blank window. I have added a JLabel, but it is not there when it is displaying. Anyway, it takes sometime to send the email, after the email is sent, I can see the JLabel in the JDialog. If I take my issue into one sentence, I am calling the JDialog before the email is sent, but it appears blank, after the email is sent, it's content are there! Why is this? Please help!

    Read the article

  • Customized listfield with image displaying from a url

    - by arunabha
    I am displaying a customized list field with text on the right side and image on the left side.The image comes from a URL dynamically.Initially i am placing a blank image on the left of the list field,then call URLBitmapField class's setURL method,which actually does the processing and places the processed image on top of the blank image.The image gets displayed on the list field,but to see that processed image i need to press any key or click on the list field items.I want the processed image to be displayed automatically in the list field after the processing.Can anyone tell me where i am getting wrong? import java.util.Vector; import net.rim.device.api.system.Bitmap; import net.rim.device.api.system.Display; import net.rim.device.api.ui.ContextMenu; import net.rim.device.api.ui.DrawStyle; import net.rim.device.api.ui.Field; import net.rim.device.api.ui.Font; import net.rim.device.api.ui.Graphics; import net.rim.device.api.ui.Manager; import net.rim.device.api.ui.MenuItem; import net.rim.device.api.ui.UiApplication; import net.rim.device.api.ui.component.BitmapField; import net.rim.device.api.ui.component.Dialog; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.component.ListField; import net.rim.device.api.ui.component.ListFieldCallback; import net.rim.device.api.ui.component.NullField; import net.rim.device.api.ui.container.FullScreen; import net.rim.device.api.ui.container.MainScreen; import net.rim.device.api.ui.container.VerticalFieldManager; import net.rim.device.api.util.Arrays; import net.rim.device.api.ui.component.ListField; public class TaskListField extends UiApplication { // statics // ------------------------------------------------------------------ public static void main(String[] args) { TaskListField theApp = new TaskListField(); theApp.enterEventDispatcher(); } public TaskListField() { pushScreen(new TaskList()); } } class TaskList extends MainScreen implements ListFieldCallback { private Vector rows; private Bitmap p1; private Bitmap p2; private Bitmap p3; String Task; ListField listnew = new ListField(); private VerticalFieldManager metadataVFM; TableRowManager row; public TaskList() { super(); URLBitmapField artistImgField; listnew.setRowHeight(80); listnew.setCallback(this); rows = new Vector(); for (int x = 0; x <3; x++) { row = new TableRowManager(); artistImgField = new URLBitmapField(Bitmap .getBitmapResource("res/images/bg.jpg")); row.add(artistImgField); String photoURL = "someimagefrmurl.jpg"; Log.info(photoURL); // strip white spaces in the url, which is causing the // images to not display properly for (int i = 0; i < photoURL.length(); i++) { if (photoURL.charAt(i) == ' ') { photoURL = photoURL.substring(0, i) + "%20" + photoURL.substring(i + 1, photoURL.length()); } } Log.info("Processed URL: " + photoURL); artistImgField.setURL(photoURL); LabelField task = new LabelField("Display"); row.add(task); LabelField task1 = new LabelField( "Now Playing" + String.valueOf(x)); Font myFont = Font.getDefault().derive(Font.PLAIN, 12); task1.setFont(myFont); row.add(task1); rows.addElement(row); } listnew.setSize(rows.size()); this.add(listnew); //listnew.invalidate(); } // ListFieldCallback Implementation public void drawListRow(ListField listField, Graphics g, int index, int y, int width) { TableRowManager rowManager = (TableRowManager) rows.elementAt(index); rowManager.drawRow(g, 0, y, width, listnew.getRowHeight()); } protected void drawFocus(Graphics graphics, boolean on) { } private class TableRowManager extends Manager { public TableRowManager() { super(0); } // Causes the fields within this row manager to be layed out then // painted. public void drawRow(Graphics g, int x, int y, int width, int height) { // Arrange the cell fields within this row manager. layout(width, height); // Place this row manager within its enclosing list. setPosition(x, y); // Apply a translating/clipping transformation to the graphics // context so that this row paints in the right area. g.pushRegion(getExtent()); // Paint this manager's controlled fields. subpaint(g); g.setColor(0x00CACACA); g.drawLine(0, 0, getPreferredWidth(), 0); // Restore the graphics context. g.popContext(); } // Arrages this manager's controlled fields from left to right within // the enclosing table's columns. protected void sublayout(int width, int height) { // set the size and position of each field. int fontHeight = Font.getDefault().getHeight(); int preferredWidth = getPreferredWidth(); // start with the Bitmap Field of the priority icon Field field = getField(0); layoutChild(field, 146,80); setPositionChild(field, 0, 0); // set the task name label field field = getField(1); layoutChild(field, preferredWidth - 16, fontHeight + 1); setPositionChild(field, 149, 3); // set the list name label field field = getField(2); layoutChild(field, 150, fontHeight + 1); setPositionChild(field, 149, fontHeight + 6); setExtent(360, 480); } // The preferred width of a row is defined by the list renderer. public int getPreferredWidth() { return listnew.getWidth(); } // The preferred height of a row is the "row height" as defined in the // enclosing list. public int getPreferredHeight() { return listnew.getRowHeight(); } } public Object get(ListField listField, int index) { // TODO Auto-generated method stub return null; } public int getPreferredWidth(ListField listField) { return 0; } public int indexOfList(ListField listField, String prefix, int start) { // TODO Auto-generated method stub return 0; } }

    Read the article

  • Need help displaying a table dynamically based on a drop down date selection

    - by Gideon
    I am designing a job rota planner for a company and need help displaying a dynamic table containing the staff details. I have the following tables in MySQL database: Staff, Event, and Job. The staff table holds staff details (staffed, name, address...etc), the Event table (eventide, eventName, Fromdate, Todate...etc) and the Job table holds (Jobid, Jobdate, Eventid(fk), Staffid (fk)). I need to dynamically display the available staff list from the staff table when the user selects the event and the date (3 drop downs: date, month, and year) from a PHP form. I need to display staff members that have not been assigned work on the selected date by checking the Jobdate in the Job table. I have been at this for all day and can't get around it. I am still learning PHP and would surely appreciate any help I can get. My current code displays all staff members when an event is selected: //Create the day pull-down menu. $days = range (1, 31); echo "<Select Name=day Value=''><Option>Day</option>"; foreach ($days as $value) { echo '<option value="'.$value.'">'.$value.'</option>\n'; } echo "</Select>"; echo "</td><td>"; //Create the month pull-down menu echo "<Select Name=month Value=''><Option>Month</option>"; echo "<option value='01'>Jan</option>"; echo "<option value='02'>Feb</option>"; echo "<option value='03'>Mar</option>"; echo "<option value='04'>Apr</option>"; echo "<option value='05'>May</option>"; echo "<option value='06'>Jun</option>"; echo "<option value='07'>Jul</option>"; echo "<option value='08'>Aug</option>"; echo "<option value='09'>Sep</option>"; echo "<option value='10'>Oct</option>"; echo "<option value='11'>Nov</option>"; echo "<option value='12'>Dec</option>"; echo "</select>"; echo "</td><td>"; //Create the year pull-down menu $currentYear = date ("Y"); $years = range ($currentYear, 2020); echo "<Select Name=year Value=''><Option>Year</option>"; foreach ($years as $value) { echo '<option value="'.$value.'">'.$value.'</option>\n'; } echo "</Select>"; echo "</td></tr></table>"; echo "</td><td>"; //echo "<img src='../ETMSimages/etms_staff.png'</img></td><td>"; //construct the available staff list $staffsql = "SELECT StaffId, LastName, FirstName FROM Staff order by StaffId"; $staffResult = mysql_query($staffsql); if ($staffResult){ echo "<p><table cellspacing='1' cellpadding='3'>"; echo "<th colspan=6>List of Available Staff</th>"; echo "</tr><tr><th> Select</th><th>Id</th><th></th><th>Last Name </th><th></th><th>First Name </th></tr>"; while ($staffarray = mysql_fetch_array($staffResult)) { echo "<tr onMouseOver= this.bgColor = 'red' onMouseOut =this.bgColor = 'white' bgcolor= '#FFFFFF'> <td align=center><input type='checkbox' name='selectbox[]' id='selectbox[]' value=".$staffarray['StaffId']."> </td><td align=left>".$staffarray['StaffId']." </td><td>&nbsp&nbsp</td><td align=center>".$staffarray['LastName']." </td><td>&nbsp&nbsp</td><td align=center>".$staffarray['FirstName']." </td></tr>"; } echo "</table>"; } else { echo "<br> The Staff list can not be displayed!"; } echo "</td></tr>"; echo "<tr><td></td>"; echo "<td align=center><input type='submit' name='Submit' value='Assign Staff'>&nbsp&nbsp"; echo "<input type='reset' value='Start Over'>"; echo "</td></tr>"; echo "</table>";

    Read the article

  • problem with sIFR 3 not displaying in IE just getting XXX

    - by user288306
    I am having a problem with sIFR 3 not displaying in IE. I get 3 larges black XXX in IE yet it displays fine in Firefox. I have checked i do have the most recent version of flash installed correctly. Here is the code on the page <div id="features"> <div id="mainmessage_advertisers"><h2>Advertisers</h2><br /><br /><h3><a href="">Reach your customers where they browse. Buy directly from top web publishers.</a></h3><br /><br /><br /><a href=""><img src="img/buyads.gif" border="0"></a></div> <div id="mainmessage_publishers"><h2>Publishers</h2><br /><br /><h3>Take control of your ad space and start generating more revenue than <u>ever before</u>.</h3><br /><br /><br /><a href=""><img src="img/sellads.gif" border="0"></a></div> </div>` Here is the code from my global.css #mainmessage_advertisers { width: 395px; height: 200px; padding: 90px 50px; border: 1px; float: left; } #mainmessage_publishers { width: 395px; height: 200px; padding: 90px 50px; float: right; } and here is what i have in my sifr.js /*********************************************************************** SIFR 3.0 (BETA 1) FUNCTIONS ************************************************************************/ var parseSelector=(function(){var _1=/\s*,\s*/;var _2=/\s*([\s>+~(),]|^|$)\s*/g;var _3=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var _4=/^[^\s>+~]/;var _5=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function parseSelector(_6,_7){_7=_7||document.documentElement;var _8=_6.split(_1),_9=[];for(var i=0;i<_8.length;i++){var _b=[_7],_c=toStream(_8[i]);for(var j=0;j<_c.length;){var _e=_c[j++],_f=_c[j++],_10="";if(_c[j]=="("){while(_c[j++]!=")"&&j<_c.length){_10+=_c[j]}_10=_10.slice(0,-1)}_b=select(_b,_e,_f,_10)}_9=_9.concat(_b)}return _9}function toStream(_11){var _12=_11.replace(_2,"$1").replace(_3,"$1*$2");if(_4.test(_12)){_12=" "+_12}return _12.match(_5)||[]}function select(_13,_14,_15,_16){return (_17[_14])?_17[_14](_13,_15,_16):[]}var _18={toArray:function(_19){var a=[];for(var i=0;i<_19.length;i++){a.push(_19[i])}return a}};var dom={isTag:function(_1d,tag){return (tag=="*")||(tag.toLowerCase()==_1d.nodeName.toLowerCase())},previousSiblingElement:function(_1f){do{_1f=_1f.previousSibling}while(_1f&&_1f.nodeType!=1);return _1f},nextSiblingElement:function(_20){do{_20=_20.nextSibling}while(_20&&_20.nodeType!=1);return _20},hasClass:function(_21,_22){return (_22.className||"").match("(^|\\s)"+_21+"(\\s|$)")},getByTag:function(tag,_24){return _24.getElementsByTagName(tag)}};var _17={"#":function(_25,_26){for(var i=0;i<_25.length;i++){if(_25[i].getAttribute("id")==_26){return [_25[i]]}}return []}," ":function(_28,_29){var _2a=[];for(var i=0;i<_28.length;i++){_2a=_2a.concat(_18.toArray(dom.getByTag(_29,_28[i])))}return _2a},">":function(_2c,_2d){var _2e=[];for(var i=0,_30;i<_2c.length;i++){_30=_2c[i];for(var j=0,_32;j<_30.childNodes.length;j++){_32=_30.childNodes[j];if(_32.nodeType==1&&dom.isTag(_32,_2d)){_2e.push(_32)}}}return _2e},".":function(_33,_34){var _35=[];for(var i=0,_37;i<_33.length;i++){_37=_33[i];if(dom.hasClass([_34],_37)){_35.push(_37)}}return _35},":":function(_38,_39,_3a){return (pseudoClasses[_39])?pseudoClasses[_39](_38,_3a):[]}};parseSelector.selectors=_17;parseSelector.pseudoClasses={};parseSelector.util=_18;parseSelector.dom=dom;return parseSelector})(); var sIFR=new function(){var _3b=this;var _3c="sIFR-active";var _3d="sIFR-replaced";var _3e="sIFR-flash";var _3f="sIFR-ignore";var _40="sIFR-alternate";var _41="sIFR-class";var _42="sIFR-layout";var _43="http://www.w3.org/1999/xhtml";var _44=6;var _45=126;var _46=8;var _47="SIFR-PREFETCHED";var _48=" ";this.isActive=false;this.isEnabled=true;this.hideElements=true;this.replaceNonDisplayed=false;this.preserveSingleWhitespace=false;this.fixWrap=true;this.registerEvents=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];this.fromLocal=true;this.forceClear=false;this.forceWidth=true;this.fitExactly=false;this.forceTextTransform=true;this.useDomContentLoaded=true;this.debugMode=false;this.hasFlashClassSet=false;var _49=0;var _4a=false,_4b=false;var dom=new function(){this.getBody=function(){var _4d=document.getElementsByTagName("body");if(_4d.length==1){return _4d[0]}return null};this.addClass=function(_4e,_4f){if(_4f){_4f.className=((_4f.className||"")==""?"":_4f.className+" ")+_4e}};this.removeClass=function(_50,_51){if(_51){_51.className=_51.className.replace(new RegExp("(^|\\s)"+_50+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1")}};this.hasClass=function(_52,_53){return new RegExp("(^|\\s)"+_52+"(\\s|$)").test(_53.className)};this.create=function(_54){if(document.createElementNS){return document.createElementNS(_43,_54)}return document.createElement(_54)};this.setInnerHtml=function(_55,_56){if(ua.innerHtmlSupport){_55.innerHTML=_56}else{if(ua.xhtmlSupport){_56=["<root xmlns=\"",_43,"\">",_56,"</root>"].join("");var xml=(new DOMParser()).parseFromString(_56,"text/xml");xml=document.importNode(xml.documentElement,true);while(_55.firstChild){_55.removeChild(_55.firstChild)}while(xml.firstChild){_55.appendChild(xml.firstChild)}}}};this.getComputedStyle=function(_58,_59){var _5a;if(document.defaultView&&document.defaultView.getComputedStyle){_5a=document.defaultView.getComputedStyle(_58,null)[_59]}else{if(_58.currentStyle){_5a=_58.currentStyle[_59]}}return _5a||""};this.getStyleAsInt=function(_5b,_5c,_5d){var _5e=this.getComputedStyle(_5b,_5c);if(_5d&&!/px$/.test(_5e)){return 0}_5e=parseInt(_5e);return isNaN(_5e)?0:_5e};this.getZoom=function(){return _5f.zoom.getLatest()}};this.dom=dom;var ua=new function(){var ua=navigator.userAgent.toLowerCase();var _62=(navigator.product||"").toLowerCase();this.macintosh=ua.indexOf("mac")>-1;this.windows=ua.indexOf("windows")>-1;this.quicktime=false;this.opera=ua.indexOf("opera")>-1;this.konqueror=_62.indexOf("konqueror")>-1;this.ie=false/*@cc_on || true @*/;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(ua)/*@cc_on && @_jscript_version >= 5.5 @*/;this.ieWin=this.ie&&this.windows/*@cc_on && @_jscript_version >= 5.1 @*/;this.windows=this.windows&&(!this.ie||this.ieWin);this.ieMac=this.ie&&this.macintosh/*@cc_on && @_jscript_version < 5.1 @*/;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=ua.indexOf("safari")>-1;this.webkit=ua.indexOf("applewebkit")>-1&&!this.konqueror;this.khtml=this.webkit||this.konqueror;this.gecko=!this.webkit&&_62=="gecko";this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(ua)?parseInt(RegExp.$2):0;this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(ua)?parseInt(RegExp.$1):0;this.geckoBuildDate=this.gecko&&/.*gecko\/(\d{8}).*/.exec(ua)?parseInt(RegExp.$1):0;this.konquerorVersion=this.konqueror&&/.*konqueror\/(\d\.\d).*/.exec(ua)?parseInt(RegExp.$1):0;this.flashVersion=0;if(this.ieWin){var axo;var _64=false;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");this.flashVersion=6;axo.AllowScriptAccess="always"}catch(e){_64=this.flashVersion==6}if(!_64){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}}if(!_64&&axo){this.flashVersion=parseFloat(/([\d,?]+)/.exec(axo.GetVariable("$version"))[1].replace(/,/g,"."))}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){var _65=navigator.plugins["Shockwave Flash"];this.flashVersion=parseFloat(/(\d+\.?\d*)/.exec(_65.description)[1]);var i=0;while(this.flashVersion>=_46&&i<navigator.mimeTypes.length){var _67=navigator.mimeTypes[i];if(_67.type=="application/x-shockwave-flash"&&_67.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){this.flashVersion=0;this.quicktime=true}i++}}}this.flash=this.flashVersion>=_46;this.transparencySupport=this.macintosh||this.windows;this.computedStyleSupport=this.ie||document.defaultView&&document.defaultView.getComputedStyle&&(!this.gecko||this.geckoBuildDate>=20030624);this.css=true;if(this.computedStyleSupport){try{var _68=document.getElementsByTagName("head")[0];_68.style.backgroundColor="#FF0000";var _69=dom.getComputedStyle(_68,"backgroundColor");this.css=!_69||/\#F{2}0{4}|rgb\(255,\s?0,\s?0\)/i.test(_69);_68=null}catch(e){}}this.xhtmlSupport=!!window.DOMParser&&!!document.importNode;this.innerHtmlSupport;try{var n=dom.create("span");if(!this.ieMac){n.innerHTML="x"}this.innerHtmlSupport=n.innerHTML=="x"}catch(e){this.innerHtmlSupport=false}this.zoomSupport=!!(this.opera&&document.documentElement);this.geckoXml=this.gecko&&(document.contentType||"").indexOf("xml")>-1;this.requiresPrefetch=this.ieWin||this.khtml;this.verifiedKonqueror=false;this.supported=this.flash&&this.css&&(!this.ie||this.ieSupported)&&(!this.opera||this.operaVersion>=8)&&(!this.webkit||this.webkitVersion>=412)&&(!this.konqueror||this.konquerorVersion>3.5)&&this.computedStyleSupport&&(this.innerHtmlSupport||!this.khtml&&this.xhtmlSupport)};this.ua=ua;var _6b=new function(){function capitalize($){return $.toUpperCase()}this.normalize=function(str){if(_3b.preserveSingleWhitespace){return str.replace(/\s/g,_48)}return str.replace(/(\s)\s+/g,"$1")};this.textTransform=function(_6e,str){switch(_6e){case "uppercase":str=str.toUpperCase();break;case "lowercase":str=str.toLowerCase();break;case "capitalize":var _70=str;str=str.replace(/^\w|\s\w/g,capitalize);if(str.indexOf("function capitalize")!=-1){var _71=_70.replace(/(^|\s)(\w)/g,"$1$1$2$2").split(/^\w|\s\w/g);str="";for(var i=0;i<_71.length;i++){str+=_71[i].charAt(0).toUpperCase()+_71[i].substring(1)}}break}return str};this.toHexString=function(str){if(typeof (str)!="string"||!str.charAt(0)=="#"||str.length!=4&&str.length!=7){return str}str=str.replace(/#/,"");if(str.length==3){str=str.replace(/(.)(.)(.)/,"$1$1$2$2$3$3")}return "0x"+str};this.toJson=function(obj){var _75="";switch(typeof (obj)){case "string":_75="\""+obj+"\"";break;case "number":case "boolean":_75=obj.toString();break;case "object":_75=[];for(var _76 in obj){if(obj[_76]==Object.prototype[_76]){continue}_75.push("\""+_76+"\":"+_6b.toJson(obj[_76]))}_75="{"+_75.join(",")+"}";break}return _75};this.convertCssArg=function(arg){if(!arg){return {}}if(typeof (arg)=="object"){if(arg.constructor==Array){arg=arg.join("")}else{return arg}}var obj={};var _79=arg.split("}");for(var i=0;i<_79.length;i++){var $=_79[i].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!$||$.length!=3){continue}if(!obj[$[1]]){obj[$[1]]={}}var _7c=$[2].split(";");for(var j=0;j<_7c.length;j++){var $2=_7c[j].match(/\s*([^:\s]+)\s*\:\s*([^\s;]+)/);if(!$2||$2.length!=3){continue}obj[$[1]][$2[1]]=$2[2]}}return obj};this.extractFromCss=function(css,_80,_81,_82){var _83=null;if(css&&css[_80]&&css[_80][_81]){_83=css[_80][_81];if(_82){delete css[_80][_81]}}return _83};this.cssToString=function(arg){var css=[];for(var _86 in arg){var _87=arg[_86];if(_87==Object.prototype[_86]){continue}css.push(_86,"{");for(var _88 in _87){if(_87[_88]==Object.prototype[_88]){continue}css.push(_88,":",_87[_88],";")}css.push("}")}return escape(css.join(""))}};this.util=_6b;var _5f={};_5f.fragmentIdentifier=new function(){this.fix=true;var _89;this.cache=function(){_89=document.title};function doFix(){document.title=_89}this.restore=function(){if(this.fix){setTimeout(doFix,0)}}};_5f.synchronizer=new function(){this.isBlocked=false;this.block=function(){this.isBlocked=true};this.unblock=function(){this.isBlocked=false;_8a.replaceAll()}};_5f.zoom=new function(){var _8b=100;this.getLatest=function(){return _8b};if(ua.zoomSupport&&ua.opera){var _8c=document.createElement("div");_8c.style.position="fixed";_8c.style.left="-65536px";_8c.style.top="0";_8c.style.height="100%";_8c.style.width="1px";_8c.style.zIndex="-32";document.documentElement.appendChild(_8c);function updateZoom(){if(!_8c){return}var _8d=window.innerHeight/_8c.offsetHeight;var _8e=Math.round(_8d*100)%10;if(_8e>5){_8d=Math.round(_8d*100)+10-_8e}else{_8d=Math.round(_8d*100)-_8e}_8b=isNaN(_8d)?100:_8d;_5f.synchronizer.unblock();document.documentElement.removeChild(_8c);_8c=null}_5f.synchronizer.block();setTimeout(updateZoom,54)}};this.hacks=_5f;var _8f={kwargs:[],replaceAll:function(){for(var i=0;i<this.kwargs.length;i++){_3b.replace(this.kwargs[i])}this.kwargs=[]}};var _8a={kwargs:[],replaceAll:_8f.replaceAll};function isValidDomain(){if(_3b.domains.length==0){return true}var _91="";try{_91=document.domain}catch(e){}if(_3b.fromLocal&&sIFR.domains[0]!="localhost"){sIFR.domains.unshift("localhost")}for(var i=0;i<_3b.domains.length;i++){if(_3b.domains[i]=="*"||_3b.domains[i]==_91){return true}}return false}this.activate=function(){if(!ua.supported||!this.isEnabled||this.isActive||!isValidDomain()){return}this.isActive=true;if(this.hideElements){this.setFlashClass()}if(ua.ieWin&&_5f.fragmentIdentifier.fix&&window.location.hash!=""){_5f.fragmentIdentifier.cache()}else{_5f.fragmentIdentifier.fix=false}if(!this.registerEvents){return}function handler(evt){_3b.initialize();if(evt&&evt.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",handler,false);document.removeEventListener("load",handler,false)}if(window.removeEventListener){window.removeEventListener("load",handler,false)}}}if(window.addEventListener){if(_3b.useDomContentLoaded&&ua.gecko){document.addEventListener("DOMContentLoaded",handler,false)}window.addEventListener("load",handler,false)}else{if(ua.ieWin){if(_3b.useDomContentLoaded&&!_4a){document.write("<scr"+"ipt id=__sifr_ie_onload defer src=//:></script>");document.getElementById("__sifr_ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){handler();this.removeNode()}}}window.attachEvent("onload",handler)}}};this.setFlashClass=function(){if(this.hasFlashClassSet){return}dom.addClass(_3c,dom.getBody()||document.documentElement);this.hasFlashClassSet=true};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return}dom.removeClass(_3c,dom.getBody());dom.removeClass(_3c,document.documentElement);this.hasFlashClassSet=false};this.initialize=function(){if(_4b||!this.isActive||!this.isEnabled){return}_4b=true;_8f.replaceAll();clearPrefetch()};function getSource(src){if(typeof (src)!="string"){if(src.src){src=src.src}if(typeof (src)!="string"){var _95=[];for(var _96 in src){if(src[_96]!=Object.prototype[_96]){_95.push(_96)}}_95.sort().reverse();var _97="";var i=-1;while(!_97&&++i<_95.length){if(parseFloat(_95[i])<=ua.flashVersion){_97=src[_95[i]]}}src=_97}}if(!src&&_3b.debugMode){throw new Error("sIFR: Could not determine appropriate source")}if(ua.ie&&src.charAt(0)=="/"){src=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+src}return src}this.prefetch=function(){if(!ua.requiresPrefetch||!ua.supported||!this.isEnabled||!isValidDomain()){return}if(this.setPrefetchCookie&&new RegExp(";?"+_47+"=true;?").test(document.cookie)){return}try{_4a=true;if(ua.ieWin){prefetchIexplore(arguments)}else{prefetchLight(arguments)}if(this.setPrefetchCookie){document.cookie=_47+"=true;path="+this.cookiePath}}catch(e){if(_3b.debugMode){throw e}}};function prefetchIexplore(_99){for(var i=0;i<_99.length;i++){document.write("<embed src=\""+getSource(_99[i])+"\" sIFR-prefetch=\"true\" style=\"display:none;\">")}}function prefetchLight(_9b){for(var i=0;i<_9b.length;i++){new Image().src=getSource(_9b[i])}}function clearPrefetch(){if(!ua.ieWin||!_4a){return}try{var _9d=document.getElementsByTagName("embed");for(var i=_9d.length-1;i>=0;i--){var _9f=_9d[i];if(_9f.getAttribute("sIFR-prefetch")=="true"){_9f.parentNode.removeChild(_9f)}}}catch(e){}}function getRatio(_a0){if(_a0<=10){return 1.55}if(_a0<=19){return 1.45}if(_a0<=32){return 1.35}if(_a0<=71){return 1.3}return 1.25}function getFilters(obj){var _a2=[];for(var _a3 in obj){if(obj[_a3]==Object.prototype[_a3]){continue}var _a4=obj[_a3];_a3=[_a3.replace(/filter/i,"")+"Filter"];for(var _a5 in _a4){if(_a4[_a5]==Object.prototype[_a5]){continue}_a3.push(_a5+":"+escape(_6b.toJson(_6b.toHexString(_a4[_a5]))))}_a2.push(_a3.join(","))}return _a2.join(";")}this.replace=function(_a6,_a7){if(!ua.supported){return}if(_a7){for(var _a8 in _a6){if(typeof (_a7[_a8])=="undefined"){_a7[_a8]=_a6[_a8]}}_a6=_a7}if(!_4b){return _8f.kwargs.push(_a6)}if(_5f.synchronizer.isBlocked){return _8a.kwargs.push(_a6)}var _a9=_a6.elements;if(!_a9&&parseSelector){_a9=parseSelector(_a6.selector)}if(_a9.length==0){return}this.setFlashClass();var src=getSource(_a6.src);var css=_6b.convertCssArg(_a6.css);var _ac=getFilters(_a6.filters);var _ad=(_a6.forceClear==null)?_3b.forceClear:_a6.forceClear;var _ae=(_a6.fitExactly==null)?_3b.fitExactly:_a6.fitExactly;var _af=_ae||(_a6.forceWidth==null?_3b.forceWidth:_a6.forceWidth);var _b0=parseInt(_6b.extractFromCss(css,".sIFR-root","leading"))||0;var _b1=_6b.extractFromCss(css,".sIFR-root","background-color",true)||"#FFFFFF";var _b2=_6b.extractFromCss(css,".sIFR-root","opacity",true)||"100";if(parseFloat(_b2)<1){_b2=100*parseFloat(_b2)}var _b3=_6b.extractFromCss(css,".sIFR-root","kerning",true)||"";var _b4=_a6.gridFitType||_6b.extractFromCss(css,".sIFR-root","text-align")=="right"?"subpixel":"pixel";var _b5=_3b.forceTextTransform?_6b.extractFromCss(css,".sIFR-root","text-transform",true)||"none":"none";var _b6="";if(_ae){_6b.extractFromCss(css,".sIFR-root","text-align",true)}if(!_a6.modifyCss){_b6=_6b.cssToString(css)}var _b7=_a6.wmode||"";if(_b7=="transparent"){if(!ua.transparencySupport){_b7="opaque"}else{_b1="transparent"}}for(var i=0;i<_a9.length;i++){var _b9=_a9[i];if(!ua.verifiedKonqueror){if(dom.getComputedStyle(_b9,"lineHeight").match(/e\+08px/)){ua.supported=_3b.isEnabled=false;this.removeFlashClass();return}ua.verifiedKonqueror=true}if(dom.hasClass(_3d,_b9)||dom.hasClass(_3f,_b9)){continue}var _ba=false;if(!_b9.offsetHeight||!_b9.offsetWidth){if(!_3b.replaceNonDisplayed){continue}_b9.style.display="block";if(!_b9.offsetHeight||!_b9.offsetWidth){_b9.style.display="";continue}_ba=true}if(_ad&&ua.gecko){_b9.style.clear="both"}var _bb=null;if(_3b.fixWrap&&ua.ie&&dom.getComputedStyle(_b9,"display")=="block"){_bb=_b9.innerHTML;dom.setInnerHtml(_b9,"X")}var _bc=dom.getStyleAsInt(_b9,"width",ua.ie);if(ua.ie&&_bc==0){var _bd=dom.getStyleAsInt(_b9,"paddingRight",true);var _be=dom.getStyleAsInt(_b9,"paddingLeft",true);var _bf=dom.getStyleAsInt(_b9,"borderRightWidth",true);var _c0=dom.getStyleAsInt(_b9,"borderLeftWidth",true);_bc=_b9.offsetWidth-_be-_bd-_c0-_bf}if(_bb&&_3b.fixWrap&&ua.ie){dom.setInnerHtml(_b9,_bb)}var _c1,_c2;if(!ua.ie){_c1=dom.getStyleAsInt(_b9,"lineHeight");_c2=Math.floor(dom.getStyleAsInt(_b9,"height")/_c1)}else{if(ua.ie){var _bb=_b9.innerHTML;_b9.style.visibility="visible";_b9.style.overflow="visible";_b9.style.position="static";_b9.style.zoom="normal";_b9.style.writingMode="lr-tb";_b9.style.width=_b9.style.height="auto";_b9.style.maxWidth=_b9.style.maxHeight=_b9.style.styleFloat="none";var _c3=_b9;var _c4=_b9.currentStyle.hasLayout;if(_c4){dom.setInnerHtml(_b9,"<div class=\""+_42+"\">X<br />X<br />X</div>");_c3=_b9.firstChild}else{dom.setInnerHtml(_b9,"X<br />X<br />X")}var _c5=_c3.getClientRects();_c1=_c5[1].bottom-_c5[1].top;_c1=Math.ceil(_c1*0.8);if(_c4){dom.setInnerHtml(_b9,"<div class=\""+_42+"\">"+_bb+"</div>");_c3=_b9.firstChild}else{dom.setInnerHtml(_b9,_bb)}_c5=_c3.getClientRects();_c2=_c5.length;if(_c4){dom.setInnerHtml(_b9,_bb)}_b9.style.visibility=_b9.style.width=_b9.style.height=_b9.style.maxWidth=_b9.style.maxHeight=_b9.style.overflow=_b9.style.styleFloat=_b9.style.position=_b9.style.zoom=_b9.style.writingMode=""}}if(_ba){_b9.style.display=""}if(_ad&&ua.gecko){_b9.style.clear=""}_c1=Math.max(_44,_c1);_c1=Math.min(_45,_c1);if(isNaN(_c2)||!isFinite(_c2)){_c2=1}var _c6=Math.round(_c2*_c1);if(_c2>1&&_b0){_c6+=Math.round((_c2-1)*_b0)}var _c7=dom.create("span");_c7.className=_40;var _c8=_b9.cloneNode(true);for(var j=0,l=_c8.childNodes.length;j<l;j++){_c7.appendChild(_c8.childNodes[j].cloneNode(true))}if(_a6.modifyContent){_a6.modifyContent(_c8,_a6.selector)}if(_a6.modifyCss){_b6=_a6.modifyCss(css,_c8,_a6.selector)}var _cb=handleContent(_c8,_b5);if(_a6.modifyContentString){_cb=_a6.modifyContentString(_cb,_a6.selector)}if(_cb==""){continue}var _cc=["content="+_cb.replace(/\</g,"&lt;").replace(/>/g,"&gt;"),"width="+_bc,"height="+_c6,"fitexactly="+(_ae?"true":""),"tunewidth="+(_a6.tuneWidth||""),"tuneheight="+(_a6.tuneHeight||""),"offsetleft="+(_a6.offsetLeft||""),"offsettop="+(_a6.offsetTop||""),"thickness="+(_a6.thickness||""),"sharpness="+(_a6.sharpness||""),"kerning="+_b3,"gridfittype="+_b4,"zoomsupport="+ua.zoomSupport,"filters="+_ac,"opacity="+_b2,"blendmode="+(_a6.blendMode||""),"size="+_c1,"zoom="+dom.getZoom(),"css="+_b6];_cc=encodeURI(_cc.join("&amp;"));var _cd="sIFR_callback_"+_49++;var _ce={flashNode:null};window[_cd+"_DoFSCommand"]=(function(_cf){return function(_d0,arg){if(/(FSCommand\:)?resize/.test(_d0)){var $=arg.split(":");_cf.flashNode.setAttribute($[0],$[1]);if(ua.khtml){_cf.flashNode.innerHTML+=""}}}})(_ce);_c6=Math.round(_c2*getRatio(_c1)*_c1);var _d3=_af?_bc:"100%";var _d4;if(ua.ie){_d4=["<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"",_cd,"\" sifr=\"true\" width=\"",_d3,"\" height=\"",_c6,"\" class=\"",_3e,"\">","<param name=\"movie\" value=\"",src,"\"></param>","<param name=\"flashvars\" value=\"",_cc,"\"></param>","<param name=\"allowScriptAccess\" value=\"always\"></param>","<param name=\"quality\" value=\"best\"></param>","<param name=\"wmode\" value=\"",_b7,"\"></param>","<param name=\"bgcolor\" value=\"",_b1,"\"></param>","<param name=\"name\" value=\"",_cd,"\"></param>","</object>","<scr","ipt event=FSCommand(info,args) for=",_cd,">",_cd,"_DoFSCommand(info, args);","</","script>"].join("")}else{_d4=["<embed class=\"",_3e,"\" type=\"application/x-shockwave-flash\" src=\"",src,"\" quality=\"best\" flashvars=\"",_cc,"\" width=\"",_d3,"\" height=\"",_c6,"\" wmode=\"",_b7,"\" bgcolor=\"",_b1,"\" name=\"",_cd,"\" allowScriptAccess=\"always\" sifr=\"true\"></embed>"].join("")}dom.setInnerHtml(_b9,_d4);_ce.flashNode=_b9.firstChild;_b9.appendChild(_c7);dom.addClass(_3d,_b9);if(_a6.onReplacement){_a6.onReplacement(_ce.flashNode)}}_5f.fragmentIdentifier.restore()};function handleContent(_d5,_d6){var _d7=[],_d8=[];var _d9=_d5.childNodes;var i=0;while(i<_d9.length){var _db=_d9[i];if(_db.nodeType==3){var _dc=_6b.normalize(_db.nodeValue);_dc=_6b.textTransform(_d6,_dc);_d8.push(_dc.replace(/\%/g,"%25").replace(/\&/g,"%26").replace(/\,/g,"%2C").replace(/\+/g,"%2B"))}if(_db.nodeType==1){var _dd=[];var _de=_db.nodeName.toLowerCase();var _df=_db.className||"";if(/\s+/.test(_df)){if(_df.indexOf(_41)){_df=_df.match("(\\s|^)"+_41+"-([^\\s$]*)(\\s|$)")[2]}else{_df=_df.match(/^([^\s]+)/)[1]}}if(_df!=""){_dd.push("class=\""+_df+"\"")}if(_de=="a"){var _e0=_db.getAttribute("href")||"";var _e1=_db.getAttribute("target")||"";_dd.push("href=\""+_e0+"\"","target=\""+_e1+"\"")}_d8.push("<"+_de+(_dd.length>0?" ":"")+escape(_dd.join(" "))+">");if(_db.hasChildNodes()){_d7.push(i);i=0;_d9=_db.childNodes;continue}else{if(!/^(br|img)$/i.test(_db.nodeName)){_d8.push("</",_db.nodeName.toLowerCase(),">")}}}if(_d7.length>0&&!_db.nextSibling){do{i=_d7.pop();_d9=_db.parentNode.parentNode.childNodes;_db=_d9[i];if(_db){_d8.push("</",_db.nodeName.toLowerCase(),">")}}while(i<_d9.length&&_d7.length>0)}i++}return _d8.join("").replace(/\n|\r/g,"")}}; sIFR.prefetch({ src: 'swf/sifr/helvetica.swf' }); sIFR.activate(); sIFR.replace({ selector: 'h2, h3', src: 'swf/sifr/helvetica.swf', wmode: 'transparent', css: { '.sIFR-root' : { 'color': '#000000', 'font-weight': 'bold', 'letter-spacing': '-1' }, 'a': { 'text-decoration': 'none' }, 'a:link': { 'color': '#000000' }, 'a:hover': { 'color': '#000000' }, '.span': { 'color': '#979797' }, 'label': { 'color': '#E11818' } } }); sIFR.replace({ selector: 'h4', src: 'swf/sifr/helvetica.swf', wmode: 'transparent', css: { '.sIFR-root' : { 'color': '#7E7E7E', 'font-weight': 'bold', 'letter-spacing': '-0.8' }, 'a': { 'text-decoration': 'none' }, 'a:link': { 'color': '#7E7E7E' }, 'a:hover': { 'color': '#7E7E7E' }, 'label': { 'color': '#E11818' } } }); sIFR.replace({ selector: '#cart p', src: 'swf/sifr/helvetica-lt.swf', wmode: 'transparent', css: { '.sIFR-root' : { 'color': '#979797', 'font-weight': 'bold', 'letter-spacing': '-0.8' }, 'a': { 'text-decoration': 'none' }, 'a:link': { 'color': '#979797' }, 'a:hover': { 'color': '#000000' }, 'label': { 'color': '#979797' } } }); Thank you in advance for your help!

    Read the article

  • Displaying wait cursor in while backgroundworker is running

    - by arc1880
    During the start of my windows application, I have to make a call to a web service to retrieve some default data to load onto my application. During the load of the form, I run a backgroundworker to retrieve this data. I want to display the wait cursor until this data is retrieved. How would I do this? I've tried setting the wait cursor before calling the backgroundworker to run. When I report a progress of 100 then I set it back to the default cursor. The wait cursor comes up but when I move the mouse it disappears. Environment: Windows 7 Pro 64-bit VS2010 C# .NET 4.0 Windows Forms EDIT: I am setting the cursor the way Jay Riggs suggested. It only works if I don't move the mouse. **UPDATE: I have created a button click which does the following: When I do the button click and move my mouse, the wait cursor appears regardless if I move my mouse or not. void BtnClick() { Cursor = Cursors.WaitCursor; Thread.Sleep(8000); Cursor = Cursors.Default; } If I do the following: I see the wait cursor and when I move the mouse it disappears inside the form. If I move to my status bar or the menu bar the wait cursor appears. Cursor = Cursors.WaitCursor; if (!backgroundWorker.IsBusy) { backGroundWorker.RunWorkerAsync(); } void backGroundWorkerDoWork(object sender, DoWorkEventArgs e) { Thread.Sleep(8000); } void backGroundWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { Cursor = Cursors.Default; } If I do the following: The wait cursor appears and when I move the mouse it still appears but will sometimes flicker off and on when moving in text fields. if (!backgroundWorker.IsBusy) { backGroundWorker.RunWorkerAsync(); } void backGroundWorkerDoWork(object sender, DoWorkEventArgs e) { UseWaitCursor = true; Thread.Sleep(8000); } void backGroundWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { UseWaitCursor = false; }

    Read the article

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