DataTable questions

I obtained data from database ( iBatis ), set up a com.portal.bean.action type
collection, saved it in request ( request.setAttribute( "actions", actions ) ; )
in action class and directed to somepage.faces.
I also setup faces.config.xml
<faces-config>
<managed-bean>
<managed-bean-name>actions</managed-bean-name>
<managed-bean-class>com.portal.bean.actions</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
and want to show the data with the help of JSF
<h:dataTable... />
<h:form>
<h3>Actions Data</h3>
<h:dataTable value="#{actions}" var="actions" >
<h:column>
<h:outputText value="#{actions.action}" />
</h:column>
<h:column>
<h:outputText value="#{actions.hedaction}" />
</h:column>
<h:column>
<h:outputText value="#{actions.dateaction}" />
</h:column>
</h:dataTable>
</h:form>
As a result I'm getting
     Actions Data 0.
Please, help me find the error.

perhaps you must change
<h:dataTable value="#{actions}" var="actions" >
for this
<h:dataTable value="#{actions}" var="item" >
and use "item" instead.

Similar Messages

  • DataTable question

    Hi,
    I have three datables and my requirement is I want to show all the dataTables on a single pane and pane should have a scrollbar.For example in the dataTable one I have three records and in the second dataTable I have 2 records and in the third dataTable I have 50 records.I could able to scorll the pane to see the records in the third datatable.
    Please can any one help me how to do this.
    Thanks and regards
    Ruther

    That's easy :) Then do:
    JSF<h:panelGroup styleClass="scrollTable">
        <h:dataTable ... >
        </h:dataTable>
    </h:panelGroup>CSS.scrollTable {
        display: block;
        overflow: auto;
        width: 300px;
        height: 300px;
    }Change the fixed width and height as you like it.
    If you're using JSF 1.2, then you can replace <h:panelGroup> by <div> and remove the display: block; from the CSS.

  • Tomahawk t:dataTable  question, please help

    I am using tomahawk dataTable and dataScroller tags to display results retrieved from database. For each row, I would like to have a button that will edit a value associated with that particular row. But the JSF gave all rows on the page same id, when I press one button, every row was fired off. Any suggestion is highly appreciated.
    Here is my code:
    <t:dataTable id="data" styleClass="TabForegroundColor" headerClass="standardTable_Header" footerClass="standardTable_Header"
    rowClasses="AltRows1, AltRows2"
    columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
    var="bl" value="#{ctReportdatahandler.ctReportModel}"
    rows="#{ctReportdatahandler.noOfRows}"
    rowIndexVar="index"
    forceId="true"     forceIdIndex="true"          
    sortColumn="#{ctReportdatahandler.sort}"
    sortAscending="#{ctReportdatahandler.ascending}" preserveSort="true">
    <t:column>
    <f:facet name="header">
    <h:outputText value="" />
    </f:facet>
         <h:commandButton value="h" actionListener="{ctReportdatahandler.historyCtBarcodes}" action="#{ctReportdatahandler.dummy}" onclick="barcodeHistory('#{bl.ctBarcode}')" styleClass="Button" />               </t:column>                         
    Incorrect source:
    <tr class="AltRows1"><td class="standardTable_Column"><input id="_id26:data:_id29" name="_id26:data:_id29" type="submit" value="h" onclick="barcodeHistory('CT00468873');clear__5Fid26();document.forms['_id26'].elements['autoScroll'].value=getScrolling();" class="Button" /></td</tr>
    <tr class="AltRows1"><td class="standardTable_Column"><input id="_id26:data:_id29" name="_id26:data:_id29" type="submit" value="h" onclick="barcodeHistory('CT00468877');clear__5Fid26();document.forms['_id26'].elements['autoScroll'].value=getScrolling();" class="Button" /></td></tr>
    Both buttons are id26:data:id29, I expect the first row id26:data0:id29 and 2nd row id26:data1:id29 so if I press button for row 0, row1 button won't get fired off.

    Thank y'all for responding. I am using SUN RI with Tomahawk. For whatever reason, I am not able to get myfaces to work with my menu:
    <t:jscookMenu layout="hbr" theme="ThemeOffice">
    <%/* Availaible jscookMenu themes: ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel
    Availaible jscookMenu layout: hbr, hbl, hur, hul, vbr, vbl, vur, vul
    respect to Heng Yuan http://www.cs.ucla.edu/~heng/JSCookMenu
    */%>
    <t:navigationMenuItem id="nav_1"
    I figured out a work around though:
    <t:commandButton value="h" forceId="true"     forceIdIndex="true" actionListener="#{ctReportdatahandler.historyCtBarcodes}" action="#{ctReportdatahandler.dummy}" onclick="barcodeHistory('#{bl.ctBarcode}')" styleClass="Button" />                         
    This gives me the unigue id that I am looking for.

  • Question about jdbc and jsf datatable

    hello
    I was wondering whether it was a correct way :
    -retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.
    or
    Is there any better way I can speed up retrieving data from databse ?
    regards

    orkun wrote:
    I was wondering whether it was a correct way :
    -retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.Your question/problem statement is unclear, but just lookup the DAO pattern.
    Is there any better way I can speed up retrieving data from databse ?Performance is a matter of good code and datamodel and decent hardware.

  • X:dataTable sort arrow rendered as question mark (?)

    Hey All:
    I am using tomahawk 1.1.3 and when I use sortable columns with x:dataTable, the sort arrows are being rendered as question marks (?). Any ideas?

    were would be the place to find the original system install CD.
    Ideally, your friend:
    My Friend gave me his Old Imac G5
    The Apple Store may have original system install discs but I would be surprised since no Apple Store in the US that I know of sells them any longer.
    It will not be free, but if they have one that would be the best option. Otherwise you will have to peruse the used market. In the US that could be Amazon Marketplace or eBay. I do not know where you would start in India, but many eBay sellers ship worldwide.
    Make absolutely certain you are getting a full retail installation CD and if it is Leopard or Tiger, make sure it is for your G5 and not an Intel iMac. System specific disks are grey in color and will not work except for the exact system with which they were included.

  • Another nooblike question on DataTable and displaying ResultSets from db...

    Hey guys,
    I am trying to follow this tutorial example:
    http://www.oracle.com/technology/oramag/oracle/06-jan/o16jsf.html
    I am doing the second part of the example because the first part is not matching with what I want to do. So if you go through the code and I am sure for you gents its absolutely no problem to analyze and decipher the code. Basically I have a 2 column small table that I want to show up on the screen. I am using this as a learning example. I understand most of the code posted except for the variable 'column1' or 'column2' are. For the life of me I cannot figure out what it is. If someone can fill in the missing gap I would appreciate it. Also another part of the code that is kind of not making sense is the dataTable1.setVar("catalog"); line. Where does the author get 'catalog' from?
    Hope someone can help me out.
    Thanks in advance.
    Surya

    In this line dataTable1.setVar("catalog"); you are making a reference to your value. Inside the datatable, you will refer to the value (a register in the model) as catalog. So you can access all properties of a single register.
    Column1 and column2 are columns in the table.
    It's better to you to see first a more simple example of a datatable.
    http://www.laliluna.de/first-java-server-faces-tutorial.html

  • JSF , DataTable, deletion question

    I have a collection of customer DTOs that are outputed using a datatabe. Each row has an Action column with a delete commandLink which points to my public deleteCustomer method. I have having problem with passing the customer id from the table to my method so that I can proceed with the deletion.
    Any help is greatly appreciated.
    Jammy

    Thank you guys. BalusC- great tutorial.
    However... I am trying to edit my DataTable using the following example at the bottom of page 174.
    [http://developers.sun.com/jscreator/learning/bookshelf/pearson/corejsf/datatables.pdf|http://developers.sun.com/jscreator/learning/bookshelf/pearson/corejsf/datatables.pdf]
    I am able to edit on my page once I check the checkBox, but once I uncheck it no data is saved. It simply resets.
    Here is my jsp code:
    <h:dataTable value="#{Controller.custList}" var="list" border="1">
                         <h:column>
                               <f:facet name="header">
                                <h:outputText value="Select"/>
                            </f:facet>
                            <h:selectBooleanCheckbox value="#{list.isEditable}" onclick="submit()"/>
                          </h:column>
                          <h:column>
                            <f:facet name="header">
                                <h:outputText value="Identification"/>
                            </f:facet>
                            <h:outputText value="#{list.id}"/>
                          </h:column>
                          <h:column>
                            <f:facet name="header">
                                 <h:outputText value="First Name" />
                            </f:facet>
                            <h:inputText value="#{list.firstName}" rendered="#{list.isEditable}" />
                            <h:outputText value="#{list.firstName}" rendered="#{not list.isEditable}"/>
                          </h:column>
                          <h:column>
                            <f:facet name="header">
                              <h:outputText value="Last Name" />
                            </f:facet>
                            <h:inputText value="#{list.lastName}" rendered="#{list.isEditable}" />
                            <h:outputText value="#{list.lastName}" rendered="#{not list.isEditable}"/>
                          </h:column>
                          <h:column>
                            <f:facet name="header">
                                <h:outputText value="Comments"/>
                             </f:facet>
                                  <h:inputText value="#{list.comments}" rendered="#{list.isEditable}" />
                                <h:outputText value="#{list.comments}" rendered="#{not list.isEditable}"/>
                          </h:column>
                        </h:dataTable> Thanks again.

  • (Tomahawk) DataTable sort question

    Hello,
    I'm showing the system properties on a webpage. The backing bean simply returns a list of entries (java.util.Map.Entry) which are shown by a t:datatable (backing bean has request scope).
    So now that they are there, I'd like to have them sorted one way or another. I don't know how to use the sortColumn attribute in this case, perhaps I'll need to sort them in the backing bean instead?
    Thanks,
    Dave

    Hi!
    you dont need to stor in the been.
    you can do it in the jsp page like this: (using DataTable from RichFaces)
    <rich:extendedDataTable  sortPriority="#{spot.startTimeForTable}"
                   value="#{scheduleResultBean.lspotsOnDate}" var="spot" id="spots"
                   rowClasses="#{spot.statusName}" >
                   <rich:column sortBy="#{spot.rating}" filterBy="#{spot.rating}"
                        filterEvent="onkeyup" label="Rating" >
                        <f:facet name="header">
                             <h:outputText value="Rating" />
                        </f:facet>
                        <h:outputText value="#{spot.rating}">
                        </h:outputText>
                   </rich:column>
    </rich:extendedDataTable>I'd like to hear if it helped you to!

  • How to sum values from multiple lines in a DataTable?

    I have a Lookout program which uses a DataTable to allow users to write basic programs (relay on/off times, which relays change state, and pause times).  The DataTable cursor position changes to advance from one program stage to another.  
    What I would like to do is sum up the times from all the various stages.  Can anyone suggest how I might iterate through the DataTable using Lookout alone?  
    Thanks,
    Dave 

    I have tried to make 'loops' similar to that one but Lookout shows a message that iterations or loops for a variable are not allowed.
    You can use a sequencer but there are 2 inconvenients:
    1.- For a fast computer every step of the sequencer cannot be faster than 0.1 - 0.2 seconds. If you have many iteraciones, it will take some time.
    2.- The sequencer object has a maximimum of 100 steps.
    Ryan S. Here are questions for you:
    1.- Is there a way to add in the lks file statements and or functions using existing variables? What can be done and what not?
    2.- Is there a way to insert comments in the lks file?
    Thanks in advance.
    Rudy Lopez

  • Values from columns of datatable...

    Hi guys,
    i'm working with my jsf application to create a datatable.
    It works well,but now i've added a commandlink button to dynamically adding a new column(i use this datatable for input data,each row is an experiment).
    It works fine,column is correctly added.
    At the end of each row of my datatable i've a submit button to send values of the row into db.
    My question is:
    My datatable has 5 fixed fields and other dinamic fields that user can add with button. My 5 fixed values have to go into a table(and it works) and i want that dynamic values(that use has added) go into another table,each one as a different row.
    Example
    usa italy french england japan rome tokyo
    i want usa italy french englan japan go into a table(as a row) and rome tokio goes into another table
    rome
    tokio(different rows).
    How can i do it?
    My problem is i'm not able to binding the dynamic input fields to bean....can you help me?
    Here is my class
    public class BiosamplesTable {
         private List biosamples= new ArrayList();
         private HtmlDataTable biosampleDataTable;
    private int autokey2;
         private Biosample biosampleItem;
         private int nrows;
         private DataModel mColumns;
         private int load=0;
         private String columnLabel;
         public HtmlDataTable getBiosampleDataTable()  {
              return biosampleDataTable;
         public void setBiosampleDataTable(HtmlDataTable biosampleDataTable) {
              this.biosampleDataTable = biosampleDataTable;
         public Biosample getBiosampleItem() {
              return biosampleItem;
         public void setBiosampleItem(Biosample biosampleItem) {
              this.biosampleItem = biosampleItem;
         public List getBiosamples() throws Exception {
              loadBiosamples();
              // Reload after every request.
              return biosamples;
         public void setBiosamples(List biosamples) {
              this.biosamples = biosamples;
         public void loadBiosamples() throws Exception {
              if (load==0){
              for (int i = 0; i < nrows; i++) {
                   Biosample biosample = new Biosample();
                   biosamples.add(biosample);
                   setBiosamples(biosamples);
                   load=1;
              else
                   setBiosamples(biosamples);
         public int getNrows() {
              return nrows;
         public void setNrows(int nrows) {
              this.nrows = nrows;
         public DataModel getColumnDataModel()
             if (mColumns == null)
               String[] result = new String[]{};//sono le colonne di partenza,in questo caso 1!!!
               mColumns = new ListDataModel(new ArrayList(Arrays.asList(result)));
             return mColumns;
         public void addColumn(ActionEvent e)
             if(columnLabel!=null);//metter l'if
               List columns = (List) getColumnDataModel().getWrappedData();
               columns.add(columnLabel);
         public String getColumnLabel(){
              return columnLabel;
         public void setColumnLabel(String columnLabel){
              this.columnLabel=columnLabel;
    }and this is my jsp page
    <t:dataTable
        value="#{biosamplesTable.biosamples}"
        var="biosampleItem"
         binding="#{biosamplesTable.biosampleDataTable}" border="3" bgcolor="pink" >
        <h:column >
            <f:facet name="header">
                <h:outputText value="Organism"/>
            </f:facet>
           <h:selectOneMenu value="#{biosampleItem.organism}">
                <f:selectItems value="#{biosample.selectOrganism}"/>
           </h:selectOneMenu>
        </h:column>
        <h:column>
            <f:facet name="header">
                <h:outputText value="Treatment Protocol" />
            </f:facet>
            <h:inputText value="#{biosampleItem.treatmentProtocol}" />
        </h:column>
        <h:column >
            <f:facet name="header">
                <h:outputText value="Extraction Method" />
            </f:facet>
            <h:inputText value="#{biosampleItem.extractionMethod}" />
        </h:column>
        <h:column >
            <f:facet name="header">
                <h:outputText value="Label"/>
                </f:facet>
            <h:inputText value="#{biosampleItem.label}" />
        </h:column>
        <h:column>
            <f:facet name="header">
                <h:outputText value="Hybridation" /></f:facet>
            <h:inputText value="#{biosampleItem.hybridation}" />
        </h:column>
        <h:column>
            <f:facet name="header">
                <h:outputText value="Amplification" /></f:facet>
            <h:inputText value="#{biosampleItem.amplification}" />
        </h:column>
        <t:columns value="#{biosamplesTable.columnDataModel}" var="column"  >
         <f:facet name="header">
        <h:panelGroup>
        <h:outputText value="#{column}" />
        <h:commandLink actionListener="#{biosamplesTable.removeColumn}">
        <h:outputText value="Elimina"/>
        </h:commandLink>
        </h:panelGroup>
        </f:facet>
             <h:inputText value="#{biosampleProperties.value}" />
        </t:columns>
        <h:column>
            <f:facet name="header">
                <h:outputText value="Actions" />
            </f:facet>
            <h:commandLink
            value="Invia dati biosample" actionListener="#{biosamplesTable.editBiosample}" id="editBiosample">
            </h:commandLink>
        </h:column>
        </t:dataTable>     i want the values of each added column goes as different row into a biosampleProperties table....
    Thanks..

    u can't achieve this with DataTable u need tu use JSTL ...exactly the
    C-Tag
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

  • Getting values from datatable row action

    Hi,
    I have a data table defined to load dynamic values. It works fine. Now I want to add a Row Action and then after clicking it it should be forwarded to the next page which displays other details of the row.
    Now the problem is I dont understand how can i fetch a particular column value in the doRowAction method. I know this is a very basic question but please help!!..

    Not sure where you're talking about with "doRowAction()" but this article might give useful background information and new insights: http://balusc.blogspot.com/2006/06/using-datatables.html

  • How to click on h:datatable and open a new page

    Hi,
    I'm new to JSF. I have a basic example with JSF h:datatable which displays data. When I click on the table row new page is opened and an argument s passed via the http header:
    Datatable:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core">
        <head>
            <title>test</title>
            <script type="text/javascript">
                function addOnclickToDatatableRows() {
                    //gets all the generated rows in the html table
                    var trs = document.getElementById('myForm:dataTable').getElementsByTagName('tbody')[0]
                    .getElementsByTagName('tr');
                    //on every row, add onclick function (this is what you're looking for)
                    for (var i = 0; trs.length > i; i++) {
                        trs.onclick = new Function("rowOnclick(this)");
    function rowOnclick(tr) {
    // var childNodes = tr.childNodes;
    // for(var i = 0; childNodes.length > i; i++) {
    var elements = tr.cells[0].childNodes;
    for(var i = 0; elements.length > i; i++) {
    if ((typeof elements[i].id !== "undefined") &amp;&amp;
    (elements[i].id.indexOf("lnkHidden") > -1)) {
    //opne in a new window// window.open(elements[i].href);
    location.href=elements[i].href
    break;
    return false;
    </script>
    </head>
    <body onload="addOnclickToDatatableRows();">
    <h:form id="myForm">
    <h1>Click on table row example</h1>
    <h:dataTable id="dataTable" var="data" value="#{datatableBean.lstData}" border="1">
    <h:column>
    <f:facet name="header">
    <h:outputText value="ID" />
    </f:facet>
    <h:outputText value="#{data.id}" />
    <h:outputLink id="lnkHidden" value="AnotherPage.xhtml"
    style="display:none">
    <f:param name="id" value="#{data.id}" />
    </h:outputLink>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Value1" />
    </f:facet>
    <h:outputText value="#{data.value}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Value2" />
    </f:facet>
    <h:outputText value="#{data.value}" />
    </h:column>
    </h:dataTable>
    </h:form>
    </body>
    </html>
    Managed bean:package edu.home;
    import edu.home.model.Data;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.ViewScoped;
    @ManagedBean
    @ViewScoped
    public class DatatableBean {
    private List<Data> lstData;
    * Creates a new instance of datatableBean
    public DatatableBean() {
    lstData = new ArrayList<Data>();
    lstData.add(new Data(1, "Hello World"));
    lstData.add(new Data(2, "Hello 123"));
    lstData.add(new Data(3, "Hello abv"));
    lstData.add(new Data(4, "Hello qaz"));
    * @return the lstData
    public List<Data> getLstData() {
    return lstData;
    * @param lstData the lstData to set
    public void setLstData(List<Data> lstData) {
    this.lstData = lstData;
    The Java object:package edu.home.model;
    public class Data {
    private int id;
    private String value;
    public Data(int id, String value) {
    this.id = id;
    this.value = value;
    * @return the id
    public int getId() {
    return id;
    * @param id the id to set
    public void setId(int id) {
    this.id = id;
    * @return the value
    public String getValue() {
    return value;
    * @param value the value to set
    public void setValue(String value) {
    this.value = value;
    The page which is opened after the row is clicked:<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html">
    <head>
    <title>TODO supply a title</title>
    </head>
    <body>
    <h1>This is another page</h1>
    <h:panelGrid columns="2">
    <h:outputText value="Selected ID" />
    <h:outputText value="#{anotherPageBean.id}" />
    </h:panelGrid>
    </body>
    </html>
    The managed bean of the opened page:package edu.home;
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.RequestScoped;
    import javax.faces.context.FacesContext;
    @ManagedBean
    @RequestScoped
    public class AnotherPageBean {
    private int id;
    * Creates a new instance of AnotherPageBean
    public AnotherPageBean() {
    try {
    this.id = Integer.parseInt((String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id"));
    catch (Exception e) {
    this.id = 0;
    * @return the id
    public int getId() {
    return id;
    * @param id the id to set
    public void setId(int id) {
    this.id = id;
    My question is how I can pass the argument into the background, without using the http header? Can you help me to implement this example?
    Best Wishes
    Peter
    Edited by: 932633 on May 7, 2012 3:18 PM
    Edited by: 932633 on May 7, 2012 3:18 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    EJP wrote:
    And why all the futzing around in Javascript? Why not just use &lt;a&gt; or <h:outputLink> in the normal way? What value are you trying to add here?
    I'm new to JSF.OP answered that already. I guess the OP really wants to turn a table row into something clickable, a link won't suffice then. Basic JSF tags don't support tagging event handlers to individual rows/columns as far as I know.
    @OP: you should really check out extension frameworks like Primefaces which have more advanced datatable implementations. Check out this for example:
    http://www.primefaces.org/showcase/ui/datatableRowSelectionInstant.jsf
    There is also Richfaces, Icefaces, Tomahawk. Probably using any of these extension frameworks you hardly ever have to write manual javascript.

  • How can i use Progressbar for loading data to DataGridView using DataTable

    I have a datatable which have 3 columns and set this datatable to be datasouce of datagridview.
    I want to add 100000 rows into this  table while
     table is adding , I want Progressbar to calculate and show the remaining
    percentage.
    How can i do this ?

    I've seen this done 2 different ways.
    You could either set the ProgressBar.Maximum to: 100, or  to QuantityToLoad. 
    example:
    Option Strict On
    Option Explicit On
    Option Infer Off
    Public Class Form1
    Dim QuantityToLoad As Integer = 100000
    Dim increment As Double = 100 / QuantityToLoad
    Private Sub btnExample1_Click(sender As Object, e As EventArgs) Handles btnExample1.Click
    ProgressBar1.Value = 0
    ProgressBar1.Maximum = 100
    ProgressBar2.Value = 0
    ProgressBar2.Maximum = QuantityToLoad
    For i As Integer = 1 To QuantityToLoad
    'Some code
    'Some code
    'Some code
    'Done loading item
    ProgressBar1.Value = CInt(i * increment)
    ProgressBar2.Increment(1)
    Label1.Text = ProgressBar1.Value.ToString & "% complete."
    Label2.Text = CStr(Math.Round((ProgressBar2.Value / ProgressBar2.Maximum) * 100, 2)) & "% complete."
    Application.DoEvents()
    Next
    MsgBox("done")
    End Sub
    End Class
    “If you want something you've never had, you need to do something you've never done.”
    Don't forget to mark
    helpful posts and answers
    ! Answer an interesting question? Write a
    new article
    about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.

  • How to add multiple datatable into a report

    Hello!
    I have a little issue. I'm creatring a report with one dataset containing multiple datatables
    lets call them datatable1 and datatable2.
    I have a separate program that's going to collect the data I need, and then export the report into a pdf file.
    During runtime my other program collects the data into it's own datatable1 and datatable2 (simular names). And then sent to the program binding the information together This is achieved using the following code. Example1
      private void SetDataTables(ReportDocument rpt, ref System.Collections.Specialized.NameValueCollection nmCheckAllTablesSet)
                Tables tbls = rpt.Database.Tables;  //The tables from the report is collected
                foreach (DataTable table in dataTable) //The tables retrieved from other program is looped throught
                    foreach (Table tbl in tbls) //For each table that exists in the report
                        if (table.TableName == tbl.Name) //If the table from the report is a match with the one from the program
                            tbl.SetDataSource(table); //If matched the table is combined using the SetDataSource
                            nmCheckAllTablesSet.Set(table.TableName, "true"); //Used later to check if all tables it bound.
    The code works fine if I remove one of the datatables, this have to be done in both the report and the calling program. When I use multiple datatable with setdatasource the pdf is created but no data is added. I have debugged the code to see if the data somehow gets lost on the way but no, the data gets transfered to the report but is somehow not bound.
    Example2:
    CrystalReport contaning Crtable1 and Crtable2.
    CallingProgram containging Cptable1 and Cptable2.
    1. CallingProgram fills the tables with data.
    2. Then sends the data to the report.
    3. The tables from the Report is collected and a SetDataSource is attempted.
    CrTable1.SetDataSource(CpTable1)
    CrTable2.SetDataSource(CpTable2)
    4.The report is exported to PDF.

    Hi,
    It seems that you are having issue with Crystal reports .Net SDK's.
    Post your question in Crystal Reports .NET SDK forum.
    That forum is monitored by qualified technicians and you will get a faster response there. Also, all .NET SDK queries remain in one place and thus can be easily searched in one place.
    Thank you for your understanding,
    Regards,
    Amit

  • One reason why commandLink doesn't work in dataTable

    Ok, so I think I've got an explanation why commandLink doesn't work in dataTable when the model bean is request scoped. Maybe somebody can tell me if I'm wrong.
    I have a model bean that generates table rows based on some input criteria (request parameters).
    So, we validate the inputs, apply them to the bean and render the page. Once the inputs have been applied to the bean, a request for table rows returns rows, no problem.
    However, we put a commandLink in each row, so we can expand the details. Maybe we even get smart and repeat the input row-generating criteria as a hidden field in the page.
    Unfortunately, when the user hits the commandLink, the list page simply refreshes, maybe even w/out table rows. The user doesn't get the details page as expected.
    Why not?
    Because: in the DECODE phase (even before validation and before "immediate" values have had their valueChangeListeners called), we ask the model bean for the table rows, so we can decode the commandLinks. Unfortunately, in "decode" phase, the request-scoped model bean has not had its row-generating criteria updated (that happens in the "update model" normally, or at the END of the decode phase if we got cute by (1) setting the "immediate" attribute on the row-generating criteria to "true" AND (2) set a valueChangeListener to allow us to update the model bean early. The END of the decode phase isn't good enough -- in the middle of that phase, when we're attempting to deocde commandLinks, the model bean has no citeria, so there's no row data. No row data means no iteration over commandLinks to decode them and queue ActionEvents. So, we march through the rest of the phases, process no events, and return to the screen of origin (the list screen) with no errors.
    So, what's the solution?
    One solution is to make the model bean session-scoped. Fine, maybe we can store a tiny bit of data in it (the search criteria), so it's not such a memory drag to have it live in the session forever. How do we get that data in? A managed property in faces-config.xml with value #{param.PARENT_KEY} won't work because it's assigning request-scoped data to a session-scoped holder. JBoss balks, and rightly so. Do we write code in the model bean that pulls the request parameter out of thin air? (FacesContext.getExternalContext()....) I don't really like to code the name of a specific http request parameter into the bean, I think it's the job of the JSP or faces-config.xml to achieve that binding (request parameter to model propery). Plus, I'd be sad to introduce a dependency on Faces in what was previously just a bean.
    Is there a better way?
    In my particular situation, we're grafting some Faces pages onto an already-existing non-Faces application. I don't get the luxury of presenting the user an input field and binding it to a bean. All I've got to work with is a request parameter.
    Hmm, I guess I just answered my own question. if all I've got to work with is a request parameter, some ugliness is inevitable, I guess.
    I guess the best fix is to cheat and have the bean constructor look for a request parameter. If it finds it, it initializes the criteria field (which, in my case, is the key of an object that has a bunch of associated objects (the rows data), but could be more-general d/b search criteria).
    (I looked at the "repeater" example code in the RI, but it basically statically-generates its data and then uses 100% Faces (of course) to manage the paging (where "page number" is essentially the "criteria").
    Comments? Did I miss something obvious?
    John.

    ...or I could just break down and do the thing I was hoping to avoid (outputLink instead of commandLink):
    <h:outputLink value="/faces/Detail.jsp">
      <f:param name="PARENT_KEY" value="#{bean.parentKey}"/>
      <h:outputText value="#{bean.label}"/>
    </h:outputLink>It's still a "hardcoded" parameter name, but at least the binding is in the JSP and faces-config.xml, not the bean Java code.

Maybe you are looking for

  • Time machine's pretty little interface doesn't show backups

    I've had time machine turned on since october 28th. I needed to restore a corrupt itunes library yesterday but when I launched time machine it only showed me "today" as a recovery option. I actually found the file I needed by clicking down through fo

  • Nokia map issue

    Map app doesn't open my Lumia 720 when I click on map tile its open but after 2 second it closed ,how I can open Nokia map on my Lumia 720

  • Need help removing text that is covering the document - Adobe Acrobat Standard X

    I am trying to remove "preview only" that is splashed across our document diagonally.  I can remove this on my computer which has Adobe Acrobat XI standard with content editing --> edit text and images  (a cursor pops up and i can just use the delete

  • 1 set password

    I need a page with a password that is the same password for everyone. The password is only to discourage individuals who don't need to know large group pricing. If the password passes the viewer will be directed to a url...Can I do that? If the passw

  • User exits to avoid posting of invoices

    Hi, in our company (mm/fi) incoming invoices are parked using a dummy account. Disallow the booking to the dummy account the account master data isn't a valid option. Therefore I need to find out which user exits are useful to prevent posting the inv