Search Results

Search found 7104 results on 285 pages for 'dynamic usercontrols'.

Page 97/285 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • What is happening in this T-SQL code? (Concatenting the results of a SELECT statement)

    - by Ben McCormack
    I'm just starting to learn T-SQL and could use some help in understanding what's going on in a particular block of code. I modified some code in an answer I received in a previous question, and here is the code in question: DECLARE @column_list AS varchar(max) SELECT @column_list = COALESCE(@column_list, ',') + 'SUM(Case When Sku2=' + CONVERT(varchar, Sku2) + ' Then Quantity Else 0 End) As [' + CONVERT(varchar, Sku2) + ' - ' + Convert(varchar,Description) +'],' FROM OrderDetailDeliveryReview Inner Join InvMast on SKU2 = SKU and LocationTypeID=4 GROUP BY Sku2 , Description ORDER BY Sku2 Set @column_list = Left(@column_list,Len(@column_list)-1) Select @column_list ---------------------------------------- 1 row is returned: ,SUM(Case When Sku2=157 Then Quantity Else 0 End) As [157 -..., SUM(Case ... The T-SQL code does exactly what I want, which is to make a single result based on the results of a query, which will then be used in another query. However, I can't figure out how the SELECT @column_list =... statement is putting multiple values into a single string of characters by being inside a SELECT statement. Without the assignment to @column_list, the SELECT statement would simply return multiple rows. How is it that by having the variable within the SELECT statement that the results get "flattened" down into one value? How should I read this T-SQL to properly understand what's going on?

    Read the article

  • Replacing content with jquery.

    - by BillZ
    I am loading a movie into a overlay. My problem is that when I close the div overlay the movie continues to play. I do not control the code on the move side it is imported via a script tag which then opens in a iframe. I am able to remove the content of the of the div and then the movie stops playing. Then of course when the user opens the div again the movie is gone. My current thinking was that I could simply replace the script tag with one just like it but the outcome of that is that there is nothing there. I have been using jquery. Thanks -- script -- $(document).ready(function() { $("#closeModal2").click(function() { $("#movieContainer").html("<script src='http://www.accelacast.com/programs/launch.js'/>"); }); }); -- html -- <div id="movieContainer"> <script id="movieTag" language='JavaScript' src='http://www.accelacast.com/programs/launch.js'/> </div> On a side note. I tried replacing the src attribute of the script tag with no luck. I was able to replace the src of a image though. Is it not possible to effect the src attribute of script? Thanks

    Read the article

  • Re-binding an ajaxForm after content re-loads with ajax (jQuery 1.4.2)

    - by Cristian
    I'm trying to figure out why this is a problem when using jQuery 1.4.2 and not 1.3.2. This is my function: function prepare_logo_upload() { $("#logo-upload-form").ajaxForm({ //alert(responseText); success: function(responseText) { //alert(responseText); $('#profile .wrapper').html(responseText); prepare_logo_upload(); } }); } Every other live event works but can't use the .live() method because ajaxForm is a plugin. I have noticed this also for other types of binding (clicks) using the old form (re-binding after callback) Can you tell me if it is a way of solving this? This is a similar question, but due to my newbie reputation here, can't comment or ask a question there, so I'll ask a new one here. - http://stackoverflow.com/questions/2208880/jquery-bind-ajaxform-to-a-form-on-a-page-loaded-via-load Thank you!

    Read the article

  • Populating a GridView with ImageViews dynamically/programmatically using a ImageAdapter

    - by Julian Vogels
    Hi folks, this is my first question at stackoverflow, but it's a little tricky already... I try to develop an Android App which allows the user to fetch data from flickr and show it in a gridview (with some nice 3D-Animation). After some adventures i got it almost running, but now I'm stuck. Here's the problem: I got a UI Thread "LoadPhotosTask" which gets the pictures from flickr, just like the open source application photostream. In the method onProgressUpdate(LoadedPhoto... value) of that subclass I call addPhoto(). Until now everythings fine - I got some nice Bitmap and Flickr.photo data with all the information I need. @Override public void onProgressUpdate(LoadedPhoto... value) { addPhoto(value); } On the other hand I have got a GridView. Now I want to fill it with the Photos. It has got an adapter called ImageAdapter (which extends BaseAdapter, see this tutorial). If I use an array inside the ImageAdapter class I can populate the GridView with some sample images. But if I want to populate it at runtime, I don't know what to do. How do I have to set up the getView method in the ImageAdapter? I was trying to fill the array inside the ImageAdapter class with my values in addPhoto, but it doesn't display anything. So first of all I was setting up the array with the amount of Photos i wanted to display in the grid like that (code is inside the ImageAdapter class): // class variable private ImageView[] mThumbIds; [...] public void setupArray(int count) { this.mThumbIds = new ImageView[count]; } Then I call this method with the lenght of my photolist: final Flickr.PhotoList list = params[0]; final int count = list.getCount(); int helper = 0; imagead.setupArray(count); Afterwards I call the getView method manually inside the addPhoto method: private void addPhoto(LoadedPhoto... value) { ImageView image = (ImageView) mInflater.inflate( R.layout.grid_item_photo, null); image.setImageBitmap(value[0].mBitmap); image.setTag(value[0].mPhoto); imagead.setmThumbIds(image, value[0].mPosition); imagead.getView(value[0].mPosition, null, mpicturesGrid); } That is the getView method inside ImageAdapter: public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { // if it's not recycled, initialize some // attributes imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(EDGE_LENGTH, EDGE_LENGTH)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(0, 0, 0, 0); imageView.setVisibility(View.VISIBLE); } else { imageView = (ImageView) convertView; } imageView.setImageDrawable(mThumbIds[position].getDrawable()); imageView.setTag(mThumbIds[position].getTag()); return imageView; } Ok, finally I apologize for my poor english and I hope you can give me some help with the information I provided. Greetings, Julian

    Read the article

  • Template and Themes in WPF through Custom Xaml Files

    - by AKRamkumar
    I have an application where I give my user Widgets. Suppose my user wants to customize the layout of the widgets. For example, I have a clock that is green. In Xaml, to add an animation around the clock would be easy. How could i make it such that at runtime, my application reads a layout.xaml file. Loads it and parses all the gradients and xaml. But still be able to use my widget in there. EG <Layout> <Grid> <!-- Grid Definitions or Animations or Whatever--> <Clock/> <!-- They need to be able to simply use this and my applications needs to read this--> </Grid> </Layout>

    Read the article

  • c++ dynamic_cast error handling

    - by Nazgob
    Is there any good practice related to dynamic_cast error handling (except not using it when you don't have to)? I'm wondering how should I go about NULL and bad_cast it can throw. Should I check for both? And if I catch bad_cast or detect NULL I probably can't recover anyway... For now, I'm using assert to check if dynamic_cast returned not NULL value. Would you accept this solution on a code review?

    Read the article

  • Convert string to variable in Javascript

    - by waiwai933
    Is there any way to convert a string to a variable in Javascript? Right now, what I have is a script that updates data based on the values of the select box: <script type="text/javascript"> var a = new Array(); a[0] = 'Name'; a[1] = 'Description'; var b = new Array(); b[0] = 'Name 2'; b[1] = 'Description 2'; function changeSystem(){ var selectedAccount=document.getElementById('selected_option').value; document.getElementById('name').innerHTML = selectedAccount[0]; document.getElementById('description').innerHTML = selectedAccount[1]; } </script> <form method="POST"> <select onchange="changeSystem()" id="selected_option"> <option>A</option> <option>B</option> </select> </form> <span id="name"></span><br> <span id="description"></span><br> selectedAccount is the string of the chosen element in <select>. However, for it to access the array, it needs to be a variable, i.e. a[0] instead of 'a'[0]. What solutions are there to this?

    Read the article

  • Django: How to dynamically add tag field to third party apps without touching app's source code

    - by Chris Lawlor
    Scenario: large project with many third party apps. Want to add tagging to those apps without having to modify the apps' source. My first thought was to first specify a list of models in settings.py (like ['appname.modelname',], and call django-tagging's register function on each of them. The register function adds a TagField and a custom manager to the specified model. The problem with that approach is that the function needs to run BEFORE the DB schema is generated. I tried running the register function directly in settings.py, but I need django.db.models.get_model to get the actual model reference from only a string, and I can't seem to import that from settings.py - no matter what I try I get an ImportError. The tagging.register function imports OK however. So I changed tactics and wrote a custom management command in an otherwise empty app. The problem there is that the only signal which hooks into syncdb is post_syncdb which is useless to me since it fires after the DB schema has been generated. The only other approach I can think of at the moment is to generate and run a 'south' like database schema migration. This seems more like a hack than a solution. This seems like it should be a pretty common need, but I haven't been able to find a clean solution. So my question is: Is it possible to dynamically add fields to a model BEFORE the schema is generated, but more specifically, is it possible to add tagging to a third party model without editing it's source. To clarify, I know it is possible to create and store Tags without having a TagField on the model, but there is a major flaw in that approach in that it is difficult to simultaneously create and tag a new model.

    Read the article

  • Select row data as ColumnName and Value

    - by Bobcat1506
    I have a history table and I need to select the values from this table in ColumnName, ColumnValue form. I am using SQL Server 2008 and I wasn’t sure if I could use the PIVOT function to accomplish this. Below is a simplified example of what I need to accomplish: This is what I have: The table’s schema is CREATE TABLE TABLE1 (ID INT PRIMARY KEY, NAME VARCHAR(50)) The “history” table’s schema is CREATE TABLE TABLE1_HISTORY( ID INT, NAME VARCHAR(50), TYPE VARCHAR(50), TRANSACTION_ID VARCHAR(50)) Here is the data from TABLE1_HISTORY ID NAME TYPE TRANSACTION_ID 1 Joe INSERT a 1 Bill UPDATE b 1 Bill DELETE c I need to extract the data from TABLE1_HISTORY into this format: TransactionId Type ColumnName ColumnValue a INSERT ID 1 a INSERT NAME Joe b UPDATE ID 1 b UPDATE NAME Bill c DELETE ID 1 c DELETE NAME Bill Other than upgrading to Enterprise Edition and leveraging the built in change tracking functionality, what is your suggestion for accomplishing this task?

    Read the article

  • jQuery-AJAX to rebind dropdown list to results from stored procedure

    - by webworm
    I have a dropdown list of peoples names that is quite long. As many as 2,000 names. I would like to make it easier to find the name the user is interested in by limiting the dropdown list to a subset of names at a time. I have done this by creating a series of 26 links (A, B, C ... Z) that call a method in the code behind that populates the dropdown list with only those names starting with the letter the user clicked. This all works well but I would like to be able to use AJAX to accomplish this update of the dropdown list without a page refresh. I would like to use jQuery for the AJAX functionality rather than ASP.NET AJAX. My problem is I am not sure how to execute the stored procedure and then "rebind" the dropdown list with the new dataset via jQuery AJAX. Any suggestions or resources that might provide and example or walk-through? Thank you.

    Read the article

  • SQL select row into a string variable without knowing columns

    - by Brandi
    Hello, I am new to writing SQL and would greatly appreciate help on this problem. :) I am trying to select an entire row into a string, preferably separated by a space or a comma. I would like to accomplish this in a generic way, without having to know specifics about the columns in the tables. What I would love to do is this: DECLARE @MyStringVar NVARCHAR(MAX) = '' @MyStringVar = SELECT * FROM MyTable WHERE ID = @ID AS STRING But what I ended up doing was this: DECLARE @MyStringVar = '' DECLARE @SecificField1 INT DECLARE @SpecificField2 NVARCHAR(255) DECLARE @SpecificField3 NVARCHAR(1000) ... SELECT @SpecificField1 = Field1, @SpecificField2 = Field2, @SpecificField3 = Field3 FROM MyTable WHERE ID = @ID SELECT @StringBuilder = @StringBuilder + CONVERT(nvarchar(10), @Field1) + ' ' + @Field2 + ' ' + @Field3 Yuck. :( I have seen some people post stuff about the COALESCE function, but again, I haven't seen anyone use it without specific column names. Also, I was thinking, perhaps there is a way to use the column names dynamically getting them by: SELECT [COLUMN_NAME] FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'MyTable' It really doesn't seem like this should be so complicated. :( What I did works for now, but thanks ahead of time to anyone who can point me to a better solution. :) EDIT: Got it fixed, thanks to everyone who answered. :)

    Read the article

  • Methods to achieve first, previous, next and last navigation

    - by Koroviev
    I'm new to programming and have a question about navigation. What are the various methods that can achieve a "First", "Previous", "Next" and "Last" navigation, as seen in article or comic based sites? (Admittedly the "First" link isn't confusing as it can stay static, but what about the others?) For example, on the 50th page, the links would appropriately lead to the 49th and 51st (if it exists, if not it would not function but would automatically become active when such a page exists. In most examples of this I see urls ending with something like ".php?id=50" but am not certain how it's achieved, with a database? Any help will be very much appreciated, thanks.

    Read the article

  • Programmatically loading Entity classes with JPA 2.0?

    - by Dennetik
    With Hibernate you can load your Entity classes as: sessionFactory = new AnnotationConfiguration() .addPackage("test.animals") .addAnnotatedClass(Flight.class) .addAnnotatedClass(Sky.class) .addAnnotatedClass(Person.class) .addAnnotatedClass(Dog.class); Is there a way to do the same thing - programmatically loading your Entity classes - in a JPA 2.0 compliant way?

    Read the article

  • Drupal 6, Views 2: Is it possible to have a filter that only applies to registered users?

    - by dajoropo
    Hello, Is it possible to create a filter in a Drupal 6 View that is only applied for registered users? For one filter I need I'm using the user vote (With fivestar and votingapi) to know if they user already voted this node or not, and when the user is annonymous, is working as if all the votes from all the annonymous users where from the same. This is why I need to add this filter, but ignore it in case the user is annonymous. Thanks a lot in advance for the help!

    Read the article

  • Assigned numbers to movie clip to plug in formula... not working

    - by Matthew MlgPro Harding
    So I am attempting to vertically evenly space these movie clips so I came up with a math formula involving n( the button number) but Its not working. var buttonArray:Array = [ side_banner.btn1, side_banner.btn2, side_banner.btn3, side_banner.btn4]; var buttonCount:uint = buttonArray.length; for (var i:uint=0; i< buttonCount; i++) { buttonArray[i].addEventListener(MouseEvent.CLICK, outputNumber); buttonArray[i].theTrigger = [i + 1]; } function outputNumber(e:MouseEvent):void { trace( e.target.theTrigger); buttonArray[i].y = (((stage.stageHeight - 400)/4)*(e.target.theTrigger)) - ((stage.stageHeight - 400)/4)/2 } But apparently each movie clip doesn't actually have a numerical value just a numeric name... how can I get the "n" btn number to use my formula? Thanks

    Read the article

  • attaching id to a movieclip

    - by Ross
    I have a loop that creates mc from a database for (var i:Number = 0; i < t.length; i++) { var portfolioItem:PortfolioItem = new PortfolioItem(); addChild(portfolioItem); portfolioItem.name = t[i][0]; portfolioItem.addEventListener(MouseEvent.CLICK, getThisName); } public function getThisName(evt:Event) { trace(evt.target.name); } I try and assign t[i][0] which is the table id to the name attribute but I jsut get 'instance4' or instance 14. How can I give these dynamically create mc's a name or custom property? ideally I would like to use a custom property called portfolio.id but would use the name property or another default property if it works.

    Read the article

  • Place an object on top of stack in ILGenerator

    - by KiNGPiN
    I have to pass a function an instance of an object, so obviously all the information to be taken as argument is to be loaded onto the evaluation stack Here is the code that i am looking for someClass SomeObject = new someClass(); il.Emit(OpCodes.LoadObject, SomeObject); il.Emit(OpCodes.CallVirt, MethodInfo Function); public void Function(Object obj) { Type type = typeof(obj); //do something w.r.t to the type } I dont require any information stored in the class just the type and i cannot use any of the primitive types to take my decision on Last i read that i can use a pointer to load the type using some opcodes ... but i am completely lost here, any help or pointers to the right direction would be great :)

    Read the article

  • How to make the value of one select box drive the options of a second select box

    - by Ben McCormack
    I want to make an HTML form with 2 select boxes. The selected option in the first select box should drive the options in the second select box. I would like to solve this dynamically on the client (using javascript or jQuery) rather than having to submit data to the server. For example, let's say I have the following Menu Categories and Menu Items: Sandwiches Turkey Ham Bacon Sides Mac 'n Cheese Mashed Potatoes Drinks Coca Cola Sprite Sweetwater 420 I would have two select boxes, named Menu Category and Items, respectively. When the user selects Sandwiches in the Menu Category box, the options in the Items box will only show Sandwich options. I'm stuck as how I might approach this. Once I filter out the 2nd list one time, how do I "find" the list options once I change my menu category in the 1st list? Also, if I'm thinking in SQL, I would have a key in the 1st box that would be used to link to the data in the 2nd box. However, I can't see where I have room for a "key" element in the 2nd box. How could this problem be solved with a combination of jQuery or plain javascript?

    Read the article

  • In .NET, how do I prevent, or handle, tampering with form data of disabled fields before submission?

    - by David
    Hi, If a disabled drop-down list is dynamically rendered to the page, it is still possible to use Firebug, or another tool, to tamper with the submitted value, and to remove the "disabled" HTML attribute. This code: protected override void OnLoad(EventArgs e) { var ddlTest = new DropDownList() {ID="ddlTest", Enabled = false}; ddlTest.Items.AddRange(new [] { new ListItem("Please select", ""), new ListItem("test 1", "1"), new ListItem("test 2", "2") }); Controls.Add(ddlTest); } results in this HTML being rendered: <select disabled="disabled" id="Properties_ddlTest" name="Properties$ddlTest"> <option value="" selected="selected">Please select</option> <option value="1">test 1</option> <option value="2">test 2</option> </select> The problem occurs when I use Firebug to remove the "disabled" attribute, and to change the selected option. On submission of the form, and re-creation of the field, the newly generated control has the correct value by the end of OnLoad, but by OnPreRender, it has assumed the identity of the submitted control and has been given the submitted form value. .NET seems to have no way of detecting the fact that the field was originally created in a disabled state and that the submitted value was faked. This is understandable, as there could be legitimate, client-side functionality that would allow the disabled attribute to be removed. Is there some way, other than a brute force approach, of detecting that this field's value should not have been changed? I see the brute force approach as being something crap, like saving the correct value somewhere while still in OnLoad, and restoring the value in the OnPreRender. As some fields have dependencies on others, that would be unacceptable to me.

    Read the article

  • Dynamically add items to Tkinter Canvas

    - by nick369
    I'm attempting to learn Tkinter with the goal of being able to create a 'real-time' scope to plot data. As a test, I'm trying to draw a polygon on the canvas every time the 'draw' button is pressed. The triangle position is randomized. I have two problems: There is a triangle on the canvas as soon as the program starts, why and how do I fix this? It doesn't draw any triangles when I press the button, at least none that I can see. CODE from Tkinter import * from random import randint class App: def __init__(self,master): #frame = Frame(master) #frame.pack(side = LEFT) self.plotspc = Canvas(master,height = 100, width = 200, bg = "white") self.plotspc.grid(row=0,column = 2, rowspan = 5) self.button = Button(master, text = "Quit", fg = "red", \ command = master.quit) self.button.grid(row=0,column=0) self.drawbutton = Button(master, text = "Draw", command = \ self.pt([50,50])) self.drawbutton.grid(row = 0, column = 1) def pt(self, coords): coords[0] = coords[0] + randint(-20,20) coords[1] = coords[1] + randint(-20,20) x = (0,5,10) y = (0,10,0) xp = [coords[0] + xv for xv in x] yp = [coords[1] + yv for yv in y] ptf = zip(xp,yp) self.plotspc.create_polygon(*ptf) if _name_ == "_main_": root = Tk() app = App(root) root.mainloop() The code is formatting strangely within the code tags, I have no idea how to fix this.

    Read the article

  • Using jQuery's animate(), if the clicked on element is "<a href="#" ...> </a>", the fucntion should

    - by Jian Lin
    I was reading jQuery's page for animate() http://api.jquery.com/animate/ Its examples don't mention about if using <a href="#" id="clickme">click me</a> ... $('#clickme').click(function() { $('#someDiv').animate({left: "+=60"}); }) we actually still have to return false like in the old days? $('#clickme').click(function() { $('#someDiv').animate({left: "+=60"}); return false; }) (but then, those examples didn't use a <a> for the "click me"... but used something else. Otherwise the page will jump back to the beginning of the page? Does jQuery have a more elegant or magical way of doing it?

    Read the article

  • .NET generic class instance - passing a variable data type

    - by FerretallicA
    As the title suggests, I'm tyring to pass a variable data type to a template class. Something like this: frmExample = New LookupForm(Of Models.MyClass) 'Works fine Dim SelectedType As Type = InstanceOfMyClass.GetType() 'Works fine frmExample = New LookupForm(Of SelectedType) 'Ba-bow! frmExample = New LookupForm(Of InstanceOfMyClass.GetType()) 'Ba-bow! LookupForm<Models.MyClass> frmExample; Type SelectedType = InstanceOfMyClass.GetType(); frmExample = new LookupForm<SelectedType.GetType()>(); //Ba-bow frmExample = new LookupForm<(Type)SelectedType>(); //Ba-bow I'm assuming it's something to do with the template being processed at compile time but even if I'm off the mark there, it wouldn't solve my problem anyway. I can't find any relevant information on using Reflection to instance template classes either. (How) can I create an instance of a dynamically typed repository at runtime?

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >