Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within GWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
GWT
Update Hibernate Objects
matias casal
Ranch Hand
Posts: 61
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello GWT forum, I have a new question.
I am making a crud with hibernate + gwt, and my last topic is the update part.
Here is my table
public class ModificarUsuario extends Composite { static FlexTable ftm; Button enviar = new Button("Modificar"); FormPanel fm = new FormPanel(); public ModificarUsuario() { } public ModificarUsuario(final MusicStoreServiceAsync musicStoreService) { ftm = new FlexTable(); ftm.setText(0, 1, "ID"); ftm.setText(0, 2, "Nombre"); musicStoreService.getAccounts(new AsyncCallback<List<PersonaDTO>>() { @Override public void onFailure(Throwable caught) { Window.alert("Error cargando a las personas: " + caught.getMessage()); } @Override public void onSuccess(final List<PersonaDTO> result) { int i = 2; for (final PersonaDTO personaDTO : result) { ftm.setText(i, 1, String.valueOf(personaDTO.getId())); TextBox modificar = new TextBox(); modificar.setText(String.valueOf(personaDTO.getNombre())); modificar.setName(String.valueOf(personaDTO.getNombre()) + String.valueOf(personaDTO.getId())); ftm.setWidget(i, 2, modificar); i++; } ftm.setWidget(i + 1, 2, enviar); } }); enviar.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { // TODO Auto-generated method stub Window.alert("Boton player"); } }); fm.add(ftm); this.initWidget(fm); } }
My update method should be something like that
public void modificarPersona(String id) { List <PersonaDTO> abac = new ArrayList<PersonaDTO>(); Session session = HibernateUtil.getSessionFactory().getCurrentSession(); Transaction tx = session.beginTransaction(); Persona p = (Persona)session.get(Persona.class, new Integer(id)); e.setTitle("new Title"); session.update(e); tx.commit(); HibernateUtil.closeSession(); }
Now my question, how should I get the values of the modified textbox from the table ??
Thanks!
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
CRUD + Hibernate + GWT
how to convert flextable cell into editable textcell
problem with simple gwt app
how to make the border of tree widget invisible
GWT fileuploading error
More...