[Offline Apps] Table Records Links/Buttons not populating correctly

[Offline Apps] Table Records Links/Buttons not populating correctly

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

I have a Table Records component on my page and from this page i navigate to different pages. My Problem is with each record in the Table Records , i have 3 buttons or links that must navigate to different pages. The input parameters for the pages that needs to be naigated to are populated incorrectly.

For example:


The table contains jobs. The first link/button gets populated correctly but all the links after that gets populated with a negative number.

The correct jobid is 101 but the value passed to the second link/button gets -1808588812.

What is causing this and is there a workaround?

Regards

Arno
Hi Arno,

I believe the render function is only fixing links with method navigate (check the bottom of the cachedList.prototype.replaceJQuery function, you can add a breakpoint there). Make sure you are using links (you can style them as buttons) and that those links are inside a container that is being used in the render() function.

Cheers,
Tiago
Hi Tiago

I seem to be a bit lost here. I created two links. The first link renders the id of the row correctly in the url , but the second link renders the id of the row as a negative number. I did place these links inside containers as suggested.

I don't understand what you mean with "...and that those links are inside a container that is being used in the render() function".

Please help.

Regards

Arno
Hi Arno,

Thanks for your feedback. That looks to be indeed an issue, the cachedList.prototype.replaceText in OfflineStorageJavaScript.js is using the string replace function which replaces only the first occurence of the found text

I'll see if  can post a fix for that soon.

Cheers,
Tiago Simões
Hi Tiago

By when can i expect the bug fix to be published as i this is quite a pressing issue and i need to resolve this asap.

Regards

Arno
Hi Arno,

The Offline Apps component will be updated (for version 9) next week.

In the meantime you can try to change the OfflineStorageJavaScript web block javascript, changing the function cachedList.prototype.replaceText by replacing all occurences of
  .replace(a,b)
by 
  .split(a).join(b)

Let me know if that fixes your problem.

Cheers,
Tiago Simões

Hi Tiago

The primary identifier seems to be working in th link now. I dow have another problem though.
Here is the link as it renders :

http://servername/ESpace/SomePage.aspx#Originator=FieldAgentInbox&JobType=%7bEntityFieldAgentInbox.JobType%7d&CurrentStatus=%7bEntityFieldAgentInbox.JobStatus%7d&JobId=71&(Not.Licensed.For.Production)=

As you can see , the JobType and CurrentStatus is not rendering correctly as it is the input text as specified for the link , and not the values as expected.

Regards

Arno
Hi Arno,

%7b and %7d are the URLEncoded forms of { and } respectively.
See if you can process them with some sort of javascript or try to use only plain strings and nubers as arguments instead (some javascript might be needed here also).

Cheers,
Tiago Simões