[html-formfu] HTML::FormFu::ExtJS v 0.05 and standardSubmit

Moritz Onken onken at houseofdesign.de
Fri Oct 3 10:02:45 BST 2008


>>
> Yep. Perfect.
>
> And yet, it submits to the url I used to get to my logon page, not to
> the url in my config file. Why is that?
>
> Config:
>
> ---
> action: /contacts/person/prepare
> auto_fieldset: 1
> auto_id: %n
> indicator: submit
>
> elements:
>  - type: Text
>    name: username
>    label: Username
>    attrs:
>      width: 30em
>    constraints:
>      - Required
>
>  - type: Password
>    name: password
>    label: Password
>    attrs:
>      width: 30em
>    constraints:
>      - Required
>
>  - type: Button
>    name: submit
>    default: Submit
>    attrs:
>      handler: function(){simple.getForm().submit()}
>
> constraints:
>  - SingleValue
>
> Output:
>
> Ext.onReady(function(){
> Ext.BLANK_IMAGE_URL = '/ext-2.2/resources/images/default/s.gif';
> var simple = new Ext.FormPanel({"standardSubmit":true,"url":"/ 
> contacts/person/prepare","items":[{"title":null,"autoHeight": 
> 1,"xtype":"fieldset","items": 
> [{"width":"30em","hideLabel":false,"name":"username","id":null,"fieldLabel":"Username","xtype":"textfield"},{"width":"30em","hideLabel":false,"name":"password","inputType":"password","fieldLabel":"Password","id":null,"xtype":"textfield"}]}],"buttons":[{"handler":function(){simple.getForm().submit()},"text":"Submit","name":"submit","id":null}]});
> simple.render("content");
> });

Yes you're right. You need to set url to /contacts/person/prepare
(see BasicForm docs from ExtJS).
FormFu::ExtJS does this not from the config file, yet.

try:

$form->render(standardSubmit => \1, url => '/contacts/person/prepare')

That should do it. If this doesn't work, go with the example you posted
and set "simple.getForm().getEl().dom.action = '/contacts/person/ 
prepare';" in
the submit handler.


cheers,

moritz



More information about the HTML-FormFu mailing list