[Offline Apps] Offline mode renders parameters and hidden values wrongly 

[Offline Apps] Offline mode renders parameters and hidden values wrongly 

  
Forge Component
(25)
Published on 2015-11-19 by OutSystems Labs
25 votes
Published on 2015-11-19 by OutSystems Labs

Hi,
We are developing an application with offline mode but currently encounter a problem that values in Offline\OfflineListRecords are erndered correctly but only if they are visible. Meaning if we put List.REST_test.test.testvalue in expression it is rendered properly, but if we put it as an attribute of container then all item in list get same {REST_test.testvalue} value.
Is it a bug or we are missing something?
Thank you.

Hey again, Mykola,

If I understood correctly, you placed the record attribute in an attribute of a container with several offline expressions and ALL of them were replaced by the same value, right? If this is the case, you should be more specific, and only place the attributes on the expressions themselves.

If not, could you please elaborate a little further on your scenario? I might be  missing the structure of the page and which attributes are placed where.

Best regards,

Carlos Simões

Hi again Carlos :)

Case is this - Ihave a Offline\OfflineListRecords and I need to set some values as a divs attributes for further JS processing. For example "toggleClass" on screenshot the "value" is rendered correctly but attribute is toggleclass="toggle_-775872996" and it is same for each div in the list so I can't distinguish them by this attribute value.


PS: as a temporary workaround I'm using "invisible" divs with specific classes that holds values I need and parse through them. But it would be much more convenient and "developer friendly" to use attributes as on "online app" :)

I'm almost positive the component does not consider widget attributes as replacement candidates (only DOM values, as you sugested). Have you tried using "CreateSampleRecord" as in the Inspections app? You can see several expressions there that use this pattern in the "YourInspections" screen.

If this doesn't solve it (or you prefer a more JSful solution) why don't you try using the "finishedRender" event again and iterate every div containing the attribute, read the innner value and change the attribute's value?

Please let me know if any of these helped :).

Best regards,

Carlos Simões

Hi Carlos,

Will try this approach. Thank you.