dynamic

dynamic buttons Android Layout

落花浮王杯 提交于 2019-12-11 08:20:06
问题 I want to create a layout in Android in a java class. I need that the user introduce a number between 1 to 20 and this create the number of butttons that the user has chosen.I want to create dynamic buttons and I have this code: package com.example.nuevo; import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.LinearLayout; public class ControladorResuelto extends Activity {

looping through object property names in actionscript

我的梦境 提交于 2019-12-11 08:14:36
问题 I have a dynamic class that I have created public dynamic class SiteZoneFileUploadVO { public var destination:String = "sitezone"; public var siteZoneId:uint; public var fileType:String; public var fileContents:String; public function SiteZoneFileUploadVO() { } } when I try to iterate over this object's property names it only iterates the dynamically added properties. parameters.dynVar= "value"; for(var name:String in parameters) { trace(name); } Even though the object has all the properties

Adding rows to mysql from dynamic jquery form fields

我只是一个虾纸丫 提交于 2019-12-11 08:09:04
问题 please excuse me as I am not proficient in php/mysql. I have an html form for inventory. I have a set of fields to update my sql database, they are item_name, item_cost, item_quantity. I have a jquery button that allows the user to dynamically add additional items/rows. Question: how can I have php loop whatever number of items the user adds and put them in the mysql database? thank you for your time. 回答1: If you have multiple form inputs with the same name, and that name ends in double

How to get values from dynamically created elements using jquery in code behind

梦想与她 提交于 2019-12-11 08:08:29
问题 Hi and thanks for taking the time to asnwer my question. I have the following problem. I have a form and a button which says "add new activities". Whenever the button is clicked I add a new set of elements, namely 2 drop down menus + text area. How can I get the values of these newly created elements in code behind since I cannot know their ids up front? If there is something unclear about my question, please let me know. Thanks again! 回答1: But you must be setting id's (more importantly -

Handling dynamic div's in selenium

匆匆过客 提交于 2019-12-11 07:57:27
问题 I am using a IWebDriver object. The Webpage contains dynamic div's. I have used to access the div's(elements) by using Xpath/Id or anything. So i have tried something like this List<IWebElement> webElement = chromeDriver.FindElements(By.XPath("//*[@id='dp_widgets_simplegrid_Grid_8']/div/div[1]/div/div[1]/div")); int rowsSize = webElement.Size(); It gave type casting error. Cannot convert system.Collections.ObjectModel.ReadOnlyCollection to System.Collections.Generic.List Then I have tried

Dynamically reassign method bodies to objects

岁酱吖の 提交于 2019-12-11 07:56:00
问题 Is it possible to have class A with an empty method say render() .. then you create 3 instances of the class, so you have objects b, c, d , so can I THEN assign bodies for the render method for each object? Here's an example, in JavaScript you can have an object say a and then anywhere you can say a.method = function() { /* do something */ } After that line, you will have a method with the name method for the object a and whenever called it will /* do something */ . Is this possible in Java

Dynamic Linq OrderBy null error

纵然是瞬间 提交于 2019-12-11 07:54:15
问题 I'm using dynamic Linq to order a result set depending on which column is passed in. I'm using this to order a table when a user clicks on a table column. If the property im ordering on is a class which is null the code falls over, i want to be able to dynamically orderby a string but cater for nulls if the property is a class. This is the code from the System.Linq.Dynamic class im using. public static IQueryable OrderBy(this IQueryable source, string ordering, params object[] values) { if

How to change dynamically the icons when the look and feel change?

江枫思渺然 提交于 2019-12-11 07:50:10
问题 I'm developing a look-and-feel with two themes. The problem is: I want to be able to switch dynamically between the two themes (it means changing the themes after startup). But the themes have two different sets of icons (in fact the same icons with different colors). I don't know how to change dynamically the icons in the entire application. One solution would be to register each component with an icon and the icon ID on an icon manager to switch between the two kinds of icons, but it seems

MVVM - Where should I put code that dynamically generates and loads XAML?

佐手、 提交于 2019-12-11 07:49:12
问题 I guess this is sort of a philosophical question, but I have some code that dynamically adds templated columns to a GridView by generating the XAML at runtime from Model data and loading it using XamlReader. My question is, In an MVVM world, where should I put the code that accomplishes this? At the moment, I have it in the codebehind, but I'm contemplating whether I should move it to the ViewModel. 回答1: There is a big movement in WPF/Silverlight developers circles to move to a MVVM

Can't delete dynamically allocated multidimensional array

安稳与你 提交于 2019-12-11 07:44:51
问题 I can't delete the dynamically generated arrays. There is how I create them: template <typename T> T **AllocateDynamic2DArray(int nRows, int nCols){ T **dynamicArray; dynamicArray = new T*[nRows]; for( int i = 0 ; i < nRows ; i++ ){ dynamicArray[i] = new T[nCols]; for ( int j=0; j<nCols;j++){ dynamicArray[i][j]= 0; } } return dynamicArray; } And I initialize a 2D array using: long double** h = AllocateDynamic2DArray<long double>(KrylovDim+1,KrylovDim); I can't delete it. Here are the