flex错误1137:参数数量不正确。预计不超过0

时间:2013-06-25 15:08:05

标签: database flex search flash-builder

我正在尝试在Flash Builder中创建移动应用。我想使用文本字段来搜索列表但我在函数list_creation完成处理程序中不断收到此错误

编辑: 我正在使用wamp php服务器检索我的程序中的数据,然后查看它们,因为当我创建链接我的数据库时,列表wordsService2类是自动生成的。

  

错误1137:参数数量不正确。预计不超过0。

这是程序的样子: enter image description here

<s:View>
<fx:Script>
<![CDATA[
    import mx.events.FlexEvent;

    protected function list_creationCompleteHandler():void
    {
        getAllWordsResult.token = wordsService2.getAllWords(txt.text); 
    }

]]>
</fx:Script>

<fx:Declarations>
    <s:CallResponder id="getAllWordsResult"/>
    <wordsservice2:WordsService2 id="wordsService2"/>
</fx:Declarations>

<s:actionContent>
    <s:Button label="Search" click="list_creationCompleteHandler()"/>
</s:actionContent>

<s:navigationContent>
    <s:TextInput id="txt" width="242"/>
</s:navigationContent>

<s:List id="list" width="100%" height="100%"
         labelField="term">
    <s:AsyncListView list="{getAllWordsResult.lastResult}"/>
</s:List>
</s:View>

getallwords

public function getAllWords() {

    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");        
    $this->throwExceptionOnError();

    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();

    $rows = array();

    mysqli_stmt_bind_result($stmt, $row->id, $row->term, $row->defin, $row->term1, $row->defin1);

    while (mysqli_stmt_fetch($stmt)) {
      $rows[] = $row;
      $row = new stdClass();
      mysqli_stmt_bind_result($stmt, $row->id, $row->term, $row->defin, $row->term1, $row->defin1);
    }

    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);

    return $rows;
}

1 个答案:

答案 0 :(得分:0)

WordsService2.getAllWords()不接受任何参数。你用字符串调用它; textinput的内容。这就是你得到错误1173的原因。