Taller Java Studio Creator

  • Uploaded by: api-3735749
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Taller Java Studio Creator as PDF for free.

More details

  • Words: 486
  • Pages: 14
Ejemplos Java Studio Creator DataBase Requisito: Crear Base de Datos Music

Music Project

Eventos

public String addNewCategory_action() { // TODO: Process the button click action. Return value is a navigation // case name where null will return to the same page. log("addNewCategory_action()"); if (musiccategoriesDataProvider.canAppendRow()) { try { RowKey rowKey = musiccategoriesDataProvider.appendRow(); // put the new data in the data provider musiccategoriesDataProvider.setValue("MUSICCATEGORIES.MUSICCATEGORYID", rowKey, getApplicationBean1().getNextCategoryId()); musiccategoriesDataProvider.setValue("MUSICCATEGORIES.MUSICCATEGORY", rowKey, newCategory.getText()); musiccategoriesDataProvider.commitChanges(); info("New Category " + newCategory.getText() + " added to MUSICCATEGORIES table"); log("addNewCategory_action(): Added category " + newCategory.getText()); newCategory.setText(null); } catch (Exception e) { log("Cannot add new recording artist ", e); error("Cannot add new recording artist: " + e.getMessage()); } } else { log("Cannot append new recording artist"); error("Cannot append new recording artist"); } return null; }

public void setSelected(boolean selected) { // called for every row TableRowDataProvider trdp = (TableRowDataProvider)getBean("currentRow"); RowKey rowKey = trdp.getTableRow(); if (checkbox1.isChecked()) { // Add rowKey to selectedRows HashSet if checkbox is selected (checked) selectedRows.add(rowKey); } else { // Remove rowKey from selectedRows HashSet if not checked selectedRows.remove(rowKey); } }

Para Hacer efectivo el Borrado

musiccategoriesDataProvider.commitChanges();

public String update_action() { // TODO: Process the button click action. Return value is a nav // case name where null will return to the same page. try { musiccategoriesDataProvider.commitChanges(); log("update: changes committed"); info("Update committed"); } catch(Exception e) { log("update: cannot commit changes ", e); error("Cannot commit changes: " + e.getMessage()); } return null; }

public String cancel_action() { // TODO: Process the button click action. Return value is a nav // case name where null will return to the same page. try { musiccategoriesDataProvider.revertChanges(); log("cancel: revert changes"); info("Update cancelled"); } catch(Exception e) { log("cancel: cannot revert changes ", e); error("Cannot revert changes: " + e.getMessage()); } return null; }

Agregar Datos

public String update_action() { // TODO: Process the button click action. Return value is a n // case name where null will return to the same page. try { musiccategoriesDataProvider.commitChanges(); log("update: changes committed"); info("Update committed"); } catch(Exception e) { log("update: cannot commit changes ", e); error("Cannot commit changes: " + e.getMessage()); } return null; }

public String addNewCategory_action() { // TODO: Process the button click action. Return value is a navigation // case name where null will return to the same page. log("addNewCategory_action()"); if (musiccategoriesDataProvider.canAppendRow()) { try { RowKey rowKey = musiccategoriesDataProvider.appendRow(); // put the new data in the data provider musiccategoriesDataProvider.setValue("MUSICCATEGORIES.MUSICCATEGORYID", rowKey, getApplicationBean1().getNextCategoryId()); musiccategoriesDataProvider.setValue("MUSICCATEGORIES.MUSICCATEGORY", rowKey, newCategory.getText()); musiccategoriesDataProvider.commitChanges(); info("New Category " + newCategory.getText() + " added to MUSICCATEGORIES table"); log("addNewCategory_action(): Added category " + newCategory.getText()); newCategory.setText(null); } catch (Exception e) { log("Cannot add new recording artist ", e); error("Cannot add new recording artist: " + e.getMessage()); } } else { log("Cannot append new recording artist"); error("Cannot append new recording artist"); } return null; } }

Selección de Datos public String hyperlinkTitle_action() { // TODO: Replace with your code TableRowDataProvider rowData = (TableRowDataProvider)getBean("currentRow"); getRequestBean1().setRecordingID((Integer)rowData.getValue("RECORDINGS.RECORDINGID")); getRequestBean1().setRecordingTitle((String)rowData.getValue("RECORDINGS.RECORDINGTITLE")); log("[hyperlinkTitle_action]: recording ID = " + rowData.getValue("RECORDINGS.RECORDINGID")); return "tracks"; } }

Tracks SessionBean

Related Documents

Taller Java Studio Creator
November 2019 9
Creator
June 2020 10
Creator
November 2019 22
Taller Formulas En Java
November 2019 11
Dennis Creator
April 2020 22