| Author |
Message |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 12/02/2007 03:34:24
|
koraysez
Joined: 15/11/2006 00:00:00
Messages: 2
Offline
|
Hi,
I have been working on the editable-datatable.zip project and I am using IBM RSA for development purposes. I am using SDO for populating the datatable. I wasn't able to edit/update a single row. The code I came up with so far is as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%-- jsf:pagecode language="java" location="/JavaSource/pagecode/jsp/Test4.java" --%><%-- /jsf:pagecode --%>
<f:view xmlns:h="http://java.sun.com/jsf/html"
xmlns:hx="http://www.ibm.com/jsf/html_extended"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<ice:outputDeclaration doctypeRoot="HTML"
doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<%@ taglib uri="http://www.icesoft.com/icefaces/component" prefix="ice"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META name="GENERATOR" content="IBM Software Development Platform">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>Test4.jsp</TITLE>
<link rel="stylesheet" type="text/css" href="../theme/stylesheet.css"
title="Style">
<SCRIPT type="text/javascript">
function func_1(thisObj, thisEvent) {
//use 'thisObj' to refer directly to this component instead of keyword 'this'
//use 'thisEvent' to refer to the event generated instead of keyword 'event'
iceSubmitPartial(form, this, event);
}</SCRIPT>
</head>
<BODY>
<hx:scriptCollector id="scriptCollector1">
<ice:form partialSubmit="true" styleClass="form" id="form1">
<h:dataTable id="table1" value="#{pc_Test4.RRL_TST4}"
var="varRRL_TST4" styleClass="dataTable" headerClass="headerClass"
footerClass="footerClass" rowClasses="rowClass1"
columnClasses="columnClass1" border="0" cellpadding="2"
cellspacing="0">
<h:column id="column1">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Kullan?c?_?d"
id="text1"></h:outputText>
</f:facet>
<h:outputText id="text2" value="#{varRRL_TST4.KULLANICI_ID}"
styleClass="outputText">
<f:convertNumber />
</h:outputText>
</h:column>
<h:column id="column2">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Kullan?c?_ad"
id="text3"></h:outputText>
</f:facet>
<h:outputText id="text4" value="#{varRRL_TST4.KULLANICI_AD}"
styleClass="outputText">
</h:outputText>
</h:column>
<h:column id="column3">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Kullan?c?_soyad"
id="text5"></h:outputText>
</f:facet>
<h:outputText id="text6" value="#{varRRL_TST4.KULLANICI_SOYAD}"
styleClass="outputText">
</h:outputText>
</h:column>
<h:column id="column4">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Tc_k?ml?k_no"
id="text7"></h:outputText>
</f:facet>
<ice:inputText styleClass="inputText" id="text8"
value="#{varRRL_TST4.TC_KIMLIK_NO}"></ice:inputText>
</h:column>
<ice:column id="tst">
<f:facet name="header">
</f:facet>
<ice:panelGroup>
<h:commandLink value="Save"
ondblclick="return func_1(this, event);" />
</ice:panelGroup>
</ice:column>
</h:dataTable>
</ice:form>
</hx:scriptCollector>
</BODY>
</html>
</f:view>
?n your example you are using actionListener="#{city.save} to save the changes and this save function is only changing the “editable” variable. You used beans for updating I guess but I couldn't find any connection between bean and database.
1- how can ? update the database? do ? also have to create a bean for database connection and insert/update/delete purposes?
2- Is it possible to use ice tags and ibm jsf tags (eg: hx) together in the same jsp file?
Thanks in advace...
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 14/02/2007 00:05:56
|
philip.breau

Joined: 08/05/2006 00:00:00
Messages: 2675
Offline
|
Hi,
Yes, that example doesn't actually persist the changes back to the datasource (I was too lazy to finish that). But I do have an extended example of that which uses Hibernate and actually does persist the changes. I can post that tomorrow if you want.
Unfortunately you can't use the IBM tags with ICEfaces as we're not compatible with them. I see the only one you're really using here is the scriptCollector. I think our JavascriptContext api should give you what you need here.
To include a lib: JavascriptContext.includeLib(String, FacesContext);
To dynamically make a js call from a server side event: JavascriptContext.addJavascriptCall(FacesContext,String);
Thanks,
Philip
|
. |
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 15/02/2007 07:14:50
|
koraysez
Joined: 15/11/2006 00:00:00
Messages: 2
Offline
|
Hi Philip..
Can you please post the extended example?
I am not sure if I understand what you meant by the following statements.
To include a lib: JavascriptContext.includeLib(String, FacesContext);
To dynamically make a js call from a server side event: JavascriptContext.addJavascriptCall(FacesContext,String);
Can you give further explaination..thanks again..
|
|
|
 |
|
|