Adding rows to a datatable, depending on the array size

I have a situation like this:
In my managed bean, i have an array of size 5.
In the faces jsp page, I have a datatable, which refers to this array. I need to display five rows in the datatable. How do I do this?
<h:column>
<f:facet name="header">
<h:outputText styleClass="outputText" value="#{lbl.tripDateStart}" id="tripDateStartLbl"></h:outputText>                    
</f:facet>
<h:inputText styleClass="inputText" id="tripDateStart" size="11"
value="#{parmHandler.model.tripDateStartArray}"
required="true">                                   
</h:inputText>
<h:message styleClass="message" id="tripDateStartMsg" for="tripDateStart"></h:message>
</h:column>This displays only one row.
Is there a need for iteration? If so, how do I do it?

On you <h:dataTable> the 'value' attribute should point to the array on your backing bean, use the 'var' attribute on the <h:column>
<h:dataTable value="#{parmHandler.model.tripDateStartArray}" var="dataStart">
<h:column>
<f:facet name="header">
<h:outputText styleClass="outputText" value="#{lbl.tripDateStart}" id="tripDateStartLbl"></h:outputText>
</f:facet>
<h:inputText styleClass="inputText" id="tripDateStart" size="11"
value="#{dateStart}"
required="true">
</h:inputText>
<h:message styleClass="message" id="tripDateStartMsg" for="tripDateStart"></h:message>
</h:column>
</h:dataTable>

Similar Messages

  • Feather radius for selection depending on the image size

    Greetings everyone,
    I have a question about setting the feather radius for a selection depending on the image size. I'd like make the edge in the resultant layer mask have roughly the 'same' feather appearance for varying image sizes.
    For files below 2000 pixels I would set  a feather radius of 0.2
    For files above 2000 pixels I would set  a feather radius of 0.3
    However, I started working with 4000-10000 pixel images and I was wondering about the radius for those images.
    Is there a more 'scientific' method I could follow? Any thoughts welcome
    Many thanks
    gr

    You would need to use Photoshop scripting to do that. Also using number of Pixels might not be what you want to use.  While number pixel is an absolute number pixels you have have no size information till there is a DPI resolution involved. At 300 DPI 300 pixels are 1" in size at 72 DPI 300 pixels are 4.16 inches in size.
    A conditional action is not possible adobe conditional action support but is possible with the downloadable script  Siva's Contitional Action

  • What can I do if I want to unlimited the array size

    Hi all
    I am new in Java, I would like to create a array in MyObject type. (MyObject is the object i created) But I don't want to limited the array size, Any other ways can do this?
    Myobject[] myob;
    myob = new Myobject[10];
    Thanks
    Regards,
    Kn

    Use ArrayList or Vector
    example
    Vector myarray = new Vector();
    myarray.add(myObject);
    to get the object back
    myObject = (MyObject) mayarray.get(index);

  • Can I make an InDesign CS4 .swf export scale depending on the open size of a browser?

    Hi there.  I would like to make my inDesign CS4 .swf file able to scale in accordance with the open size of a browser.  When I have used Flash previously changing the size of the document to 100% achieved this effect.  However, I'm not having much luck with this approach with my inDesign CS4 .swf export.  I'm loathe to export it as an XML file for Flash as I want to keep my fancy page turns. Any help would be very much appreciated.  I'm not very fluent in Flash-speak so I'd also appreciate it if anyone offering a solution could t-a-l-k r-e-a-l s-l-o-w.
    Regards,
    Jackie

    This is quite old thread, I don´t have those source codes anymore... besides many people still uses monitors with width of 1024, 1219px wide magazine would clip in those monitors, so I don´t suggest to use it without shrinking....
    Anyway, if you want to improve positioning of your SWF, you have at least two way to do it
    1) Go to free http://www.bobbyvandersluis.com/swfobject/generator/index.html and create a new html-wrapper for your project
    2) If that´s not enough or you want some extra features like zoom, print or search, go to http://www.edocker.com and download a free trial of eDocker.
    ps. eDocker is in Adobe MAX Awards final, if you want to help it to win.... go to
    http://2010.max.adobe.com/awards/finalists/
    and vote for eDocker....

  • Randomizing the Array Size

    Hello,
    How do make a random number that is between 20 to 50, and then make the random number to be the size of that array.
    Also My assignment is to make a Binary Search Lab.
    What does the Word "probe" mean?
    Example:
    What entry? 14
    status: found at index 6 after 4 probes.
    Now what exactly does probe means, i dont understand.

    How do make a random number that is between 20 to 50,You can use java.util.Random:
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Random.html
    and then make the random number to be the size of
    that array.
    Do you know how to create an array? If you do, then just create the array when you have generated the random number. If you don't, then read this:
    http://java.sun.com/docs/books/tutorial/java/data/arraybasics.html
    Also My assignment is to make a Binary Search Lab.
    What does the Word "probe" mean?
    Example:
    What entry? 14
    status: found at index 6 after 4 probes.Maybe it means "searches"? But really, if you're not sure what the assignment means you should ask your teacher for clarification.

  • Compare the array size?

    Hello!
    Now we have the following problem: We have an array of a cluster and in this cluster we have an array. We need to compare the length between the array named "sampelnr"...
    If they are not equal length we need to get the "signalname" from the array which is the smallest. The "Array" could be of different length from time to time... does anyone have any tip for us?
    See the attached VI. Best regards and thank you!
    Attachments:
    arrayquestion.vi ‏18 KB

    There will be more to your problem, because you don't tell what the output should be if:
    all elements are the same lenght
    more than one array has a smallest size (e.g. if we have the following lenghts [4,4,5,6,7], the first two have smallest size. Do you want both names?).
    Attached is a small example that shows two possible interpretations, pick the more suitable for your case:
    In the upper (blue) part, it assumes that there is only one "smallest" array.
    In the lower (red) part, it shows how to get all names where the array is equal to the smallest size.Message Edited by altenbach on 04-18-2005 08:55 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    arrayquestionMODIFIED.vi ‏48 KB

  • Since I updated to 6, my mouse wheel scrolling has become erratic, and, depending of the text size on the web page, either moves only a few lines each turn or moves several pages instead of one page as it did before on every tab. how do I fix this?

    Is this a glitch or is it something to do with compatibilty?

    yes, it is still happening, though I've gotten better at ignoring it.
    my touchpad, i think, is an elan ps/2 port smartpad and my mouse is a microsoft basic optical mouse v2, both componants are working correctly and have the latest driver update installed.
    The difference between img 1 and 2 is one scroll wheel turn down. In image 3 I have decreased the view using control - (minus) and in image 4 I have scrolled down one turn of the wheel. you can see that instead of a full page turn, like between img1 and 2, it only moves about 2/3's of the screen down. As every tab seems to have a different text size, the amount of scroll turn changes between tabs, sometimes varying as much as several pages each scroll turn.
    One thing I have noticed, is that the vertical scrolling speed on my mouse settings changes the amount the pages moves when turning the wheel. This only seems to change when in firefox. changing this while using word has no effect on the page movement in word. Increasing the vertical scrolling speed will make the scroll turn move further.
    I have adjusted the scroll settings in options, and no adjustment of settings, (autoscrolling on/off, smooth scrolling on/off in and combinations of off/on) has made this error stop occurring. I have checked for malware etc, no issues. This happened from the instant I upgraded to FF6, so I think there is a corrolation there.

  • How to set the array size

    Hi,
    below is my sample code
    class test
    int sample[][]=new int[10][10];
    int rows=0,k=0;
    int columns=0;
    public void meth()
    rows=9;
    columns=9;
    }//end of meth()
    public meth_2()
    for (int i=0;i<rows;i++)
    for(int j=0;j<columns;j++)
    sample[i][j]=k;
    k++;
    for (int i=0;i<rows;i++)
    for(int j=0;j<columns;j++)
    System.out.println(sample[i][j]);
    }//end of meth_2()
    public int[][] getList()
    return sample;
    }//end of classNow that my question is, i need to set the size of array sample[][] to sample[rows+1][columns+1].. but to do so, 'rows' and 'columns' values will only be generated upon the execution of method meth() . I need sample[][] array to be declared right after the class begins. The values that are returned from sample[][] array through that getList() method is been used in another class.. So how do i set the size of sample[][] array to
    int sample[][] = new int[rows+1][columns+1];Any response is highly appreciable.
    Thanks in advance
    Edited by: netbeans2eclipse on Sep 14, 2008 1:20 PM

    It seems you answered your question yourself ;-)
    Just split this:
    int sample[][] = new int[rows+1][columns+1];in two parts.
    Declaration:
    int sample[][];and instantiation in meth() or meth_2():
    sample = new int[rows+1][columns+1];

  • Getting the selected row from a datatable -- URGENT

    Hi,
    I am facing the following problem with a datatable. The datatable does not have any Input components like CommandLink, Buttons, Radio Buttons and Checkbox. Even I cannot use the hidden Command Link.
    One solution is to use a input hidden variable which can hold the curent row Id. But in this case too, how to get the control in a backing bean method is not clear to me.
    Please guide me how to get the data of the selected row in the backing bean.
    Thanks in advance......
    VJain.

    I again explain my problem:
    I need to get the Current Selected Row onclick of any row in a Datatable. But the datatable is restricted not to have any CommandLink or Input component so that I can generate the action to go to any method on a backing bean as shown below.
    <h:dataTable id="dTable" value="#{Bean.myList}" var="currentRow" >
    <h:column id="row1">
    <h:outputText value="# currentRow.productNumber}"></h:outputText>
    </h:column>
    <h:column id="row2">
    <h:outputText value="# currentRow.productName}"></h:outputText>
    </h:column>
    </h:dataTable>
    As shown above I cannot use any commandButton or CommandLink to submit the page. All I can do is to generate any onclick function on Table and do something with it. But not sure how to do it.
    Now I want the productNumber of the selected row in any method say getCurrentRowId of the Bean.
    I hope the problem must be clear now....
    Thanks for your quick reply..
    VJ

  • Colouring Rows of a Table depending on a particular condition.

    Hi,
        The problem I am facing is coloring specific rows of a table depending on the satisfaction of a particular condtion. For example: All rows having the value in the amount column greater than 1000 have to be coloured in red and the remaining yellow.
         Can anyone please help me out with this row-coloring problem?
    Regards,
    Gaurav.

    Hi Martin,
    Have used an image column to display image.
    You can define the condition in the URL field, to display the image. Something like:
    =IF(@img=="50",store@IMAGE_URL&"Green_dot.png",IF(@img=="40",store@IMAGE_URL&"Yellow_dot.png",IF(@img=="39",store@IMAGE_URL&"Red_dot.png","")))
    Where store@IMAGE_URL has the URL to the location where the images are stored.
    Let me if it helps.
    Regards,
    Dharmi

  • Is it possible to give an added row a Color.

    Hello I read data of a txtfile and than place the data in a jtable.
    I know how to give a selected row an other color but my question is:
    Is it possible to give an added row a Color.
    I make the new row this way
    moddellist.addRow(new Object[]{data,""});
    Now I want this added row red is this possible.
    I don't know what the rowIndex or Cell number is.

    The colour of a cell in a JTable is assigned by a TableCellRenderer. If you look at how that works, all it knows is the object in the cell, the table, the row and column number, and whether the cell is selected or focussed. It doesn't care when things happened.
    So if you want your TableCellRenderer to colour your cells based on something that isn't in that list, then you have to modify the design of your object, the one in the cell, so that it contains information the cell renderer can use to decide what colour to render it.
    Based on your description I can't say much more than that, because it's hardly a complete description of how the colour scheme is supposed to work.
    And by the way the people in the Swing forum are better at answering Swing questions.

  • Why can't the Web console in FF9.01 not see extensions I've added to the Array class (object)?

    I've added a number of new methods to the Array object in Javascript. My scripts see them fine, but the Web console reports them as 'undefined'. Apparently the console cannot see my changes. Why is that?

    Not the same. It should be like the orange indicator for an imported clip in the camera import window. It's really quite sophisticated in iMovie. When you switch projects the orange line changes to reflect what's in the open project so a clip might have the orange indicator when one project is open in the timeline, and not when another project is open. It's a really useful tool, because it even shows what parts of a clip have been used in the open project.

  • How to set the fetch size for a ResultSet object?

    Connection con  = getConnection();
    Statement stmt = con.createConnection();
    ResultSet res = stmt.executeQuery("select * from table");
    //res.setFetchSize(?);
    while (res.next)
    res.get....
    }I do not know the number of rows .
    How can I set the fetch size for the ResultSet object?
    I try
    res.last();
    res.setFetchSize(res.getRow()/2);
    res.beforeFirst();
    while (res.next)
    res.get....
    }but it's so slow if there are 6000 rows.
    How can I set the fetch size for the ResultSet object more effectible?
    And what is the best number to set the fetch size?

    The fetch size defaults to a standard number. It is unlikely that it will be any faster if you set it unless you only plan to read a small number of rows.
    i.e. if you are going to read all the rows, you need to read all the rows no matter what.
    Unless the system has set the fetch size to 1 changing it will not be faster.
    Depending on the row length, reading in 6000 rows is going to take a long time. You could try using a cpu profiler to improve performance.
    Do you really need to read everything in every row?

  • Extract the Page Size from the Document Properties

    I have multiple drawings of various sizes and need to extract the page size from the document properties of each drawing.
    this.info object can be used to extract the title, author, subject etc of a document but there is no property shown for extracting the page size.
    Can any one please advise a way of extracting the page size from the document properties of a file?
    Any assistance will be most appreciated.
    Once the page size can be extracted I will be using a script to place a stamp with onto the drawing depending on the page size.
    Thank you.

    Thank you for your help George.
    I have used the getPageBox script as follows:
    var aRect = this.getPageBox("Crop");
    var width = aRect[2] - aRect[0];
    var height = aRect[1] - aRect[3];
    console.println("Page 1 has a width of " + width + " and a height of " + height);
    The console reports back - Page 1 has a width of 1162 and a height of 814.
    The actual drawing shows in the document properties page size as 40.988 x 28.713 cm.
    Can you please advise why the getPageBox measurement is not reporting correctly?

  • Navigating the array on menu

    import java.util.*;
    public class Main {
         * @param args the command line arguments
        private static void bubbleSort(int[] x) {
        int n = x.length;
        boolean doMore = true;
        while (doMore) {
            n--;
            doMore = false;
            for (int i=0; i<n; i++) {
                if (x[i] > x[i+1]) {
                    int temp = x; x[i] = x[i+1]; x[i+1] = temp;
    doMore = true;
    public static void main(String[] args) {
    while(true){
    System.out.println("What do you want to perform choose :\n 1. Searching\n 2. Sorting\n 3. Exit\n ");
    Scanner input = new Scanner(System.in);
    switch(input.nextInt()){
    case 1 : System.out.println("1. Linear Searching\n2. Binary Searching\n");
    switch(input.nextInt()){
    case 1 :System.out.println("Linear Search: ");
    continue;
    case 2 :System.out.println("Binary Search: ");
    break;
    continue;
    case 2 : System.out.println("Please provide the size of the array between 5 to 30; ");
    int arrays = input.nextInt();
    System.out.println("If you want to supply the number between 1 to 100 press 1,or\n2 to generate it ramdomly: ");
    switch (input.nextInt()){
    case 1: int num = 0;
    int[] arrSize = new int[30];
    for(int i = 0; i <=arrSize.length; i++){
    arrSize[i] = num;
    System.out.println("Please enter number on index"+i+":");
    num=input.nextInt();
    break;
    case 2: int[] arr = new int[30];
    Random random = new Random();
    for (int idx = 1; idx <= 30; ++idx){
    int randomInt = random.nextInt(100);
    arr[idx - 1] = randomInt;
    System.out.println(Arrays.toString(arr));
    System.out.println("\n");
    System.out.println("What Sorting algorithm you want to ferform?\n1. Bubble Sorting \n2. Selection Sorting\n3. Insertion\n");
    switch (input.nextInt()){                                              
    case 1 ://code to call bubble sort method
    break;
    continue;
    //continue; //starts the loop again
    case 3 : System.exit(0);
    break; //exists the loop
    default: System.out.println(input.nextInt()+ " is not a valid charachter , please try again");
    }//end of while loop
    }Sorry im new to this,i have a code there im now developing sorting algo. in my code the user provide a size of the array between 5 to 30 then the user will choose if he/she wants to supply the numbers between 1to100 or these are generated randomly. My problem is that if the user difine the array size, then after the array size given it will ends the loop up to 30. all i want is if the user difine array size 5 only 5 index will prompt. please help im also trying here any advise?
    Edited by: limuh on Aug 25, 2008 4:20 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    thanks for the reply. my code now works on the problem:) but the bubblesort method not performing its task. how can i call the bublesort method to sort my values in the array?
    case 2 : System.out.println("Please provide the size of the array between 5 to 30; ");
                                            int num = 0;
                                            int arrays = input.nextInt();
                                            for(int i = 0; i <=arrays; i++){
                                     System.out.println("If you want to supply the number between 1 to 100 press 1,or\n2 to generate it ramdomly: ");
                                        switch (input.nextInt()){
                                            case 1: int[] arrSize = new int[arrays];
                                                    for(int i = 0; i <=arrSize.length; i++){
                                                        arrSize[i] = num;
                                                        System.out.println("Please enter number on index"+i+":");
                                                        num=input.nextInt();
                                            break;
                                            case 2: int[] arr = new int[arrays];
                                                    Random random = new Random();
                                                    for (int idx = 1; idx <= arr.length; ++idx){
                                                    int randomInt = random.nextInt(100);
                                                    arr[idx - 1] = randomInt;
                                                    System.out.println(Arrays.toString(arr));
                                                    System.out.println("\n");
                                            System.out.println("What Sorting algorithm you want to ferform?\n1. Bubble Sorting \n2. Selection Sorting\n3. Insertion\n");
                                                switch (input.nextInt()){
                                                    case 1 : new Main().bubbleSort(x);     
                                                    break;
                                            }

Maybe you are looking for