dynamically-generated

Wiring Controls in Visual Basic, Controlling the Controls

孤街醉人 提交于 2019-12-02 06:51:23
I'm in the middle of using Visual Basic (Visual Studio 2010) to create dynamically created controls. Essentially what I'm doing is creating a label, a textbox, a label (which will act as a stopwatch), and a button (to control said stopwatch). Each set of controls will be arranged (and named) like this in a row: [LABEL] [TEXTBOX] [TIMER] [BUTTON] Labelx ParticipantNamex RingTimerx ControlButtonx So for a given row, I will be look like this: [LABEL] [TEXTBOX] [TIMER] [BUTTON] Label1 ParticipantName1 RingTimer1 ControlButton1 I've gotten the bit about creating the elements dynamically as well as

Generating random non repeating number array in C++

时间秒杀一切 提交于 2019-12-02 04:03:35
问题 I need to generate random non repeating number array in C++, in this part of code I generate random numbers using, srand function, but some of the numbers are repeating. The main task is to generate random numbers for lottery ticket, so I need to generate numbers until golden number which is marked as int golden. #include <cstdlib> #include <ctime> #include <iostream> using namespace std; int main() { int golden = 31; int i = 0; int array[35]; srand((unsigned)time(0)); while(i != golden){

Generating random non repeating number array in C++

◇◆丶佛笑我妖孽 提交于 2019-12-01 23:26:52
I need to generate random non repeating number array in C++, in this part of code I generate random numbers using, srand function, but some of the numbers are repeating. The main task is to generate random numbers for lottery ticket, so I need to generate numbers until golden number which is marked as int golden. #include <cstdlib> #include <ctime> #include <iostream> using namespace std; int main() { int golden = 31; int i = 0; int array[35]; srand((unsigned)time(0)); while(i != golden){ array[i] = (rand()%75)+1; cout << array[i] << endl; i++; } } One strategy is to populate an array with

how to add component programmatically/dynamically to a p:dataTable facet

家住魔仙堡 提交于 2019-12-01 14:03:03
I'm trying to add a global filter for my <p:dataTable> of which I create programmatically from a managed bean. The table works fine and renders correctly, however only the last added component is rendered in the datatable facet. Here is the code I tried: //config FacesContext fc = FacesContext.getCurrentInstance(); Application application = fc.getApplication(); ExpressionFactory ef = application.getExpressionFactory(); ELContext elc = fc.getELContext(); //Table table = (DataTable) application.createComponent(DataTable.COMPONENT_TYPE); table.setId("tabexam"); table.setValue(listexam); table

how to add component programmatically/dynamically to a p:dataTable facet

岁酱吖の 提交于 2019-12-01 11:54:35
问题 I'm trying to add a global filter for my <p:dataTable> of which I create programmatically from a managed bean. The table works fine and renders correctly, however only the last added component is rendered in the datatable facet. Here is the code I tried: //config FacesContext fc = FacesContext.getCurrentInstance(); Application application = fc.getApplication(); ExpressionFactory ef = application.getExpressionFactory(); ELContext elc = fc.getELContext(); //Table table = (DataTable) application

dynamically created radiobuttonlist

二次信任 提交于 2019-12-01 09:40:32
Have a master page. The content page has a list with hyperlinks containing request variables. You click on one of the links to go to the page containing the radiobuttonlist (maybe). First problem: When I get to the new page, I use one of the variables to determine whether to add a radiobuttonlist to a placeholder on the page. I tried to do it in page)_load but then couldn't get the values selected. When I played around doing it in preInit, the first time the page is there, I can't get to the page's controls. (Object reference not set to an instance of an object.) I think it has something to do

dynamically created radiobuttonlist

感情迁移 提交于 2019-12-01 08:57:40
问题 Have a master page. The content page has a list with hyperlinks containing request variables. You click on one of the links to go to the page containing the radiobuttonlist (maybe). First problem: When I get to the new page, I use one of the variables to determine whether to add a radiobuttonlist to a placeholder on the page. I tried to do it in page)_load but then couldn't get the values selected. When I played around doing it in preInit, the first time the page is there, I can't get to the

How do I dynamically set source of an IFrame?

爷,独闯天下 提交于 2019-12-01 08:12:09
I have an IFrame embedding a youtube video. I want to create a textbox where user (admins) can paste a new src (URL) of video and the IFrame take the new source. Here is what I have so far: protected void Edited_Click(object sender, EventArgs e) { // HtmlControl frame1 = (HtmlControl)this.FindControl("frame1"); string url = TextBox1.Text; frame1.Attributes["src"] = url; } And in the html code is the Iframe: <div id="video"> <iframe title="YouTube video player" runat="server" width="420" frameborder="1" style="height: 265px; float: left; text-align: center;" id="frame1" name="frame1" align=

Android Creating button dynamically and fill layout

邮差的信 提交于 2019-11-30 10:17:04
I'm creating a button dynamically. The number of button is depend on the size of arraylist. the problem is, after creating the button I will add to the layout using addview method. The problem is I'm using linear layout, as by default orientation for linear layout is horizontal, so the button will fill the layout horizontally. Because of that some of the button is not visible. What I'm trying to achieve is something look like this My code is like below: Button[] tv = new Button[arraylist.size()]; for(int i=0;i<arraylist.size();i++){ tv[i] = new Button(getApplicationContext()); tv[i].setText

jQuery select dynamically created html element

北慕城南 提交于 2019-11-30 08:36:57
There are a lot of asked questions with almost similar titles with this question of mine, but you know I didn't find an answer. My simple question is: I have button, when I click on it, javascript creates modal window <div class="aui-dialog"> html here... <button id="closeButton">Close</button> </div> just after <body> tag. I can bind click event of close button with no problem using jQuery live : $("#closeButton").live("click", function() { alert("asdf"); // it calls $("body").find(".aui-dialog").remove(); }); My problem is , I cannot select that dynamically created modal window div by its