Tuesday 30 October 2012

Error: No data display on view - SISv3

If you modify the generated code by SPRING-ROO, make sure the name used in controller and view was right/same, since we use different convention compared to ROO's generated items.

Dev info:
IMS-SISv3 || SPRING || ROO

Monday 29 October 2012

Spring: java.lang.IllegalStateException

Neither BindingResult nor plain target object for bean name 'id' available as request attribute

Solusi:

  1. Check pada view sama ada bean "id" dipanggil. 
    1. Jika perlu, provide bean/BindingResult pada controller, 
    2. jika tidak, remove daripada view tersebut.


DevInfo:
Spring 3.06 || IMS-SISv3 

Tuesday 16 October 2012

DOJO 1.7: TabContainer - selected tab PROGRAMMATIC


ni yg aku buat kat hostel.
Hantar 1 parameter drpd controller nama dia tabId

uiModel.addAttribute("tabId","blockInfo");
return "collegemains/show";

then baca dalam page
then set value xxxSelected;
last print value xxxSelected masa generate tab.
tapi cara ni guna programmatic, cuba cari guna declarative.

<script type="text/javascript">
 dojo.ready(function()
{
var tc = new dijit.layout.TabContainer({style: "height: 100%; width: 100%;"}, "tc-hostelInfo");
var blockInfoSelected = false;
var hostelPersonnelInfoSelected = false;
var hostelHouseInfoSelected = false;
if ("${param.tabId}"=='blockInfo') { blockInfoSelected=true;}
if ("${param.tabId}"=='hostelPersonnelInfo') { hostelPersonnelInfoSelected=true;}
if ("${param.tabId}"=='hostelHouseInfo') { hostelHouseInfoSelected=true;}
var cpBlock = new dijit.layout.ContentPane({
        title: "Hostel Block",
        href : "${tabHostelBlockUrl}page=1&size=${empty param.size ? 10 : param.size}", 
        selected: blockInfoSelected, parseOnLoad: blockInfoSelected
        });
   var cpFellow = new dijit.layout.ContentPane({  
    title: "Hostel Personnel",
         href : "${tabHostelPersonnelUrl}page=1&size=${empty param.size ? 10 : param.size}",
         selected: hostelPersonnelInfoSelected, parseOnLoad: hostelPersonnelInfoSelected
        });
  
   var cpUnit = new dijit.layout.ContentPane({  
    title: "Hostel Unit",
         href : "${tabHostelHouseUrl}page=1&size=${empty param.size ? 10 : param.size}",
         selected: hostelHouseInfoSelected, parseOnLoad: hostelHouseInfoSelected
        });
   
   tc.addChild(cpBlock);
    tc.addChild(cpFellow);
    //tc.addChild(cpUnit);
   
tc.startup();
});
</script>


Dev info: Code=IKCM-APR || Framework=DOJO,SPRING || Language=JAVA,JSP

DOJO 1.7: dijit.layout.TabContainer - selected tab

ada declaration camni
<div data-dojo-type="dijit/layout/ContentPane" title="My first tab" data-dojo-props="selected:true">
so, pada page yg ada tab, sebelum <html>
declare

<c:if test="${not empty tabId}">
<c:choose>
//contohnya hantar uiModel.addAttribute("tabId","studyLeave");
// tapi aku tak sure sama ada leh guna test="${tabId eq 'studyLeave'}" atau test="${tabId=='studyLeave'}"
<c:when test="${tabId eq 'studyLeave'}">
<c:set var="studyLeaveSelected" value="true" />
</c:when>
<c:otherwise>
//kat sini set utk tab yg memula nk tunjuk kalau takde tab yg kita select
<c:set var="studyLeaveSelected" value="true" />
</c:otherwise>
</c:choose>
</c:if>

pastu pada declaration
<div data-dojo-type="dijit/layout/ContentPane" title="My first tab" data-dojo-props="selected:<c:out value="${studyLeaveSelected}" default="false" /> ">


Dev info: Code: IKCM-APR || Framework: DOJO, SPRING

Thursday 11 October 2012

Displaytag: Total pada footer

Boleh rujuk sendiri rujukan displaytag, ini nota ringkas buat diriku yang mudah lupa..

Apa yang penting:

  1. varTotal kena assign value, contoh varTotal="total"
  2. property total="true" kena set pada column
  3. boleh display guna variable pada (1) tadi, contoh ${total.column3}.
    1. setakat ni memang guna columnN dimana N ialah kedudukan/indeks column yg anda mahu display total bermula dengan nilai 1.

Monday 8 October 2012

Ibatis 2: ORA-00911: invalid character error


org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested
exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/icms/biz/dao/ibatis/maps/StaffExpertise.xml.
--- The error occurred while applying a parameter map.
--- Check the STEXP.getActSEBSId-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-00911: invalid character 

        at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLEx
ceptionTranslator.java:97)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(Abstrac
tFallbackSQLExceptionTranslator.java:72)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(Abstrac
tFallbackSQLExceptionTranslator.java:80)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(Abstrac
tFallbackSQLExceptionTranslator.java:80)
        at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212
)

Friday 5 October 2012

IBATIS 2 SQL Map: LIKE + '%'

Jumpa 1 isu dengan SQL Mapping apabila cuba gunakan LIKE dengan '%' dalam SQL Map framework IBATIS 2 

Thursday 4 October 2012

<![CDATA[
function matchwo(a,b)
{
if (a < b && a < 0) then
  {
  return 1;
  }
else
  {
  return 0;
  }
}
]]>


Notes on CDATA sections:
  • A CDATA section cannot contain the string "]]>". 
  • Nested CDATA sections are not allowed.
  • The "]]>" that marks the end of the CDATA section cannot contain spaces or line breaks.

Tuesday 2 October 2012

Ingat semula + RnD: cv-Online

Study cv-online untuk integrasi fungsi carian kepakaran pekerja.

Cuba kekalkan fungsi sedia ada, tapi dropdown dynamic gunakan DWR should be better.

[ Spesifikasi ]

  • SPRING 2.5.6
  • DWR 2.0.6

[ Kaji ]

  • controller
    • gunakan konfigurasi xml.
  • layout
    • DWR nampak promising, boleh alter table row dynamically
      • test DWR di http://machine:port/appsName/dwr/index.html , tapi mesti set param debug=true dulu.
      • DWR dalam projek ini rujuk kepada spring-dispatcher-servlet (org.springframework.web.servlet.DispatcherServlet), maka config dalam web.xml tidak diperlukan.
      • Konfig DWR ada dalam appsName-servlet.xml.
  • return value
    • ada bugs dengan special character, apar-online gunakan satu field khas untuk js.
      • cari kaedah untuk hantar value tanpa melalui parameter since ada pendapat mengatakan value pada dom object akan automatically converted.