Normally STS equipped with Subclipse 1.6.x, uninstall current version and update to 1.8.x instead.
http://sliksvn.com/en/download//
error, issue, RnD, notes for my colleagues ... anything related with my job. A good programmer should be a good and fast reader. This log just to cut the costs of my RnD. Nothing personal :)
Tuesday, 11 September 2012
Rujukan: Json + Spring 3
Sedang mengkaji beberapa pilihan yang ada untuk integrasi Json dan Spring 3.05
Saturday, 8 September 2012
STS: Web Project Settings >> Context root
Something weird happen when migrate ISAS to APR.
The root still point to ISAS while APR was expected.
The root still point to ISAS while APR was expected.
Tuesday, 17 July 2012
DOJO 1.7: Compound or Composite Key in DataGrid + JsonRestStore
Isu:
Penggunaan id komposit pada property idAttribute, penggunaan idAttribute yang salah akan menyebabkan data yang berulang dipaparkan.Framework:
Spring 3 + DOJO 1.7 + JPAdojox.data.JsonRestStore
dojox.grid.DataGrid
Penyelesaian:
1. Gunakan fungsi toJson() dalam kelas domain/POJO/model.import flexjson.JSONSerializer;
...
public String toJson() {
return new JSONSerializer().exclude("*.class").serialize(this);
}
2. Umpukkan nilai kepada property idAttribute. Contoh:
var poStore = new JsonRestStore({
target: "${listUrl}/ajaxUnits/${blockId}?",
idAttribute:"id.toJson" ,
syncMode: true });
@Valid
@EmbeddedId
private CollegeHouseMainPK id;
public CollegeHouseMainPK getId() {
return this.id;
}
public void setId(CollegeHouseMainPK id) {
this.id = id;
}
Keyword yang digunakan untuk penyelesaian ini:
- prevent duplicate data in datagrid
- JsonRestStore idAttribute composite key
- JsonRestStore identifier
- redundant json data dojo datagrid
Penasihat
- Osman Sulaiman, IKCM Sdn Bhd.
Monday, 16 July 2012
DOJO 1.7: Child properties access on JSON + DataGrid
Katakan kita diberi data JSON:
[{"id":{"chmCompanyCode":"U","chmCollegeCode":"BMI","chmBlockCode":"SB-A","chmHouseCode":"1F-18"},"chmActive":"Y","chmCapacity":4,"chmCurCapacity":4,"chmFreeCapacity":0,"chmHouseDesc":"LEVEL 1","chmLevel":1}]
Untuk akses id.chmHouseCode dan set pada layout untuk datagrid:
gridLayout = [
{ name: "id", field: "id"},
{ name: "Code", field: "_item", formatter:function(item){return item.id.chmHouseCode;}},
{ name: "Name", field: "chmHouseDesc"},
{ name: "Capacity", field: "chmCapacity"}];
Cuma ubah BLUE FONT sahaja, yang lain maintain.
Masalahnya, tak boleh sorting apabila gunakan _item atau get.
[{"id":{"chmCompanyCode":"U","chmCollegeCode":"BMI","chmBlockCode":"SB-A","chmHouseCode":"1F-18"},"chmActive":"Y","chmCapacity":4,"chmCurCapacity":4,"chmFreeCapacity":0,"chmHouseDesc":"LEVEL 1","chmLevel":1}]
Untuk akses id.chmHouseCode dan set pada layout untuk datagrid:
gridLayout = [
{ name: "id", field: "id"},
{ name: "Code", field: "_item", formatter:function(item){return item.id.chmHouseCode;}},
{ name: "Name", field: "chmHouseDesc"},
{ name: "Capacity", field: "chmCapacity"}];
Cuma ubah BLUE FONT sahaja, yang lain maintain.
Masalahnya, tak boleh sorting apabila gunakan _item atau get.
Friday, 13 July 2012
DOJO 1.7: DataGrid + JsonRestStore
Framework: SPRING 3.06 + DOJO 1.7
<script type="text/javascript">function prepareDatagrid(){
require(['dojox/grid/DataGrid', 'dojox/data/JsonRestStore'],
function(DataGrid, JsonRestStore)
{
console.log("showCollegeBlock.jsp");
console.log("${urlCollegeHouses}");
gridLayout = [
{ name: 'Code', field: 'id.chmHouseCode', editable: true},
{ name: 'Name', field: 'chmHouseDesc'},
{ name: 'Capacity', field: 'chmCapacity'}];
var poStore = new JsonRestStore({target: "${urlCollegeHouses}/ajaxUnits/${hostelId}?" });
// use the query results returned from the server
/*create a new grid*/
var grid = new DataGrid({
id: 'grid',
store: poStore,
structure: gridLayout,
rowSelector: '20px'});
/*append the new grid to the div*/
grid.placeAt("gridDiv");
/*Call startup() to render the grid*/
grid.startup();
});}
</script>
Selain itu boleh guna kaedah manual fetching:
poStore.fetch({
onComplete: function(items){
grid = new dojox.grid.DataGrid({
store: poStore,
items: items,
structure: gridLayout
}, "gridDiv");
grid.startup();
}
});
Monday, 9 July 2012
SPRING 3.06: Form tidak binding ke domain
Framewok: SPRING 3.06
DB: MySQL 5
Bahasa: Java 6
DB: MySQL 5
Bahasa: Java 6
Isu:
Value yang dihantar ke dalam form (JSP) menggunakan HIDDEN tag tidak bind automatik ke domain.Punca:
- 2012-07-09: Tiada setter untuk property yang terlibat pada domain.
Subscribe to:
Posts (Atom)