Problem in setting dataprovider for a dynamically generated datagrid

Hi everybody
I have a issue in flex, I am generating datagrids dynamically
by using repeaters but i am unable to set a seperate dataprovider
for each grid
Grid1 might come with some set of data and grid 2 with some
and so on so i want to set dataproviders at runtime for each grid
how can i do that
i have pasted my code for generating datagrid dynamically plz
go thru that and find me some solution
<mx:Repeater id="ProjectNames"
dataProvider="{GetTimeSheetDetails.lastResult.NewDataSet.Table1}"
>
<mx:Canvas label="{ProjectNames.currentItem.ProjectName}"
width="100%" height="251" id="CanvasTimeSheet"
creationComplete="disablecanvas();">
<mx:DataGrid x="10" y="10" width="864" height="206"
editable="true"
dataProvider="{GetTimeSheetDetails.lastResult.NewDataSet.Table}"
id="dgTimeSheet">
<mx:columns>
<mx:DataGridColumn headerText="Task" dataField="TaskName"
width="60" >
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Task Description"
dataField="TaskDescription" width="150" editable="true"/>
<mx:DataGridColumn headerText="M" dataField="Monday"
width="15" editable="true"/>
<mx:DataGridColumn headerText="T" dataField="Tuesday"
width="15" editable="true"/>
<mx:DataGridColumn
</mx:columns>
</mx:DataGrid>
<mx:Label x="564" y="222" text="0" width="35"
textAlign="right" id="lblMonday" />
<mx:Label x="602" y="222" text="0" width="33"
textAlign="right" id="lblTuesday"/>
</mx:Canvas>
</mx:Repeater>
</mx:TabNavigator>

try this and say me if it works fine!!!
<html>
<head>
<script>
function fileds() {
     var myParent = document.getElementById('myDiv');
     var text = document.createElement('input');
     text.setAttribute('id', 'myText');
     myParent.appendChild(text);
     document.all.myText.focus();
</script>
</head>
<body>
<input type="button" onClick="javascript:fileds()" value="Create And Give Focus">
<br>
<div id="myDiv"></div>
</body>
</html>
bye

Similar Messages

  • Problem in Setting Focus, on a dynamically generated field

    Hi all,
    I am having a jsp page, in which I have dynamically generated n number of input text fields, and with the function onchange="chk();", and i am passing the current text field value, and 2 more parameters min and max.
    In function chk(), i am validating the input value by condition it should be within min and max..
    my problem is i want to[b] get back the focus to the input text box, where the input is entered and not satisfied my condtion
    function chk(a,b,c)  / /a is my i/p, b and c are min and max values
    if( (parseInt(a)>=parseInt(b)) && (parseInt(a)<=parseInt(c)) )
    document.form1.submit;
    return true
    else
    alert("Invalid Output");
    var element=event.srcElement.name;
    alert(element); // I am able to get the name of input text box
    alert(event.srcElement.tagName);  // this gives INPUT
    if(event.srcElement.tagName=='INPUT')
    alert("yes"); // i can get this alert
    event.srcElement.focus();  // the focus can't be set back to that input field or element
    return false
    }

    try this and say me if it works fine!!!
    <html>
    <head>
    <script>
    function fileds() {
         var myParent = document.getElementById('myDiv');
         var text = document.createElement('input');
         text.setAttribute('id', 'myText');
         myParent.appendChild(text);
         document.all.myText.focus();
    </script>
    </head>
    <body>
    <input type="button" onClick="javascript:fileds()" value="Create And Give Focus">
    <br>
    <div id="myDiv"></div>
    </body>
    </html>
    bye

  • Problem in Set Check for Duplicate Invoices

    Hi,
    I have did all the required setting s for check duplicate invoice , but when i do miro , its not giving any error or warning msge.. i did all the config  as per blw link..
    FYI-  in migo, i have entered the 3434 as a invoice ref # in delveriy note column and while doing miro , i have entered 3434 in ref column and give the 3434 as a dlvery note # in item tab .. but its not giving any error?
    Pls guide, where the mistake has gone wrongly??
    Problem in Set Check for Duplicate Invoices
    Edited by: UJ on May 15, 2009 1:45 PM

    Hello,
    Hope you have done all the required configurations for the checking of double invoice and ticked the vendor for the double invoice checking in vendor master record.
    You have to understand the way the system does the double invoice check.
    As per the configuration, if the system identifies an invoice for a vendor whose double invoice check is activated, at the time of MIRO, system will update a separate table.
    So system will check for the double invoice entry among the invoices entered after making the tick in the vendor master.
    i meant to say that, if you are introducing this double invoice check in between the transactions, the check will be valid only for the invoices entered after the activation of double invoice check.
    Regards

  • Problem in setting header for a panelgrid in backing bean

    Hi , this is urgent... pls...
    Actually my problem is to set header for a panelgrid. I am generating panelgrid component in the backing bean itself , there i need to set header for that panelgrid.
    Here is some sample code which i have written pls let me know whether any problem in this code or let me know whether there is any method possible other than this.
    Code:
    Application application=FacesContext.getCurrentInstance().getApplication();
    keyFeaturesGrid = (HtmlPanelGrid) application.createComponent (HtmlPanelGrid.COMPONENT_TYPE);
    keyFeaturesGrid.setColumns(4);
    keyFeaturesGrid.setColumnClasses("subColumn");     
    FacetTag facetTag=new FacetTag();
    facetTag.setName("header");
    HtmlOutputText facetText=new HtmlOutputText();
    facetText.setValue("Key Features");
    facetTag.setValue("value",facetText);
    keyFeaturesGrid.getChildren().add(facetTag);
    i am calling this method in constructor.. if i place that facetTag code part in my method... i am getting an error while instantiating the constructor...
    waiting for solution...
    Thanks in advance...

    Hai...
    I got it...
    Here i am posting the solution which i got...
    no need to think this much ... it is very simple... let me share the solution here...
    Instead of creating FacetTag object u can do this like this...
    HrmlPanelGrid panelGrid=new HtmlPanelGrid();
    HtmlOutputText headerText=new HtmlOutputText();
    headerText.setValue("Header For The Grid");
    panelGrid.getFacets().put("header",headerText);
    u r always welcome to send any suggestions...
    and also one doubt... how to use JSF core tag verbatim in backing bean

  • Problem with setting tooltips for items of a JCombobox

    hi guys,
    I want to set tooltips for items of JComboBox & the code that i have written is given below , but the tooltip text is set for all the items of Nonitindustrycombo but the tooltips remain the same even for Nonitdesgcombo's items.
    Is that we need to refresh the ComboboxRenderer every time ?
    I am not able to trace out the exact reason for this,please if anyone can suggest me something regarding this would be of great use to me.
    class Searchpanel extends JPanel {
    String[] str = null;
    public SearchPanel(){
    Nonitindustrycombo.addItem("--Select--");
    ArrayList NonITindus = ERPModel.getAllNonitIndustry(); //gets all the items(strings) for Nonitindustrycombo
    for (Iterator iter = NonITindus.iterator(); iter.hasNext();) {
    String str = iter.next().toString();
    Nonitindustrycombo.addItem(str);
    SetTooltip(Nonitindustrycombo,NonITindus);
    Nonitdesgcombo.addItem("--Select---");
    ArrayList desg = ERPModel.getAllNonitDesg(); //gets all the items(strings) for Nonitdesgcombo
    for (Iterator iter = desg.iterator(); iter.hasNext();) {
    Nonitdesgcombo.addItem(iter.next());
    SetTooltip(Nonitdesgcombo,desg);
    class MyComboBoxRenderer extends BasicComboBoxRenderer
    public Component getListCellRendererComponent(JList list, Object value,
    int index, boolean isSelected,
    boolean cellHasFocus)
    if (isSelected)
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
    if (0 < (index))
    list.setToolTipText(str[index - 1]);
    else
    setBackground(list.getBackground());
    setForeground(list.getForeground());
    setFont(list.getFont());
    setText((value == null) ? "" : value.toString());
    return this;
    private void SetTooltip(JComboBox combo,ArrayList arr){
    str = (String []) arr.toArray (new String [arr.size ()]);
    combo.setRenderer(new MyComboBoxRenderer());
    public static void main(String[] args){
    new SearchPanel();
    Thanks ,
    vishal

    1) You where given a working example in your last posting on this topic. Compare your code with the working code to see whats different and fix it.
    2) The code you posted doesn't compile.
    3) You didn't use the "Code Formatting Tags" when you posted your code so it not readable.

  • Problems when setting SSL for a MQSeries Adapter

    I'm trying to enable SSL and so far these are the steps I've done:
    - I've been using the DemoIdentity.jks and DemoTrust.jks files located under <MIDDLEWARE_HOME>\wlserver_10.3\server\lib for all my certificate operations.
    - I created a PrivateKey and imported it to my DemoIdentity store, created a certificate request and when I got the response imported it back using the same alias. Something I want to highlight here is that when I created the PrivateKey I left the password field empty so it supposed inherit the keystore's.
    - I also imported the CA cert into the DemoTrust.jks
    My MQAdapter is all set and when I used it with no SSL it was working just fine so I think I have the problem isolated.
    Anyway, now when I try to connect this is what I'm getting in the logs:
    at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAConnectionMa
    nager$JCAConnectionPool.createJCAConnection(JCAConnectionManager.java:1335)
    ... 59 more
    Caused by: java.security.UnrecoverableKeyException: Cannot recover key at sun.security.provider.KeyProtector.recover(KeyProtector.java:311)
    at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:121
    at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java
    :38)
    at java.security.KeyStore.getKey(KeyStore.java:763)
    at com.sun.net.ssl.internal.ssl.SunX509KeyManagerImpl.<init>(SunX509KeyM
    anagerImpl.java:113)
    at com.sun.net.ssl.internal.ssl.KeyManagerFactoryImpl$SunX509.engineInit
    (KeyManagerFactoryImpl.java:48)
    at javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:239)
    at oracle.tip.adapter.mq.ManagedConnectionImpl.setupSSLSocketFactory(Man
    agedConnectionImpl.java:670)
    Googling this it seems like it's a problem with the keystore and private key passwords being different but I changed the private key's to match the keystore (something that I shouldn't be necessary because of the keytool's default behavior when generating the key) with no positive results.
    Anyway, any ideas would be really appreciated. I've been spinning my wheels on this issue for 3 days now.
    BTW, here's I'm using Oracle SOA11g.

    Hello MV,
    I don't need to access my console through SSL as this is not part of what I'm trying to do.This will confirm whether SSL has been enabled on your weblogic. In your case it seems that SSL has not been enabled.
    the demo keystore and truststore are regular stores and I was able to successfully import certificates into them using keytool.Demo keystores are not recommended to be used in production. Moreover DemoIdentity.jks already has a private (secret) key so importing another key may cause an issue. I don't think any application server supports multiple private keys for SSL.
    I'll go ahead anyway and create a brand new set of keystores just to rule out that's not the problem here.Please test with new custom keystores and let us know the results.
    Regards,
    Anuj

  • Setting passwords for pdf document generated by SAP system

    We are generating PDF documents from SAP system and distributing them as email attachment. just want to know if anyhow we can enforce the password protection while generating these documents or may be setting the password protection before distribution. If yes, then what are the requirements/essentials for the same?

    1. Is there any OSS Note on the same issue where it has been published by SAP that it can only be ensured using third party solutions? If yes, may I have the link?
    I have no clue on this i.e. whether we can integrate Adobe Policy Server. My understanding was in it's current state it is NOT possible to have secured PDF Forms.
    2. May I have the more elaboration on the way you mentioned in your reply?
    Well what you can do is hide all the elements in the form and keep only a TextField visible. Now write a script and check the value entered in the TextField. If it matches with the default password you want to set then make the form visible else display error prompt back to user.

  • Problem in setting condition for a period of time for SUMIFS

    Dear fellows,
    I have a list of transactions - column B is a value and column C is a date. I'm using SUMIF to calculate a total value per month. I set the date condition as
    column C;">="&B1;column B;"<="&EOMONTH(B1;0)
    it seems there is a mistake as the formula returns a value with 1 transaction missing (the last day of a month).
    in my example the formula should return 125 instead of 124.
    Please see the screenshot

    Hello
    I'd try:
    "<"&EOMONTH(B$1;0)+1
    instead of:
    "<="&EOMONTH(B$1;0)
    Also check B$1 is date-time value with day = 1.
    * Numbers date value is actually date-time value. If time part is not 00:00:00, comparison could yield unexpected result for edge values.
    Good luck,
    H

  • Problem when setting icon for Jframe.....

    Hi.....
    Iam trying to change the icon of jframe.Iam using the following code.
    Toolkit tk = frame.getToolkit();
    Image ic = tk.getImage("icons/abc.ico");
    frame.setIconImage(ic);
    But iam unable to see the icon.In the place of icon empty box is coming.
    Any help regarding this will be highly appreciated.
    Thanks and Regards,
    Kumar.

    dunno if you can use an ico format, try gif, tif et al
    thomas

  • How can I sort a dynamically generated table

    I am dynamically populating the columns in a table every time my page is loaded. (see code below)
    This is all working fine, and I am also able to use the built in pagination.
    However, I run into problems as soon as I click on a column header to try sort the table.
    I assume that because the columns are not defined in the JSP (because they are added dynamically), the sort criteria is referring to non-existant columns once the page reloads.
    I get an exception as follows
    Exception Details:  org.apache.jasper.JasperException
      #{currentRow.value['categories.category_id']}Can anyone suggest a solution so that I can sort the data for my dynamically generated table?
    Cheers,
    Ian
    //NOTE: I call populateTable(tableRowGroup1,dynamicRowSetDataProvider) in my prerender code.
    //tableRowGroup1 is defined as an empty (ie no children) row group in the JSP
    private void populateTable(TableRowGroup rowGroup, DataProvider dp) {
        rowGroup.setSourceVar("currentRow");
        try {
            FieldKey[] columnNames = dp.getFieldKeys();    
            for(int i=0; i < columnNames.length; i++) {
                String columnName = columnNames.getFieldId();
    info(i+": columnName");
    rowGroup.getChildren().add(
    createStaticTextColumn(columnName, "#{currentRow.value['"+columnName+"']}")
    } catch (Exception ex) {
    log("Error Description", ex);
    info("Error Description : " + ex);
    return;
    private TableColumn createStaticTextColumn(String heading, String dataField) {
    TableColumn tableColumn = new TableColumn();
    tableColumn.setHeaderText(heading);
    tableColumn.setSort(dataField);
    TextField staticText = new TextField();
    ValueBinding vb = getApplication().createValueBinding(dataField);
    staticText.setValueBinding("text", vb);
    tableColumn.getChildren().add(staticText);
    return tableColumn;

    I'm also having this problem, and I'm sure many more are too. It seems that no one has a solution, but perhaps that makes it even more value able for a sun dev to figure it out. It's surprising that it's so difficult to make dynamically generated tables with JSC.

  • JAXB is not generating the setter method for my tag

    Hi,
    I am generating java classes form my .xsd file using JAXB.
    The xsd definition has defnes a Form as a sequence of FormElement, where FormElement is a choice of graphical components like text etc. Form can have 0 or unbounded elements of typeFormElement
    Example
    <xs:element ref="sswfm:FormElement" minOccurs="0" maxOccurs="unbounded"/>
    It is creating the getter method for this tag like this-
    java.util.List getFormElement();
    but does not create setter method, namely, setFormElements which I would like to use when marshalling from swing to XML.
    If i remove the maxOccurs="unbounded, it is creating the setter method for this tag.But i want to keep this tag as it it and needs the setter method also.
    What should i do? Has one tried this before. HELP if you can
    Thank you in advance.

    Hi RavindraKshirsagar,
    We have a problem like you faced. Our requirement is that, we need to generate dynamically the PERSON element in our javabean.
    <xs:element name='SERVICE_REQUESTER'>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref='ORGANIZATION' />
                        <xs:element ref='PERSON' maxOccurs='unbounded' />
                   </xs:sequence>
              </xs:complexType>
         </xs:element>For this maxOccurs, as JAXB is not generating any Setter Method. As we need to get data dynamically from external application. If you could help us in handling this case dynamically, it will be well and good.
    Please send us the script / code asap.

  • Using javascript to dynamically generate the html for a  Spry table

    I have some javascript which generates html code for a Spry
    table which displays the content of a Spry data set. The problem is
    that after I generate the html, Spry never fills in the values for
    the table.
    Here's what I'm doing:
    Using a data set observer, check for onPostLoad and generate
    the html code
    Using innerHTML, stuff the code into the appropriate
    <div>
    Use regionName.updateContent() to update the region I just
    created with the html code I generated
    Interestingly, if I take the generated source for my page and
    remove the data set observer, the Spry table displays correctly
    with all the expected values. This suggests to me that my generated
    html code is correct, but that there is some sort of timing issue
    (i.e. Spry doesn't know about the new code I generated).
    Any suggestions?

    jalperin wrote:
    > Here's what I'm doing:
    >
    Using a data set observer, check for
    onPostLoad and generate the html
    > code
    >
    Using innerHTML, stuff the code into
    the appropriate <div>
    >
    Use regionName.updateContent() to
    update the region I just created
    > with the html code I generated
    >
    > Interestingly, if I take the generated source for my
    page and remove the data
    > set observer, the Spry table displays correctly with all
    the expected values.
    > This suggests to me that my generated html code is
    correct, but that there is
    > some sort of timing issue (i.e. Spry doesn't know about
    the new code I
    > generated).
    >
    > Any suggestions?
    I'd guess that it is a timing issue as well. I haven't looked
    much at the dataset capability in Spry, but it may be that the
    dataset "finds" all of the regions and code that it applies to
    before the onPostLoad event is triggered. If that is the case, then
    your generated code doesn't exist yet,and so the dataset thinks
    that there is nothing for it to apply to.
    Will the HTML that you generate change based upon the dataset
    that is actually returned? I guess I'm looking for the reason why
    the HTML is being generated when it could be in the page itself and
    avoid this issue completely.
    Danilo Celic
    |
    http://blog.extensioneering.com/
    | WebAssist Extensioneer
    | Adobe Community Expert

  • Problem in setting the parameters for an OASingleSelectionBean

    Hi,
    I have created an advanced table, for which I have to allow single selection or mutliple selection according to my requirements ie dynamically. So, for single selection, I have created a OASingleSelectionBean dynamically and add this to my advanced table bean.
    I also want to set Action for the single selection option. I have set the action using
    setPrimaryClientAction() which takes an argument of oracle.cabo.ui.action.FirePartialAction class. Now I also want to pass certain parameters when the single selection event happens.
    For that, I have taken an object of FirePartialAction class and but using the FirePartialAction class .setParameters(oracle.cabo.ui.collection.Parameter[]) function. I am setting the parameters using
    Parameter class object.setKey
    Parameter class object.setValue
    But my problem is that I want the value for the parameters at runtime, for which I intend to use SPEL. But I am not able to use SPEL using the setValue method.
    So it goes like this in short:
    OAAdvancedTableBean.setTableSelection(OASingleSelectionBean)
    OASingleSelectionBean.setPrimaryClientAction(FirePartialAction)
    FirePartialAction.setParameters(Parameter[])
    Parameters.setKey(String)
    Parameters.setValue(String) --- In case of value I want to give SPEL as an argument as I get the value at rutime
    Is that any other way in which I can set the value for the parameters using SPEL?

    Hi,
    I got ur point.
    Although i have never tried.........Can you try using method
    Parameters.setValueBinding(new OADataBoundValueViewObject(<single selectionbean>,<vo attr>))
    In this way without the use of SPEL, you will be able to achieve the functionality!
    Try this and get back to me!
    --Mukul
    Message was edited by:
    Mukul Gupta

  • Problem in dynamically generating the file upload field

    Hello all
    I am using netbeans 5.5 and visualwebpack for my jsf project.
    i have a problem in dynamically generating the file upload field and using it.
    I have a panel say "panelA" which holds file upload fields.
    Depending upon the count value i generate the file upload field using following code snippet:
    Upload upload1 = new Upload();
    upload1.setId("upload1");
    getPanelA.getChildren().add(upload1);
    The page successfully shows up the file upload fields. While the user clicks the submit button, i have used following logic to perform upload:
    List components = getPanelA().getChildren();
    for(int i = 0; i<components.size(); i++){
    if(components.get(i) instanceof Upload){
    UploadedFile uploadedFile = ((Upload)components.get(i)).getUploadedFile();
    I am getting this UploadedFile object null.
    How can i solve this problem.

    Anyway,
    I solved the problem.
    Actually i was using label property of the upload field due to which i got null pointer exception.
    I removed the label property of the upload field and things worked as i wanted.

  • Does Adobe provide a PHP library for dynamically generating a non-editable PDF on a website?

    As the title says, I am wondering if Adobe provides a PHP library for dynamically generating a non-editable PDF for my company website.  Any information on this would be greatly appreciated!

    By non-editable I assume you simply mean "with password security set" and understand the serious limitations of this.
    While Adobe doesn't offer PHP it offers several server options
    - LiveCycle PDF Generator. Java API and watched folder. Convert file types to PDF. Security can be set, but perhaps only globally.
    - Adobe PDF LIbrary. For experienced C/C++ programmers. Licensed by DataLogics.

Maybe you are looking for

  • Satellite C660 - No Display

    I have a Satellite C660 laptop that is only a couple of months old and not used too much. I turned it on the other day, but the screen is completely blank. The laptop is making 'bleeping' sounds. One, quite high longish bleep, followed by the same pi

  • Imac won't drag and drop

    I have a new iMac w/Mountain Lion and it won't drag and drop. I can't move folders or move files into folders. Any ideas?

  • Still images appear shaky.

    Hi, I'm trying to burn a video I made in Final Cut to DVD, and when I watch the quicktime version of the video, everything is fine, but whenever I put it to dvd, these two stills come out shaky. What I did in Final Cut was freeze frame a shot when I

  • System Copy of our Production Server using orabrcopy method.

    Hi We are planning to do a System Copy of our Production Server using orabrcopy method. But as the Production Server Java Version is below 1.4.1, Orabrcopy could not be executed. As per the planned downtime of the Production Server, we have copied al

  • CS 4 Master, Any way to capture Desktop to Streaming Video

    I just purchased and downloaded Master Collection, is there any way to capture real time streaming Desktop to video format from within the collection? Or do I have to purchase Captivate 3. Any chance that there might be a plug-in for Premiere or any