지워지지 않는 마법처럼 신비한..

For PHP 5.x and you can try

while ($row = mysql_fetch_object($result,”VOAuthor”)) {
$ret[] = $row;
}

=============

http://miti.pricope.com/2008/06/06/debugging-flex-and-php-with-flex-builder-and-zend-studio/
http://corlan.org/2009/01/07/throwing-an-error-when-working-with-php-and-amf/

=============

now, i’ve uploaded the site. the server doesn’t return any errors but when i point my browser to mysite.com/zendamf_remote , the browser asks me if i want to download a file which actually contains the following text:
Zend Amf Endpoint

if i comment out:
// echo($server -> handle());

“Zend Amf Endpoint” is returned in my browser window, the way it does when testing locally!!!

So, php seems to be fine since all is working locally…

On the web server, I’m connected to Zend Amf Server, since the browser returns the endpoint address…

In order to avoid the Security sandbox violation, i have set the endpoint uri in the services-config.xml to zendamf_remote/ and this works fine locally…

So it seems that all the pieces are in place and yet something’s missing!!! Any ideas???


해결의 힌트 ::
Client.Error.DeliveryInDoubt
Channel disconnected before an acknowledgement was received

are the most annoying and trickiest error to debug when you are using Flash Remoting through AMFPHP.

But this error is actually pretty simple. It simply means there is a syntax error in your PHP code or the SQL statement within your PHP code.

To solve this problem make sure that:
  • Your Adobe Flex function parameters and PHP function parameters are of the same number.
  • The parameters of your Adobe Flex function are in the same order with its PHP function counterpart.
  • All the Adobe Flex function parameters are of the same data type with their PHP function parameters counterpart.
  • You assign a default value to the optional parameters in the PHP function.
  • You pass a value to the parameters that are not optional.
  • Finally, your SQL statements should be syntactically correct.
--------------------------------------------------------

결론은 PHP 코드쪽의 오류라는건데, 정답은 PHP 코드의 오류 또는 리턴값외의 PHP 출력값이 있을경우 이런 오류가 발생한다.
즉 디버깅등을 위해 echo나 var_dump()등으로 해당 PHP코드가 정상적으로 값을 리턴하는지 확인할 경우 echo등으로 출력된 문자값으로 인해 AMF가 channel 오류를 발생시키는 것으로 보인다.

정리 하면 AMF통해 FLEX쪽으로 값을 넘길때 Service코드를 구현하게 되는데 이때는 리턴값외에 어떤값도 출력되어서는 안된다. PHP코드상의 에러가 없어야 함은 물론이다.

=> 해결이 어려울것으로 보이는 문제였기에 기록한다.

'파란코드 > 알짜' 카테고리의 다른 글

음 좋아요.. 이렇게 구분하지.  (2) 2007.05.09

혹시 JVM 6.0으로 사용하고 계신건 아닌지...
http://forum.java.sun.com/thread.jspa?threadID=5121172 에 가보면 같은 문제에 다한 논의가 있습니다.
Tomcat 6.0의 문제라기 보다는 JVM 6.0의 jni에 변경이 있는 것 같다고 합니다.
아무튼 이 문제는 JVM이 설치된 디렉토리에서 msvcr71.dll 찾아 \Windows\system32에 복사해 넣으면 해결 됩니다.

데이터 검증

이 주제에서는, 어플리케이션내에서 데이터를 검증할 수 있도록(듯이) 하는 Adobe Flex 2 의 데이터 검증 메카니즘에 대해 설명합니다. Flex 에는, 일자, 번호, 통화의 값 등 유저가 입력하는 일반적인 데이터 타입에 대응한, 사전 정의 끝난 검증이 있습니다.

통상, Flex validator 는 데이터 모델에 대해서 사용합니다. 데이터 모델의 상세한 것에 대하여는,데이터의 포함을 참조해 주세요.

목차

데이터 검증
발리 데이터의 사용
검증의 일반적인 가이드 라인
검증 에러의 조작
검증 이벤트의 조작
표준 validator 의 사용


원본 : http://flexdocs.kr/docs/flex2/docs/00001054.html#792012

<mx:TextInput id="txtTo" width="300"/>
<mx:Button label="Send" toolTip="Send e-mail to {txtTo.text}"/>

원본 주소 :
http://flexdocs.kr/docs/flex2/docs/00000889.html

<!-- HTTP service call with an object as a send() method parameter that provides query parameters. -->

<!-- 1. 오브젝트 방식으로 넘기는 방법 -->
<mx:Button click="MyService.send({paramName1: 'val1'});"/>

<!-- HTTP service call with a send() method that takes a variable as its parameter. The value of the variable is an Object. -->
   <mx:Script>
       <![CDATA[
           public function myFunction():void {
               // Cancel all previous pending calls.
               MyService.cancel();

               // 2. 스크립트 상에서 오브젝트를 생성해서 넘기는 방법
               var params = new Object();
            params.paramName1 = 'val1';
               MyService.send(params);

           }
       ]]>
   </mx:Script>


<mx:Button click="myFunction();"/>

<mx:HTTPService id="MyService"
 showBusyCursor="true" useProxy="false"
>

<!-- 3. 내부 태그를 정의해서 넘기는 방법 -->
 <mx:request>
  <paramName1>val1</paramName1 >
 </mx:request>
</mx:HTTPService>

제가 아는 것은.. 이렇게 3가지네요.. 또 있으면 알려주세요.. 총총

+ 추가한 내용

4번째로

url 에 직접 입력해서 넘기는 방법이 있겠네요

<mx:HTTPService id="MyService"
 showBusyCursor="true" useProxy="false"

    url="http://server/foo.jsp?paramName1=val1"
/>

출처 : 네이버 카페 - Flex Component


5.


var params = new Object();
params["paramName1"] = 'val1';
MyService.send(params);

출처 : http://for100years.com/64

플랙스(FLEX)의 DataGridColumn 가로 폭(width)을 비율로 정하는 간단한 팁을 소개하고자 한다.

FLEX reference를 보면 알겠지만, DataGrid의 컬럼의 가로 폭은 픽셀 단위로만 설정을 하게되어 있어서, DataGrid의 길이가 변화될 때에 특정 비율을 유지하도록 하기에 어려운 점이 있다.

그렇지만 아래와 같은 방법을 사용하면 %로 폭을 설정하는 것과 같은 효과를 볼 수가 있다.

예를 들어, DataGrid에 컬럼을 5개를 다음과 같은 헤더와 비율로 만든다고 하자.
번호: 10%
제목: 50%
이름: 15%
날짜: 15%
열람 수: 10%

이제 실제 가로 폭보다 아주 큰 숫자를 정한 후, 각 컬럼의 비율을 곱한 값을 픽셀 폭으로 설정하면 원하는 비율로 DataGridColumn을 보여지도록 할 수 있다.

예를 들어, 10000을 각 비율로 곱한 컬럼의 픽셀 폭은 다음과 같다.

번호: 10000 * 0.1 = 1000
제목: 10000 * 0.5 = 5000
이름: 10000 * 0.15 = 1500
날짜: 10000 * 0.15 = 1500
열람 수: 10000 * 0.1 = 1000

위와 같이 계산된 컬럼 폭을 사용한 DataGrid를 그려보면 아래와 같이 원하는 비율로 컬럼 폭이 유지됨을 확인할 수 있다.

<mx:DataGrid width="100%" rowCount="3">
    <mx:columns>
        <mx:DataGridColumn headerText="번호" width="1000"/>
        <mx:DataGridColumn headerText="제목" width="5000"/>
        <mx:DataGridColumn headerText="이름" width="1500"/>
        <mx:DataGridColumn headerText="날짜" width="1500"/>
        <mx:DataGridColumn headerText="열람 수" width="1000"/>
    </mx:columns>
</mx:DataGrid>

출처 : 어디선가 봤는데 기억이 나지 않음.

TextInput과 TextArea의 속도 향상


한국 Adobe Flex 사이트의 블로그에 나와있는 힌트를 보고 실제로 한번 시도해 보았는데, 확실히 속도의 향상이 있네요.

"간단하게도 TextField의 alwaysShowSelection 이란 프로퍼티 값이 기본적으로는 false로 되어있는데 이것을 true로 바꿔주면 간단하게 해결됩니다."

지금까지 해결방법으로 제시되었던 것은 frame rate을 작게 바꾸는 것이었는데, 의외로 간단한 곳에 해결방법이 있었네요.

간단한 것이지만 샘플 코드를 원하시는 분들이 계시더군요.  몇몇 분들이 원하시는 것 같아서 이곳에 올려 봅니다. MXML 파일을 올립니다.


MyTextArea.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml"
    initialize="init()">
 <mx:Script>
  <![CDATA[
   private function init(): void {
    this.textField.alwaysShowSelection = true;
   }
  ]]>
 </mx:Script>
</mx:TextArea>

출처 : http://thefirstgood.com/?aid=6

AOL music의 AIR 위젯 : http://music.aol.com/help/syndication/desktop-widgets
Download 위젯을 클

'파란코드 > 참고정보' 카테고리의 다른 글

[Flex팁] TextInput과 TextArea의 속도 향상  (1) 2008.04.27
AIR 적용사이트  (0) 2008.02.19
Grails ?, Grails !  (0) 2007.06.19
Ruby on Rails 어디까지 왔나.?  (0) 2007.06.19
Toad 단축키  (0) 2007.05.30