Polymer2铁窗体生成随机的ajax请求URL

时间:2018-10-11 12:34:37

标签: ajax paper-elements polymer-2.0 iron-form

尝试从铁表单进行ajax调用。聚合物版本2,纸张输入^ 2.0.3,纸张按钮^ 2.0.0和铁皮^ 2.0.1。

我的网址应为[http://localhost:8080/profile/[[portal_name]]/[[portal_version]]/[[operation_name]]?number= [number]

但是我得到这个URL: http://localhost:8080/profile/[[portal_name]]/[[portal_version]]/[[operation_name]]?number=[[number]]&prefix=undefined&label=undefined&input=undefined&suffix=undefined&add-on=undefined

我不知道这个额外的前缀,标签,输入,后缀和附件的附加位置。

这是我的代码:

<iron-form id="searchform" on-iron-form-response="_handlePositiveResponse" on-iron-form-error="_handleNegativeResponse">
    <form method="get" id="innerSearchForm">
        <paper-input label="Portal Name" value="{{portal_name}}"></paper-input>
        <paper-input label="Portal Version" value="{{portal_version}}"></paper-input>
        <paper-input label="Operation Name" value="{{operation_name}}"></paper-input>
        <paper-button raised on-click="_submitform">Submit</paper-button>
    </form>
    </iron-form>

 _submitform(event) {

        //1. make an ajax request
        console.log("form submitted", event);
        console.log(this);
        //2. show the response in another page-- use routing
        this.shadowRoot.querySelector('#innerSearchForm').action = "http://localhost:8080/profile/[[portal_name]]/[[portal_version]]/[[operation_name]]?number=[[number]]";
        this.shadowRoot.querySelector('#searchform').submit();

    }

有人可以建议吗?

0 个答案:

没有答案