Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Get updates from file
Started by andrey.masunov May 14 2018 01:10 PM

2 replies to this topic
file scene read update scenegroup create show
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

andrey.masunov

[GLOBAL: userInfoPane.html]
andrey.masunov
  • Observer

  • 1 posts
  • Corona SDK

Hi all,

 

I'm looking for solution for my case:

 

I have 2 view.

In 1st view I've created file with words.

User is able to add words to this file in 1st view

 

2nd view have to display words from file

 

I'm using

tableView with onRowRender to display words from file.

 

If I put initialisation in scene: create, all words(which were created in previous session of app) displayed correctly, but in case if user add new words in 1st view, they will not be displayed in the 2nd view (I think cause in this section initialisation hapens only once)

 

If I put initialisation of tableView with onRowRender in scene: show 

New words which added in 1st view displayed! But after switching from 1st to 2nd view lead to displaying the same words again and again...so, I suppose I have to remove everything what displayed in 2nd view and recreate it again.

 

How to make this process correctly?

 

e.g. every time when user switch to view, view have to read words from file and display all of them. After adding new words from other views to the file, new words also should be displayed in our view.

 



[TOPIC: post.html]
#2

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 2,956 posts
  • Corona SDK

Without seeing your code it's difficult to know.

 

I imagine (as that's all I can do right now) that the code you use to add text to the second view is not clearing the text before adding the next load of text. I'm guessing you are doing something like this:

view2.text = view2.text + view1.text

When you should be doing this:

view2.text = view1.text


[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,315 posts
  • Corona Staff

Are you using Composer scenes? Are you removing the scene before going back to it?

 

Rob




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: file, scene, read, update, scenegroup, create, show