티스토리 툴바


PROGRAMES/MIPLATFORM2010/03/23 00:30


1. 필터사용  //cud 의 경우 화면에서 나누어 보내지 안는 이상 불가. 더 많은 공수가 소요

그리드.Redraw = false; //Dataset에 Filter를 적용시켰을 때 그리드에 반영시키지 않기 위하여
원본데이터셋.Filter("CHECK == '1'");
for(var inx=0; inx < 원본데이터셋.rowcount; inx++){
 원본데이터셋.SetColumn(inx, "GONGSI_SONGDAL_YN", "Y");
}

if (Object("데이터셋Tmp") == null) {
 Create("Dataset", "데이터셋Tmp");
}
데이터셋Tmp.CopyF(원본데이터셋); //// cud 도 불가
원본데이터셋.UnFilter();
그리드.Redraw = true;

2. 하드코딩 // cud 도 가능하다

사본데이터셋.Assign("원본데이터셋");
 
for( var idx = 사본데이터셋.rowCount -1; idx >= 0; idx--)
{
 if(사본데이터셋.GetColumn(idx,"CHK") != "1"
 ||gfn_IsNull(사본데이터셋.GetColumn(idx,"CHK")))
 {
  사본데이터셋.DeleteRow(idx);
 }   
}

Posted by 하루하루가축복입니다
PROGRAMES/FLEX2009/07/24 11:09
1. ArrayCollection


public function SortField(name:String = null, caseInsensitive:Boolean = false, descending:Boolean = false, numeric:Boolean = false)

var col:ArrayCollection = new ArrayCollection();
             
//SortField("필드명", 대소문자구분여부, 내림차순false/올림차순true, 문자 false/숫자 true 구분)
sort.fields = [new SortField("last", false, true, false)];
col.sort = sort;
col.refresh();

2. Array

복수의 플래그
my_array.sortOn(someFieldName, Array.DESCENDING | Array.NUMERIC);

여러개의 필드
Array.sortOn (["a", "b", "c"], [Array.DESCENDING, Array.NUMERIC, Array.CASEINSENSITIVE]);

 

 

Posted by 하루하루가축복입니다
PROGRAMES/SPRING2009/07/17 23:30
1. ApplicationContextAware 인터페이스 구현하기

ApplicationContextAware 인터페이스를 구현한 POJO빈은 Application 인스턴스에 접근하는 것이 가능하다
단점 : spring에 종속적이게 된다.

public class UserServiceImpl implements UserService, ApplicationContextAware{

private ApplicationContext context;
public void setApplicationContext(ApplicationContext context)
   throws BeansException {
  this.context = context;
 }

--중간생략 --

if (userDAO.existedUser(user.getUserId())) {
   throw new ExistedUserException(context.getMessage(
     "user.existed.exception",
     new Object[] { user.getUserId() }, null
));
  }

application.xml

<bean id="messageSource"
  class="org.springframework.context.support.ResourceBundleMessageSource">
  <property name="basenames">
   <list>
    <value>Messages</value>
   </list>
  </property>
 </bean>

Messages_ko.properties
Messages_en.properties

2. MessageSourceAccessor 유틸클래스 사용(이방법이 더좋은것 같다.)


MessageSourceAccessor 클래스는 MessageSource 로 사용할 ResourceBundleMessageSource를 생성자로
전달할수 있다 밑의 예제에서 Constructor Injection을 이용하여 생성자로  전달하고 있다


POJO

private MessageSourceAccessor msAccessor = null;
 
 public void setMessageSourceAccessor(MessageSourceAccessor msAccessor) {
  this.msAccessor = msAccessor;
 }

--중간생략--
if( logger.isErrorEnabled() ) {
    logger.error(msAccessor.getMessage("email.not.send"), me);
    logger.error(msAccessor.getMessage("original.error.message"), e);
   }

application.xml

<bean id="messageSource"
  class="org.springframework.context.support.ResourceBundleMessageSource">
  <property name="basenames">
   <list>
    <value>Messages</value>
   </list>
  </property>
 </bean>
 
 <bean id="messageSourceAccessor"
  class="org.springframework.context.support.MessageSourceAccessor">
  <constructor-arg>
   <ref local="messageSource"/>
  </constructor-arg>
 </bean> 

<bean id="mailSender"
  class="net.javajigi.common.mail.ExceptionMailSender">
    <property name="messageSourceAccessor">
         <ref local="messageSourceAccessor"/>
  </property>   
 </bean>
Posted by 하루하루가축복입니다