- Hello,
Skuid Version: 13.0.11
Model that is used for style condition, if the data for that model is changed/edited then an error will be produced. (The XML for a page bellow is set up to reproduce the problem).
If there are 2 conditions, where one of the conditions is in context and other one is not, if the condition without context is before the condition with context then the 2nd condition will lose context. (Not reproduced in the example below).
Best,
Lukas
<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
<models>
<model id="UIModel" limit="20" query="true" createrowifnonefound="false" datasource="Ui-Only">
<fields>
<field id="NewField" displaytype="TEXT" length="255"/>
<field id="NewField1" displaytype="TEXT" length="255"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="UIModel2" limit="20" query="true" createrowifnonefound="true" datasource="Ui-Only">
<fields>
<field id="NewField" displaytype="TEXT" length="255"/>
<field id="NewField1" displaytype="TEXT" length="255"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<skuid__text contents="Reproduce Error:
- Add a new row with data, and then remove the data. Console will show an error:&nbsp;&nbsp;Cannot read property &#39;unsubscribe&#39; of undefined
- UI Setup: attach style conditions, particularly Formulas.
- This also happens if the row is deleted, or data in first column gets changed
- Only tested with UI Models, might be happening with SF Models and other type of conditions.
After this error was produced once it will keeping produced - don&#39;t why it keeps throwing it." uniqueid="sk-qwe-52243"/>
<skuid__table allowColumnFreezing="dragDrop" model="UIModel2" uniqueid="sk-m5Y-9209" mode="edit" pageSize="10">
<fields>
<field id="NewField" uniqueid="fi-m5e-15356"/>
<field id="NewField1" uniqueid="fi-qwx-56012"/>
</fields>
<filtering enableSearch="false"/>
<rowActions>
<action type="multi" label="Delete">
<actions>
<action type="markRowsForDeletion" model="UIModel2" affectedrows="context"/>
</actions>
</action>
</rowActions>
<massActions/>
<actions>
<action type="multi" label="Add">
<actions>
<action type="createRow" model="UIModel2" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="all"/>
</actions>
</action>
</actions>
<styles>
<spacing/>
</styles>
</skuid__table>
<skuid__deck columnGutter=".75em" rowGutter=".75em" model="UIModel2" showSaveCancel="false" verticalAlign="top" minWidth="350px" uniqueid="sk-m6A-18996" title="Deck">
<components>
<skuid__text contents="<strong>Text Component:</strong>
test1234 {{NewField}}" uniqueid="sk-m4y-2145" model="UIModel2">
<renderConditions logictype="and"/>
<styleVariantConditions>
<rule logictype="and" styleSettingsVariantOverride="gigantic">
<condition type="fieldvalue" enclosevalueinquotes="true" fieldmodel="UIModel2" sourcetype="fieldvalue" nosourcerowbehavior="deactivate" sourceproperty="isNew" operator="=" field="NewField" value="Test2"/>
</rule>
</styleVariantConditions>
<styles>
<spacing bottom="3"/>
</styles>
<conditions>
<condition type="contextrow" field="Id" mergefield="Id" operator="="/>
</conditions>
</skuid__text>
<skuid__form showErrorsInline="true" model="UIModel2" uniqueid="sk-m6R-21377" mode="read">
<sections>
<section title="Form Component" showHeading="true">
<rows>
<row>
<fields>
<skuid__field id="NewField" uniqueId="sk-m6Z-25997">
<renderConditions logictype="and" onhidedatabehavior="keep"/>
<enableConditions/>
<styleVariantConditions>
<rule logictype="and">
<condition type="formula" operator="=" fieldmodel="UIModel2" sourcetype="fieldvalue" field="NewField" value="" enclosevalueinquotes="true">
<formula>C__Value({{NewField}})</formula>
</condition>
</rule>
</styleVariantConditions>
</skuid__field>
<skuid__field id="NewField1" uniqueId="sk-qrY-43919">
<renderConditions logictype="and" onhidedatabehavior="keep"/>
<enableConditions/>
<styleVariantConditions>
<rule logictype="and">
<condition type="formula" operator="=" fieldmodel="UIModel2" sourcetype="fieldvalue" field="NewField" value="" enclosevalueinquotes="true">
<formula>C__Value({{NewField}})</formula>
</condition>
</rule>
</styleVariantConditions>
</skuid__field>
</fields>
</row>
</rows>
</section>
</sections>
<conditions>
<condition type="contextrow" field="Id" mergefield="Id" operator="="/>
</conditions>
</skuid__form>
</components>
<filtering enableSearch="false"/>
</skuid__deck>
</components>
<resources>
<labels/>
<javascript>
<jsitem location="formulafunction" name="newFormulaFunction" cachelocation="false" url="">const utils = skuid.utils;
const {
DISPLAY_TYPES: {
NUMBER,
STRING,
}
} = skuid.constants;
// Register a new formula function named C__REPEAT for use in the runtime
new skuid.formula.FormulaFunction(
"Value",
function( fieldValue) {
console.log(fieldValue);
return fieldValue
},
);</jsitem>
</javascript>
<css/>
<actionsequences/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuid__page>