⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rowactionedit.java

📁 IBM RSA下的JSF开发示例
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
		if (text27 == null) {
			text27 = (HtmlOutputText) findComponentInRoot("text27");
		}
		return text27;
	}

	protected UIColumn getColumn12() {
		if (column12 == null) {
			column12 = (UIColumn) findComponentInRoot("column12");
		}
		return column12;
	}

	protected HtmlOutputText getText29() {
		if (text29 == null) {
			text29 = (HtmlOutputText) findComponentInRoot("text29");
		}
		return text29;
	}

	protected UIColumn getColumn1() {
		if (column1 == null) {
			column1 = (UIColumn) findComponentInRoot("column1");
		}
		return column1;
	}

	protected HtmlOutputText getText2() {
		if (text2 == null) {
			text2 = (HtmlOutputText) findComponentInRoot("text2");
		}
		return text2;
	}

	protected UIColumn getColumn2() {
		if (column2 == null) {
			column2 = (UIColumn) findComponentInRoot("column2");
		}
		return column2;
	}

	protected HtmlOutputText getText4() {
		if (text4 == null) {
			text4 = (HtmlOutputText) findComponentInRoot("text4");
		}
		return text4;
	}

	protected UIColumn getColumn3() {
		if (column3 == null) {
			column3 = (UIColumn) findComponentInRoot("column3");
		}
		return column3;
	}

	protected HtmlOutputText getText6() {
		if (text6 == null) {
			text6 = (HtmlOutputText) findComponentInRoot("text6");
		}
		return text6;
	}

	protected UIColumn getColumn4() {
		if (column4 == null) {
			column4 = (UIColumn) findComponentInRoot("column4");
		}
		return column4;
	}

	protected HtmlOutputText getText8() {
		if (text8 == null) {
			text8 = (HtmlOutputText) findComponentInRoot("text8");
		}
		return text8;
	}

	protected UIColumn getColumn5() {
		if (column5 == null) {
			column5 = (UIColumn) findComponentInRoot("column5");
		}
		return column5;
	}

	protected HtmlOutputText getText10() {
		if (text10 == null) {
			text10 = (HtmlOutputText) findComponentInRoot("text10");
		}
		return text10;
	}

	protected UIColumn getColumn6() {
		if (column6 == null) {
			column6 = (UIColumn) findComponentInRoot("column6");
		}
		return column6;
	}

	protected HtmlOutputText getText12() {
		if (text12 == null) {
			text12 = (HtmlOutputText) findComponentInRoot("text12");
		}
		return text12;
	}

	protected UIColumn getColumn7() {
		if (column7 == null) {
			column7 = (UIColumn) findComponentInRoot("column7");
		}
		return column7;
	}

	protected HtmlOutputText getText14() {
		if (text14 == null) {
			text14 = (HtmlOutputText) findComponentInRoot("text14");
		}
		return text14;
	}

	protected UIColumn getColumn9() {
		if (column9 == null) {
			column9 = (UIColumn) findComponentInRoot("column9");
		}
		return column9;
	}

	protected HtmlOutputText getText22() {
		if (text22 == null) {
			text22 = (HtmlOutputText) findComponentInRoot("text22");
		}
		return text22;
	}

	protected HtmlMessages getMessages1() {
		if (messages1 == null) {
			messages1 = (HtmlMessages) findComponentInRoot("messages1");
		}
		return messages1;
	}

	protected HtmlCommandLink getLink3() {
		if (link3 == null) {
			link3 = (HtmlCommandLink) findComponentInRoot("link3");
		}
		return link3;
	}

	protected ConnectionWrapper getSDOConnectionWrapper() {
		if (SDOConnectionWrapper == null) {
			try {
				Connection con = ConnectionManager
						.createJDBCConnection(SDOConnection_name);
				SDOConnectionWrapper = ConnectionWrapperFactory.soleInstance
						.createConnectionWrapper(con);
			} catch (Throwable e) {
				logException(e);
			}
		}
		return SDOConnectionWrapper;
	}

	/** 
	 * @action id=viewGrades
	 */
	public String doViewGradesUpdateAction() {
		try {
			getViewGradesMediator().applyChanges(
					getRootDataObject(getViewGrades()));
		} catch (Throwable e) {
			logException(e);
		} finally {
			try {
				if (SDOConnectionWrapper != null) {
					SDOConnectionWrapper.getConnection().close();
					SDOConnectionWrapper = null;
				}
			} catch (Throwable e1) {
				logException(e1);
			}
			if (viewGradesMediator != null) {
				viewGradesMediator.setConnectionWrapper(null);
			}
		}
		return "";
	}

	/** 
	 * @paramBean id=viewGrades
	 */
	public DataObject getViewGradesParameters() {
		if (viewGradesParameters == null) {
			try {
				viewGradesParameters = getViewGradesMediator()
						.getParameterDataObject();
			} catch (MediatorException e) {
				logException(e);
			}
		}
		return viewGradesParameters;
	}

	protected JDBCMediator getViewGradesMediator() {
		if (viewGradesMediator == null) {
			try {
				viewGradesMediator = JDBCMediatorFactory.soleInstance
						.createMediator(
								getResourceInputStream(viewGrades_metadataFileName),
								getSDOConnectionWrapper());
				initSchema(getRealPath(viewGrades_metadataFileName),
						viewGradesMediator.getSchema());
			} catch (Throwable e) {
				logException(e);
			}
		} else {
			viewGradesMediator.setConnectionWrapper(getSDOConnectionWrapper());
		}
		return viewGradesMediator;
	}

	/** 
	 * @action id=viewGrades
	 */
	public String doViewGradesFetchAction() {
		try {
			resolveParams(getViewGradesParameters(), viewGradesArgNames,
					viewGradesArgValues, "viewGrades_params_cache");
			DataObject graph = getViewGradesMediator().getGraph(
					getViewGradesParameters());
			viewGrades = graph.getList(0);
		} catch (Throwable e) {
			logException(e);
		} finally {
			try {
				if (SDOConnectionWrapper != null) {
					SDOConnectionWrapper.getConnection().close();
					SDOConnectionWrapper = null;
				}
			} catch (Throwable e1) {
				logException(e1);
			}
			if (viewGradesMediator != null) {
				viewGradesMediator.setConnectionWrapper(null);
			}
		}
		return "";
	}

	/** 
	 * @mediatorFactory com.ibm.etools.sdo.rdb.datahandlers.RelationalDataFactory
	 * @mediatorProperties metadataFileName=/WEB-INF/wdo/viewGrades.xml
	 * @methodEntry id=viewGrades/paramBean=viewGrades/action=viewGrades
	 * @action FILL
	 */
	public List getViewGrades() {
		if (viewGrades == null) {
			doViewGradesFetchAction();
		}
		return viewGrades;
	}
	
	/** 
	 * @managed-bean true
	 */
	public RowEditBean getEmployee() {
		if (employee == null) {
			employee = (RowEditBean) getFacesContext().getApplication()
					.createValueBinding("#{employee}").getValue(
							getFacesContext());
		}
		return employee;
	}
	
	/** 
	 * @managed-bean true
	 */
	public void setEmployee(RowEditBean employee) {
		this.employee = employee;
	}
	
	public String doLink2Action() {
		return "main";
	}
	
	/**
	 * The Row Edit Action Method - the code to apply the change is created for you, but you must write
	 * the code to create the error messages.
	 * @return
	 */
	public String doRowEdit1Action() {
		// Type Java code that runs when the component is clicked
		//the following code sends the changes made in the edit window to the database
		try {
			getViewGradesMediator().applyChanges((DataObject)((EcoreEList)getViewGrades()).getEObject());
		}
		catch (OCCException e) {
			FacesMessage msg = new FacesMessage("Data was updated by another user - new values are displayed");
			getFacesContext().addMessage("", msg);
			viewGrades = null;
			getViewGrades();
			return "";
		}
		catch (Throwable e) {
			FacesMessage msg = new FacesMessage("Update failed: " + e.getMessage());
			getFacesContext().addMessage("", msg);
			viewGrades = null;
			getViewGrades();
			logException(e);
			return "";
		}
		return "";
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -