Search Results

Search found 35003 results on 1401 pages for 'table variable'.

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

  • How to bind an ADF Table on button click

    - by Juan Manuel Formoso
    Coming from ASP.NET I'm having a hard time with basic ADF concepts. I need to bind a table on a button click, and for some reason I don't understand (I'm leaning towards page life cycle, which I guess is different from ASP.NET) it's not working. This is my ADF code: <af:commandButton text="#{viewcontrollerBundle.CMD_SEARCH}" id="cmdSearch" action="#{backingBeanScope.indexBean.cmdSearch_click}" partialSubmit="true"/> <af:table var="row" rowBandingInterval="0" id="t1" value="#{backingBeanScope.indexBean.transactionList}" partialTriggers="::cmdSearch" binding="#{backingBeanScope.indexBean.table}"> <af:column sortable="false" headerText="idTransaction" id="c2"> <af:outputText value="#{row.idTransaction}" id="ot4"/> </af:column> <af:column sortable="false" headerText="referenceCode" id="c5"> <af:outputText value="#{row.referenceCode}" id="ot7"/> </af:column> </af:table> This is cmdSearch_click: public String cmdSearch_click() { List l = new ArrayList(); Transaction t = new Transaction(); t.setIdTransaction(BigDecimal.valueOf(1)); t.setReferenceCode("AAA"); l.add(t); t = new Transaction(); t.setIdTransaction(BigDecimal.valueOf(2)); t.setReferenceCode("BBB"); l.add(t); setTransactionList(l); // AdfFacesContext.getCurrentInstance().addPartialTarget(table); return null; } The commented line also doesn't work. If I populate the list on my Bean's constructor, the table renders ok. Any ideas?

    Read the article

  • Need help with many-to-many relationships....

    - by yuudachi
    I have a student and faculty table. The primary key for student is studendID (SID) and faculty's primary key is facultyID, naturally. Student has an advisor column and a requested advisor column, which are foreign key to faculty. That's simple enough, right? However, now I have to throw in dates. I want to be able to view who their advisor was for a certain quarter (such as 2009 Winter) and who they had requested. The result will be a table like this: Year | Term | SID | Current | Requested ------------------------------------------------ 2009 | Winter | 860123456 | 1 | NULL 2009 | Winter | 860445566 | 3 | NULL 2009 | Winter | 860369147 | 5 | 1 And then if I feel like it, I could also go ahead and view a different year and a different term. I am not sure how these new table(s) will look like. Will there be a year table with three columns that are Fall, Spring and Winter? And what will the Fall, Spring, Winter table have? I am new to the art of tables, so this is baffling me... Also, I feel I should clarify how the site works so far now. Admin can approve student requests, and what happens is that the student's current advisor gets overwritten with their request. However, I think I should not do that anymore, right?

    Read the article

  • Query to look up comment in one table, username in another table

    - by John
    Hello, I am using a MySQL table called "login" with the following structure: loginid, username, password, email, actcode, disabled, activated, created, points I am using another MySQL table called "comment" with the following structure: commentid, loginid, submissionid, comment, datecommented For a given "submisssionid", I would like to print out the following information from the table "comment": -The fields "comment" and "datecommented". At the same time, I would like to print out the following from the table "login": -The "username" that corresponds to the "loginid" for each row being row being selected from the table "comment". How can I do this? I tried the code below but it did not work. Thanks in advance, John $submission = mysql_real_escape_string($_GET['submission']); $submissionid = mysql_real_escape_string($_GET['submissionid']); $sqlStr = "SELECT c.loginid ,c.submissionid ,c.comment ,c.datecommented ,l.username ,COUNT(c.commentid) countComments FROM comment c WHERE c.submissionid = $submissionid INNER JOIN login l ON c.loginid = l.loginid GROUP BY c.submissionid ORDER BY c.datecommented DESC LIMIT 100"; $result = mysql_query($sqlStr); $arr = array(); echo "<table class=\"samplesrec\">"; while ($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td class="sitename1">'.$row["comment"].'</td>'; echo '</tr>'; echo '<tr>'; echo '<td class="sitename2"><a href="http://www...com/sandbox/members/index.php?profile='.$row["username"].'">'.$row["username"].'</a>'.$row["datecommented"].'</td>'; echo '</tr>'; } echo "</table>";

    Read the article

  • Assigning a variable of a struct that contains an instance of a class to another variable

    - by xport
    In my understanding, assigning a variable of a struct to another variable of the same type will make a copy. But this rule seems broken as shown on the following figure. Could you explain why this happened? using System; namespace ReferenceInValue { class Inner { public int data; public Inner(int data) { this.data = data; } } struct Outer { public Inner inner; public Outer(int data) { this.inner = new Inner(data); } } class Program { static void Main(string[] args) { Outer p1 = new Outer(1); Outer p2 = p1; Console.WriteLine("p1:{0}, p2:{1}", p1.inner.data, p2.inner.data); p1.inner.data = 2; Console.WriteLine("p1:{0}, p2:{1}", p1.inner.data, p2.inner.data); p2.inner.data = 3; Console.WriteLine("p1:{0}, p2:{1}", p1.inner.data, p2.inner.data); Console.ReadKey(); } } }

    Read the article

  • Resolve bash variable containted in another variable

    - by kogut
    I have code like that: TEXT_TO_FILTER='I would like to replace this $var to proper value' var=variable All I want to get is: TEXT_AFTER_FILTERED="I'd like to replace this variable to proper value" So I did: TEXT_AFTER_FILTERED=`eval echo $TEXT_TO_FILTER` TEXT_AFTER_FILTERED=`eval echo $(eval echo $TEXT_TO_FILTER)` Or even more weirder things, but without any effects. I remember that someday I had similar problem and I did something like that: cat << EOF > tmp.sh echo $TEXT_TO_FILTER EOF chmod +x tmp.sh TEXT_AFTER_FILTERED=`. tmp.sh` But this solution seems to be to much complex. Have any of You heard about easier solution?

    Read the article

  • HTML table with auto-fit for some columns, fixed width for others

    - by sangil
    I'm trying to create a table adhering to the following requirements: The table width must be defined as 0 - the browser should calculate the width according to the column widths (this is to accommodate a column-resize plugin). Some columns may receive a fixed width (e.g. 50px); Columns that do not receive a fixed width, must auto-fit to the content. I have created a small example to illustrate the problem - as you can see column 3 stays at width 0 and so is not visible. HTML <table> <tr> <td class="cell header" id="header1">Header 1</td> <td class="cell header" id="header2">Header 2</td> <td class="cell header" id="header3">Header 3</td> </tr> <tr> <td class="cell">Cell 1</td> <td class="cell">Cell 2</td> <td class="cell">Very looooong content</td> </tr> </table> CSS table { table-layout: fixed; width: 100%; border: 1px solid #696969; } .cell { color: #898989; border: 1px solid #888; padding: 2px; overflow: hidden; } .header { background-color: lightsteelblue; color: black; } #header1, #header2 { width: 50px; } Is this even possible? Any help would be appreciated...

    Read the article

  • Striped table rows in ASP.NET MVC (without using jQuery or equivalent)

    - by Richard Ev
    When using an ASP.NET WebForms ListView control to display data in an HTML table I use the following technique in to "stripe" the table rows: <ItemTemplate> <tr class="<%# Container.DisplayIndex % 2 == 0 ? "" : "alternate" %>"> <!-- table cells in here --> </tr> </ItemTemplate> With the following CSS: tr.alternate { background-color: #EFF5FB; } I have just gone through the ASP.NET MVC Movie Database Application tutorial and learnt that in MVC-land table rows can be (must be?) constructed as follows: <% foreach (var item in Model) { %> <tr> <td> <%= Html.Encode(item.Title) %> </td> <!-- and so on for the rest of the table cells... --> </tr> <% } %> What can I add to this code to stripe the rows of my table? Note: I know that this can be done using jQuery, I want to know if it can be done another way. Edit If jQuery (or equivalent) is in your opinion the best or most appropriate post, I'd be interested in knowing why.

    Read the article

  • Bash scripting - Iterating through "variable" variable names for a list of associative arrays

    - by user1550254
    I've got a variable list of associative arrays that I want to iterate through and retrieve their key/value pairs. I iterate through a single associative array by listing all its keys and getting the values, ie. for key in "${!queue1[@]}" do echo "key : $key" echo "value : ${queue1[$key]}" done The tricky part is that the names of the associative arrays are variable variables, e.g. given count = 5, the associative arrays would be named queue1, queue2, queue3, queue4, queue5. I'm trying to replace the sequence above based on a count, but so far every combination of parentheses and eval has not yielded much more then bad substitution errors. e.g below: for count in {1,2,3,4,5} do for key in "${!queue${count}[@]}" do echo "key : $key" echo "value : ${queue${count}[$key]}" done done Help would be very much appreciated!

    Read the article

  • Create Dynamically table at runtime & save it in database

    - by user1548245
    I have written a code for creating table. It displays table structure on GUI form, but what I want is, when I enter values into table it should be stored in database table too. My code: <?php function display($column,$rows) { echo "<table border='1' align='center'>"; for ($iii = 0;$iii <$_POST['column'];$iii++) { echo "<tr>".$jjj."</tr>"; //display no. of <tr> for ($jjj = 0; $jjj <$_POST['rows'];$jjj++) { echo "<td>" ."<input type=\"text\" name='$iii'>"."</td>"; } } echo "</table>"; } ?>

    Read the article

  • Access variable value using string representing variable's name

    - by Paul Ridgway
    Hello everyone, If the title was not clear, I will try to clarify what I am asking: Imagine I have a variable called counter, I know I can see its current value by doing something like: std::cout << counter << std::endl; However, assume I have lots of variables and I don't know which I'm going to want to look at until runtime. Does anyone know a way I can fetch the value of a variable by using its name, for example: std::cout << valueOf("counter") << std::endl; I feel being able to do this might make debugging large complex projects easier. Thanks in advance for your time.

    Read the article

  • C++ Access variable value using string representing variable's name

    - by Paul Ridgway
    Hello everyone, If the title was not clear, I will try to clarify what I am asking: Imagine I have a variable called counter, I know I can see its current value by doing something like: std::cout << counter << std::endl; However, assume I have lots of variables and I don't know which I'm going to want to look at until runtime. Does anyone know a way I can fetch the value of a variable by using its name, for example: std::cout << valueOf("counter") << std::endl; I feel being able to do this might make debugging large complex projects easier. Thanks in advance for your time. PS: Please do not respond with 'Google it', I have, though maybe not with the best query to get the answer I'm looking for...

    Read the article

  • Multiple Foreign keys to a single table and single key pointing to more than one table

    - by user1216775
    I need some suggestions from the database design experts here. I have around six foreign keys into a single table (defect) which all point to primary key in user table. It is like: defect (.....,assigned_to,created_by,updated_by,closed_by...) If I want to get information about the defect I can make six joins. Do we have any better way to do it? Another one is I have a states table which can store one of the user-defined set of values. I have defect table and task table and I want both of these tables to share the common state table (New, In Progress etc.). So I created: task (.....,state_id,type_id,.....) defect(.....,state_id,type_id,...) state(state_id,state_name,...) importance(imp_id,imp_name,...) There are many such common attributes along with state like importance(normal, urgent etc), priority etc. And for all of them I want to use same table. I am keeping one flag in each of the tables to differentiate task and defect. What is the best solution in such a case? If somebody is using this application in health domain, they would like to assign different types, states, importances for their defect or tasks. Moreover when a user selects any project I want to display all the types,states etc under configuration parameters section.

    Read the article

  • Javascript How do I force a string + variable to be evaluated as a variable

    - by Craig Rinde
    Im not even sure how to word this and is probably why I am having trouble finding an answer in google. When the code is run currentCardRow will equal 1 therefore it should be cardSelected1 which is what is shown in the console.log. I need it to go a step further because cardSelected1 is a variable and I need it to evaluate show in the console log as Invitation. Invitation is an example of a variable for cardSelected1. I am not sure on what the correct syntax is to make this happen. var currentCardSelected = "cardSelected" + currentCardRow; Thanks for your help!

    Read the article

  • JS: variable inheritance in anonymous functions - scope

    - by tkSimon
    hey guys, someone from doctype sent me here. long story short: var o="before"; x = function() //this needs to be an anonymous function { alert(o); //the variable "o" is from the parent scope }; o="after"; //this chages "o" in the anonymous function x(); //this results in in alert("after"); //which is not the way i want/need it in reality my code is somewhat more complex. my script iterates through many html objects and adds an event listener each element. i do this by declaring an anonymous function for each element and call another function with an ID as argument. that ID is represented by the "o"-variable in this example. after some thinking i understand why it is the way it is, but is there a way to get js to evaluate o as i declare the anonymous function without dealing with the id attribute and fetching my ID from there? my full source code is here: http://pastebin.com/GMieerdw the anonymous function is on line 303

    Read the article

  • A jscript variable in a Query

    - by lerac
    Maybe a very simple question. How can I put in this code <Query> <Where> <Eq> <FieldRef Name="Judge_x0020_1" /> <Value Type="Text">mr. R. Sanches</Value> </Eq> </Where> </script> </Query> A variable from jscript in the area of the code where mr. R. Sanches is written. So my jScript contains a dynamic text variable I want to replace mr. R. Sanches with. See where it says THE JAVESCRIPT VAR underneath here: <Query> <Where> <Eq> <FieldRef Name="Judge_x0020_1" /> <Value Type="Text">THE JAVASCRIPT VAR</Value> </Eq> </Where> </script> </Query>

    Read the article

  • Jquery Json dynamic variable name generation

    - by PlanetUnknown
    I make a jquery .ajax call and I'm expecting a json result. The catch is, if there are say 5 authors, I'll get author_details_0, author_details_1, author_details_2, etc.... How can I dynamically construct the name of the variable to retrieve from json ? I don't know how many authors I'll get, there could be hundreds. $.ajax({ type: "POST", url: "/authordetails/show_my_details/", data: af_pTempString, dataType: "json", beforeSend: function() { }, success: function(jsonData) { console.log("Incoming from backend : " + jsonData.toSource()); if(jsonData.AuthorCount) { console.log("Number of Authors : " + jsonData.AuthorCount); for (i = 0; i < jsonData.AuthorCount; i++) { temp = 'author_details_' + i; <-------------------This is the name of the variable I'm expecting. console.log("Farm information : " + eval(jsonData.temp) ); <----- This doesn't work, how can I get jsonData.author_details_2 for example, 'coz I don't know how many authors are there, there could be hundreds. } } Please let me know if you have any idea how to solve this ! Much appreciated.

    Read the article

  • Static variable not initialized

    - by Simon Linder
    Hi all, I've got a strange problem with a static variable that is obviously not initialized as it should be. I have a huge project that runs with Windows and Linux. As the Linux developer doesn't have this problem I would suggest that this is some kind of wired Visual Studio stuff. Header file class MyClass { // some other stuff here ... private: static AnotherClass* const Default_; }; CPP file AnotherClass* const Default_(new AnotherClass("")); MyClass(AnotherClass* const var) { assert(Default_); ... } Problem is that Default_is always NULL. I also tried a breakpoint at the initialization of that variable but I cannot catch it. There is a similar problem in another class. CPP file std::string const MyClass::MyString_ ("someText"); MyClass::MyClass() { assert(MyString_ != ""); ... } In this case MyString_is always empty. So again not initialized. Does anyone have an idea about that? Is this a Visual Studio settings problem? Cheers Simon

    Read the article

  • Variable Assignment and loops (Java)

    - by Raven Dreamer
    Greetings Stack Overflowers, A while back, I was working on a program that hashed values into a hashtable (I don't remember the specifics, and the specifics themselves are irrelevant to the question at hand). Anyway, I had the following code as part of a "recordInput" method. tempElement = new hashElement(someInt); while(in.hasNext() == true) { int firstVal = in.nextInt(); if (firstVal == -911) { break; } tempElement.setKeyValue(firstVal, 0); for(int i = 1; i<numKeyValues;i++) { tempElement.setKeyValue(in.nextInt(), i); } elementArray[placeValue] = tempElement; placeValue++; } // close while loop } // close method This part of the code was giving me a very nasty bug -- no matter how I finagled it, no matter what input I gave the program, it would always produce an array full of only a single value -- the last one. The problem, as I later determined it, was that because I had not created the tempElement variable within the loop, and because values were not being assigned to elementArray[] until after the loop had ended -- every term was defined rather as "tempElement" -- when the loop terminated, every slot in the array was filled with the last value tempElement had taken. I was able to fix this bug by moving the declaration of tempElement within the while loop. My question to you, Stackoverflow, is whether there is another (read: better) way to avoid this bug while keeping the variable declaration of tempElement outside the while loop. (suggestions for better title and tags also appreciated)

    Read the article

  • Delphi access violation assigning local variable

    - by Justin
    This seems like the simplest thing in the world and I'm ready to pull my hair out over it. I have a unit that looks like this ; Unit myUnit; // ... //normal declarations //... Public //bunch of procedures including Procedure myProcedure; const //bunch of constants var //bunch of vars including myCounter:integer; Implementation Uses //(all my uses) // All of my procedures including Procedure myProcedure; try // load items from file to TListBox - this all works except on EReadError do begin // handle exception end; end; //try myCounter:=0; // <-- ACCESS VIOLATION HERE while myCounter //...etc It's a simple assignment of a variable and I have no idea why it is doing this. I've tried declaring the variable local to the unit, to the procedure, globally - no matter where I try to do it I can't assign a value of zero to an integer, declared anywhere, within this procedure without it throwing an access violation. I'm totally stumped. I'm calling the procedure from inside a button OnClick handler from within the same unit, but no matter where I call it from it throws the exception. The crazy thing is that I do the exact same thing in a dozen other places in units all over the program without problems. Why here? I'm at a total loss.

    Read the article

  • Variable reference problem when loading an object from a file in Java

    - by Snail
    I have a problem with the reference of a variable when loading a saved serialized object from a data file. All the variables referencing to the same object doesn't seem to update on the change. I've made a code snipped below that illustrates the problem. Tournament test1 = new Tournament(); Tournament test2 = test1; try { FileInputStream fis = new FileInputStream("test.out"); ObjectInputStream in = new ObjectInputStream(fis); test1 = (Tournament) in.readObject(); in.close(); } catch (IOException ex){ Logger.getLogger(Frame.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex){ Logger.getLogger(Frame.class.getName()).log(Level.SEVERE, null, ex); } System.out.println("test1: " + test1); System.out.println("test2: " + test2); After this code is ran test1 and test2 doesn't reference to the same object anymore. To my knowledge they should do that since in the declaration of test2 makes it a reference to test1. When test1 is updated test2 should reflect the change and return the new object when called in the code. Am I missing something essential here or have I been misstaught about how the variable references in Java works?

    Read the article

  • Variable not accessible within an if statment

    - by Chris
    I have a variable which holds a score for a game. My variable is accessible and correct outside of an if statement but not inside as shown below score is declared at the top of the main.cpp and calculated in the display function which also contains the code below cout << score << endl; //works if(!justFinished){ cout << score << endl; // doesn't work prints a large negative number endTime = time(NULL); ifstream highscoreFile; highscoreFile.open("highscores.txt"); if(highscoreFile.good()){ highscoreFile.close(); }else{ std::ofstream outfile ("highscores.txt"); cout << score << endl; outfile << score << std::endl; outfile.close(); } justFinished = true; } cout << score << endl;//works

    Read the article

  • iPhone SDK Programming - Working with a variable across 2 views

    - by SD
    I have what I hope is a fairly simple question about using the value from a variable across 2 views. I’m new to the iPhone SDK platform and the Model/View/Controller methodology. I’ve got background in VB.Net, some Php, but mostly SQL, so this is new ground for me. I’m building an app that has 3 views. For simplicity’s sake, I’ll call them View1, View2, View3. On View1 I have an NSString variable that I’ve declared in View1.h, and synthesized in View1.m. I’ll call it String1. View1.m uses a UITextField to ask the user for their name and then sets the value of String1 to that name (i.e. "Bill"). I would now like to use the value of String1 in View2. I'm not doing anything other than displaying the value ("Bill"), in a UILabel object in View2. Can someone tell me what the easiest way to accomplish that is? Many thanks in advance….

    Read the article

  • Variable not accessible within and if statment

    - by Chris
    I have a variable which holds a score for a game. My variable is accessible and correct outside of an if statement but not inside as shown below cout << score << endl; //works if(!justFinished){ cout << score << endl; // doesn't work prints a large negative number endTime = time(NULL); ifstream highscoreFile; highscoreFile.open("highscores.txt"); if(highscoreFile.good()){ highscoreFile.close(); }else{ std::ofstream outfile ("highscores.txt"); cout << score << endl; outfile << score << std::endl; outfile.close(); } justFinished = true; } cout << score << endl;//works

    Read the article

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