Skip to main content

When the text specified for a Queue search text contains merge syntax, the search text is not updating as the model data changes.


This is similar to https://community.skuid.com/t/queue-labels-do-not-update-when-model-data-changes?rfm=1&am…. That issue was dealing with item display but this is the same issue just specific to search text.


Notes


  1. The Queue header text does properly update when merge syntax is used.

  2. This stems from the issue posted at https://community.skuid.com/t/queue-component-title-search-labels-template-string-not-cha…

  3. Due to the issue at https://community.skuid.com/t/mustache-triple-braces-results-in-components-not-updating-w…, it is necessary to use double-brace syntax for merge even though it would be more appropriate to use triple-brace here because when displaying a value in a header, you would not want an nx-field rendered, just the number.

Steps to reproduce:


  1. Create page using XML below

  2. Preview page

Expected Behavior

Queue header text & Search text should indicate the number of rows in opportunity


Actual Behavior

Queue header text correctly indicates record count

Search text indicates zero (0) which was the value of OpportunityTracker when the queue was initially rendered


  1. Click a row in the queue to remove it from the model

Expected Behavior

Queue header text & Search text should indicate the number of rows in opportunity


Actual Behavior

Queue header text correctly indicates record count

Search text indicates zero (0) which was the value of OpportunityTracker when the queue was initially rendered


Sample XML:


<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">    <models>
<model id="OpportunityTracker" query="true" createrowifnonefound="true" datasource="Ui-Only" processonclient="true" unloadwarningifunsavedchanges="false">
<fields>
<field id="OpportunityCount" displaytype="DOUBLE" label="Opportunity Count" ogdisplaytype="TEXT" readonly="false" returntype="DOUBLE" precision="9" scale="0" defaultvaluetype="fieldvalue" defaultValue="0">
<formula>{{$Model.Opportunity.data.length}}</formula>
</field>
</fields>
<conditions/>
<actions/>
</model>
<model id="Opportunity" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Opportunity">
<fields>
<field id="Name"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<queue model="Opportunity" tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-1wkWJ9-158" searchmethod="server" searchplaceholdertext="Search {{$Model.OpportunityTracker.data.0.OpportunityCount}} Items" emptysearchbehavior="query" title="List of {{$Model.OpportunityTracker.data.0.OpportunityCount}} Opportunities">
<rendertemplate>{{Name}}</rendertemplate>
<interactions>
<interaction type="tap">
<action type="abandonRows" querystring="id={{Id}}" model="Opportunity" affectedrows="context"/>
<action type="custom" snippet="updateOpportunityTracker"/>
</interaction>
</interactions>
<searchfields/>
</queue>
</components>
<resources>
<labels/>
<javascript>
<jsitem location="inline" name="newInlineJS" cachelocation="false" url="">(function(skuid){
var $ = skuid.$;
function updateOpportunityTracker() {
var
// get the opportunity model
opportunityModel = skuid.$M('Opportunity')
// get the tracker model
, trackerModel = skuid.$M('OpportunityTracker')
// get the first row
, trackerRow = trackerModel &amp;amp;&amp;amp; trackerModel.getFirstRow()
// get the current record count
, recordCount = opportunityModel &amp;amp;&amp;amp; opportunityModel.data.length;

// make sure we have a row
if (trackerRow) {
// update the UI-Only field with the current count
trackerModel.updateRow(trackerRow, "OpportunityCount", recordCount);
} else {
console.log('Unable to locate first row in OpportunityTracker');
}
}

skuid.snippet.register('updateOpportunityTracker', function() {
// update the tracker
updateOpportunityTracker();
});

$(document.body).one('pageload',function(){
// update the tracker
updateOpportunityTracker();
});
})(skuid);</jsitem>
</javascript>
<css/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>


This is what I see on the repro page:


Then if I click a few


This looks like it’s working. What am I missing?


Hi Stephen -

Thanks for the looking in to this.  Please note the text in the “Search textbox”, it displays “Search 0 items”.  It should display “Search 9 Items” in your first screen shot and “Search 7 Items” in your second screen shot.


Oh you mean the text in the search bar… I see that now. I’ll notify our development team and get back to you when a fix is sent out. Thank you


Thank you!


Thank you for your patience


Reply