Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update entire Bean #66

Open
ASchmidt84 opened this issue Oct 14, 2022 · 0 comments
Open

Update entire Bean #66

ASchmidt84 opened this issue Oct 14, 2022 · 0 comments

Comments

@ASchmidt84
Copy link

Hi,
I have a client/server architecture.
I am using lagom µ-services holding all entities. And at the client side the GUI is using special case class which encapusle the entity data. More and special things are not relevant for this.

My problem is, i reload the entire entities because they could change from other side. And if i throw the SFXBean away the gui is reloading all. So I want only update the initial sfxbean with the mayben new data from the server.
I can set each field step by step like

bean.setValue("key",data)

To change all fields I have to do it like this way and by my self

  def updateCompleteBeanPatient(toUpdate: SFXBean[PatientViewFX], newValue: PatientViewFX): Unit = {
    newValue.productElementNames.toList.zip(newValue.productIterator.toList).foreach{tuple =>
      toUpdate.updateValue(tuple._1,tuple._2)
    }
  }

I prefere a more elegan solution. Maybe it is possible to enhance the SFXBean with the possibility to update the whole value (in this case PatientViewFX)?

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant