QWP not showing newly added entries

LabKey Support Forum (Inactive)
QWP not showing newly added entries gstarrett  2012-08-29 14:35
Status: Closed
 
I have a query web part set up within a wiki that I'm using to do a pretty simple search of our allele database. The qwp is rendered when the user fills out a form and clicks a submit button. I have a similar form on the same page that is set up to insert the values from the form into a new entry within the table holding the allele information. When I make a new entry I can see it if I directly navigate to the table to view the data, but not when I render the qwp. The other thing is if I use LabKey's built in insert function and click cancel the new entries will load if I submit the form completely blank. That is until I navigate away and return to the page. Please find my javascript below:

Inserting the data into the new table

function subInsert(data) {
        var uidValue = data.rows[0].maxId + 1;
        console.log(myValues2);
        //console.log(maxId);
        //var uidValue = maxId.rows[0].maxId + 1;
        console.log(uidValue);
        var userId = LABKEY.Security.currentUser.displayName;
        var d = new Date();
        var date = d.getDate();
        var year = d.getFullYear();
        var month = d.getMonth() + 1;
             LABKEY.Query.insertRows({
                 schemaName: 'oconnor',
                 queryName: 'dna_sequences_draft_2013',
             rows: [
                {'allele_name': myValues2['alleleName'],
                'region': myValues2['region'],
                'file_active': 1,
                'locus': myValues2['locus'],
                'allele_family': myValues2['alleleFamily'],
                'species': myValues2['species'],
                'origin': myValues2['origin'],
                'genbank_id': myValues2['genbankId'],
                'ipd_accession': myValues2['ipdAccession'],
                'previous_name': myValues2['previousName'],
                'last_edit': year + "-" + month + "-" + date,
                'initials': userId,
                'sequence': myValues2['sequence'],
                'modified_by': userId,
                'type': myValues2['type'],
                'uid': uidValue,
                'id': uidValue,
                'comments': myValues2['comments'],
                'variant': 1,
                'reference': 1,
                'full_length': myValues2['fullLength']
                }],
             successCallback: function() {Ext.MessageBox.alert('Insert Allele', 'Successfully inserted ' + myValues2['alleleName']);},
         });
}

creating the qwp

var qwp1 = new LABKEY.QueryWebPart({
    renderTo: 'queryTestDiv1',
    title: 'Search Results',
    schemaName: 'oconnor',
    queryName: 'dna_sequences_draft_2013',
    containerFilter: 'currentAndSubfolders',
    filters: [LABKEY.Filter.create('species', myValues['species'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('file_active', '1', LABKEY.Filter.Types.EQUAL), LABKEY.Filter.create('allele_name', myValues['alleleName'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('region', myValues['region'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('locus', myValues['locus'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('origin', myValues['origin'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('type', myValues['type'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('allele_family', myValues['alleleFamily'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('comments', myValues['comments'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('modified_by', myValues['modifiedBy'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('previous_name', myValues['previousName'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('genbank_id', myValues['genbankId'], LABKEY.Filter.Types.CONTAINS), LABKEY.Filter.create('ipd_accession', myValues['ipdAccession'], LABKEY.Filter.Types.CONTAINS)],
    showUpdateColumn: true,
    maxRows: myValues['rb-auto'],
    buttonBar: {
        includeStandardButtons: false,
        items:[
          //LABKEY.QueryWebPart.standardButtons.insertNew,
          LABKEY.QueryWebPart.standardButtons.deleteRows,
          LABKEY.QueryWebPart.standardButtons.exportRows
        ]
    }
});
 
 
jeckels responded:  2012-08-31 11:15
Hi Gabe,

It's difficult to know without seeing the actual data, but I'd guess that the problem is that the rows you're inserting doesn't meet one of your filter criteria. I'd try removing a bunch of the filters so that you get the row(s) to show up in the QueryWebPart, and then readd them until the rows start disappearing. There may be some sort of issue with null values vs empty strings or something along those lines.

I don't quite follow what you're describing for the second problem, but it sounds like it may also be related to the filtering.

Feel free to send me a URL via email if this doesn't help and I can try taking a direct look.

Thanks,
Josh