Fwd: PHP-Ext non-async. regular form submit

14 views
Skip to first unread message

Sergei Walter Guerra

unread,
Apr 15, 2008, 5:21:11 PM4/15/08
to php...@googlegroups.com
I'm submitting a question sent to my mail that I think could be useful for many people.



Great, thats the point actually of my request. I'll forward this to the group then.

On Tue, Apr 15, 2008 at 11:49 AM, Jason Head  wrote:
Posting things in the discussion group would be fine - If it's OK with
you I can post future questions there for others to learn from (with
that particular feature not being released yet and all)

On Tue, Apr 15, 2008 at 1:31 PM, Sergei Walter Guerra  wrote:
> I tryed this and it worked.
>
> $f = new PhpExt_Form_FormPanel("myform","action.php");
> $f->setFrame(true)
>          ->setLabelAlign(PhpExt_Form_FormPanel::LABEL_ALIGN_LEFT)
>          ->setTitle("Company Data")
>           ->setBodyStyle("padding: 5px;")
>          // Apply standardSubmit
>          ->setStandardSubmit(true)
>          ->setWidth(300);
> $f->addItem(PhpExt_Form_TextField::createTextField("company","Name"));
>  $f->addItem(PhpExt_Form_TextField::createTextField("price","Price"));
> $f->addButton(PhpExt_Button::createTextButton("Save",
>     new PhpExt_Handler(
>         // Set the form's action to the corresponding URL
>          PhpExt_Javascript::stm('f.getForm().getEl().dom.action =
> "action.php"'),
>         // Call for submit on the underlying BasicForm object, it should do
> normal submit if standardSubmit == true
>          PhpExt_Javascript::stm('f.getForm().submit()')
>         )
>     ));
> // Note that " f " is the name of the js object, if changed you should
> update the handler statements too.
> $f->getJavascript(false, "f");
>
> Hope this helps.  On more thing, can I forward this to the Discussion Group?
>
>
>
>
> On Mon, Apr 14, 2008 at 7:06 PM, Jason Head wrote:
>
> > Thanks much; I did port over my form to the latest version (using the
> > FormPanel file you sent), and set the setStandardSubmit to true.
> >
> > But I have a problem you might know what I'm doing wrong.
> >
> > The line "$submitBtn = PhpExt_Button::createTextButton("Submit", new
> >
> PhpExt_Handler(PhpExt_Javascript::stm("simple.getForm().submit({url:'./signUp.php',
> > waitMsg:'Saving Data...'})"))); " doesn't seem to be working.
> > My inclination is that I'm not using the right code after PhpExt_Handler.
> > (I'm basically trying to work off of the examples until I fully
> > understand what is going on)
> >
> > My goal is to have the same behavior as this ext-js example:
> > http://ncssa.info/example/dynamic4.php where the page go to the new page.
> >
> > Thanks again for your help, .
> > I look forward to using this library more extensively in future projects,
> >
> > Jason Head
> >
> > On Mon, Apr 14, 2008 at 12:38 PM, Sergei Walter Guerra
> >
> >
> >
> > Sergei wrote:
> > > Hello, I-m writing you to informyou there is a new version now
> available,
> > > but... it does not include the property you needed, I totally forgot
> about
> > > it.   But I'm sending you the FormPanel.php file with the property
> included
> > > so you can fix the problem until the first patch its released.  I hope
> this
> > > helps you.  It will be great to take a look at the screenshots of your
> app
> > > running and some of the code you used if it is possible.
> > >
> > > Visit the site http://php-ext.quimera-solutions.com to download the
> latest
> > > version.  I seriously recommend you take a look at the changelog and the
> > > samples to see the new syntax.
> > >
> > > Regards
> > >
> > >
> > >
> > >
> > > On Sat, Apr 12, 2008 at 5:26 PM, Jason Head  wrote:
> > > > Just to let you know - I don't need any ideas for a temp solution.  I
> > > > found I can still access the form by an external submit button and use
> > > > JS attributes to set what I need.
> > > >
> > > > I'll just do that until the next version becomes available.
> > > >
> > > >
> > > >
> > > >
> > > > On Sat, Apr 12, 2008 at 11:38 AM, Jason Head
> wrote:
> > > > > Thanks for the reply, and I did take a look at the Google group.
> > > > >
> > > > >  Can you think of a hack that could be used to integrate that code
> in
> > > > >  the mean time for testing until the new version comes out? Perhaps
> > > > >  some sort of direct PHP echo of Ext JS? I am more or less familiar
> > > > >  with Javascript.
> > > > >
> > > > >  I am actively integrating PHP-Ext in a poll worker training sign-up
> > > > >  application for the primary in my county, for the college I work
> for
> > > > >  (I can send you screen shots after if you are interested in
> > > > >  seeing/documenting its use).
> > > > >
> > > > >
> > > > >
> > > > >  On Fri, Apr 11, 2008 at 9:41 PM, Sergei Walter Guerra
> > > wrote:
> > > > >  > According to ExtJS, there is a config property "standardSubmit"
> for
> > > the
> > > > >  > BasicForm object or the FormPanel.  This is not implemented in
> the
> > > current
> > > > >  > version but it is on the new release 0.8.2 that will hopefully be
> > > ready for
> > > > >  > next week.  Quoting ExtJS documentation "If set to true, standard
> > > HTML form
> > > > >  > submits are used instead of XHR (Ajax) style form submissions.
> > > (defaults to
> > > > >  > false)". I guess this is exactly what you need, sorry it is not
> in
> > > the first
> > > > >  > version.
> > > > >  > I'll make sure this property is included in the next release.
> > > > >  >
> > > > >  > You can suscribe to the discussion group at
> > > > >  > http://groups.google.com/group/php-ext, and soon there will be a
> feed
> > > also
> > > > >  > for news and announcements.  Keep comming to the site for updates
> and
> > > news.
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  > On Fri, Apr 11, 2008 at 7:12 PM, Sergei Walter Guerra
> > >
> > > > >  > wrote:
> > > > >  > > Let me look into it and I'll write you back.  Just as a first
> > > thought,
> > > > >  > have tried adding a button to the form with button type submit,
> my
> > > that'll
> > > > >  > work.
> > > > >  > >
> > > > >  > > Sergei
> > > > >  > >
> > > > >  > >
> > > > >  > >
> > > > >  > >
> > > > >  > >
> > > > >  > > On Fri, Apr 11, 2008 at 6:42 PM, Jason Head
> > > wrote:
> > > > >  > >
> > > > >  > > > I have been looking through things for a while and I am
> stumped
> > > on how
> > > > >  > > > to submit a form with PHP-Ext in a non-async. AJAX way.
> > > > >  > > >
> > > > >  > > > That is how would I submit a form that points to another
> page,
> > > loading
> > > > >  > > > the action page after submission (I can't find a way to
> submit
> > > the
> > > > >  > > > form in that manner); in the way a plain html form would
> normally
> > > > >  > > > work.
> > > > >  > > >
> > > > >  > > > I like the appearance of the form with PHP-Ext / Ext-JS, and
> I
> > > like
> > > > >  > > > the approach of PHP-Ext using PHP, but I don't really want to
> > > re-write
> > > > >  > > > the application with async. methods at this time.
> > > > >  > > >
> > > > >  > > > What do I need to do, to submit forms in that way?
> > > > >  > > >
> > > > >  > > > Thanks much,
> > > > >  > > > Jason Head
> > > > >  > > >
> > > > >  > >
> > > > >  > >
> > > > >  > >



--
Sergei Walter
ser...@gmail.com
Reply all
Reply to author
Forward
0 new messages