You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2014/12/02 18:57:39 UTC
Re: [5.4-beta-22] Adding forms to a form using ajax
Anyone please ?
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Sun, Nov 30, 2014 at 11:43 PM, Muhammad Gelbana <m....@gmail.com>
wrote:
> Wrong subject. It should've been "Adding *fields* to a form using ajax"
>
> *---------------------*
> *Muhammad Gelbana*
> http://www.linkedin.com/in/mgelbana
>
> On Sun, Nov 30, 2014 at 11:42 PM, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
>> From this jira issue <https://issues.apache.org/jira/browse/TAP5-1084>,
>> I understand that I can have a zone inside a form and this zone can by
>> updated later on using ajax to display extra fields in the form.
>>
>> But now I'm facing this error message when I attempt doing that
>>
>> *Render queue error in
>> SetupRender[ipkpage/configure/Test:textfield_2]: Component
>> ipkpage/configure/Test:textfield_2 must be enclosed by a Form component*
>>
>> I looked into the form components and tried to use the FormInjector
>> component but then I was faced with this error message:
>>
>> *Render queue error in
>> BeginRender[ixchariot/configure/Test:forminjector]:
>> ClientBehaviorSupport.addFormInjector is not longer supported. A
>> replacement is forthcoming.*
>>
>> ..like I even knew how to use it! There was no enough examples\samples
>> for its usage.
>>
>> So is there a way to add\inject new forms to an existing form using ajax ?
>> The *AjaxFormLoop*\*FormFragment* component doesn't seem to fit my
>> scenario I'm trying to implement.
>>
>> Thanks.
>> *---------------------*
>> *Muhammad Gelbana*
>> http://www.linkedin.com/in/mgelbana
>>
>
>
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by akshay <ak...@gmail.com>.
Hi,
Why don't you try something like this. May not to be the best way but
should work fine. Juts try removing the extra zone that you try to render
from your form and do like below:-
x.tml
<t:form t:async="true"(if tapestry 5.4 or else wrap around a zone)>
input fields
<t:select />
<t:submit t:id="filter">
<t:if test="flag">
other input fields based on the select field
<t:submit t:id="save">
</t:if>
</t:form>
x.java
@Property
@Persist
private boolean flag;
void onSelectedFromFilter(){
flag=true;
your logic
}
void onSelectedFromSave(){
proceed with your logic
and if you want to hide the extra part just make the flag as false
}.
This way you are avoiding the extra zone rendering, whereas your current
form is still ajax.
Best Regards
Akshay
On Sun, Dec 14, 2014 at 10:22 AM, Muhammad Gelbana <m....@gmail.com>
wrote:
>
> The ajax-form-loop does it but it doesn't fit my scenario. I need to
> display portions of the form based on a Select component changed value. And
> even if I try to do it using the Select component change event, I don't
> need to add rows. I just need to update a zone with different form fields.
> I even sometimes need to do it using an Event\Action link. Its nothing no
> one else tried to do !
>
> I appreciate your time. Thank you.
>
> *---------------------*
> *Muhammad Gelbana*
> http://www.linkedin.com/in/mgelbana
>
> On Sat, Dec 13, 2014 at 11:45 AM, Diego Socaceti <so...@gmail.com>
> wrote:
>
> > Hi,
> >
> > have to tried to use the AjaxFormLoop
> >
> >
> http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/AjaxFormLoop.html
> >
> > I just found it in the API docs.
> > Unfortunately there are no 5.4 jumpstart examples, but i think you can
> > adapt the one from 5.3
> >
> > http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1
> >
> >
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloopwithholders1
> >
> >
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formlooptailored1
> >
> >
> > Kind regards
> >
>
--
Cheers!!
Akshay
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Geoff Callender <ge...@gmail.com>.
On 18 Dec 2014, at 11:02 pm, Thiago H de Paula Figueiredo <th...@gmail.com> wrote:
> On Thu, 18 Dec 2014 01:21:03 -0200, Geoff Callender <ge...@gmail.com> wrote:
>
>> The starting point of the problem is that Form has a copy of its rendered state in a hidden field, and it depends on Form knowing what it rendered.
>
> I'm afraid you got this wrong, Geoff. Tapestry never stores the rendering of anything like JSF does, for example. Form does store information inside the t:formdata hidden field, but it's not the rendered state. Instead, it's instances of ComponentAction created by the form field component instances in order to process the form submission when it happens.
I should have known that. Thanks Thiago!
Experimenting with a project today, I've also learned that each FormFragment also has a formdata field, and its value changes depending on its "visible" parameter. Makes sense, since that parameter affects its actions.
Thiago, what I now don't understand is why is a Form's formdata different every time it is rendered? A FormFragment's formdata is the same every time, but a Form's formdata is not. Is that something to do with the hmac protection?
>
>> If you put a Zone inside a Form and you refresh the Zone, and the Zone contains input fields (any descendant of Field) then you will usually get an Exception. It's usually a misleading message (something about Form inside a Form IIIRC), but the reason it cannot be allowed is that you're not also refreshing Form's hidden state field.
>
> I believe this part is 100% correct.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Muhammad Gelbana <m....@gmail.com>.
Thank you all for the details. About the FormInjector
<http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/FormInjector.html>,
would someone please provide an explanation to this component ? I search
for examples but I couldn't find any clear ones. It says that it gives the
ability to inject fields in a Form component !
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Thu, Dec 18, 2014 at 2:02 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
>
> On Thu, 18 Dec 2014 01:21:03 -0200, Geoff Callender <
> geoff.callender.jumpstart@gmail.com> wrote:
>
> The starting point of the problem is that Form has a copy of its rendered
>> state in a hidden field, and it depends on Form knowing what it rendered.
>>
>
> I'm afraid you got this wrong, Geoff. Tapestry never stores the rendering
> of anything like JSF does, for example. Form does store information inside
> the t:formdata hidden field, but it's not the rendered state. Instead, it's
> instances of ComponentAction created by the form field component instances
> in order to process the form submission when it happens.
>
> If you put a Zone inside a Form and you refresh the Zone, and the Zone
>> contains input fields (any descendant of Field) then you will usually get
>> an Exception. It's usually a misleading message (something about Form
>> inside a Form IIIRC), but the reason it cannot be allowed is that you're
>> not also refreshing Form's hidden state field.
>>
>
> I believe this part is 100% correct.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 18 Dec 2014 01:21:03 -0200, Geoff Callender
<ge...@gmail.com> wrote:
> The starting point of the problem is that Form has a copy of its
> rendered state in a hidden field, and it depends on Form knowing what it
> rendered.
I'm afraid you got this wrong, Geoff. Tapestry never stores the rendering
of anything like JSF does, for example. Form does store information inside
the t:formdata hidden field, but it's not the rendered state. Instead,
it's instances of ComponentAction created by the form field component
instances in order to process the form submission when it happens.
> If you put a Zone inside a Form and you refresh the Zone, and the Zone
> contains input fields (any descendant of Field) then you will usually
> get an Exception. It's usually a misleading message (something about
> Form inside a Form IIIRC), but the reason it cannot be allowed is that
> you're not also refreshing Form's hidden state field.
I believe this part is 100% correct.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Geoff Callender <ge...@gmail.com>.
I'm late to this thread, but I don't see an explanation of **why** Muhammad can't add fields to the existing Form, so I'll try. Please correct me if I'm wrong.
The starting point of the problem is that Form has a copy of its rendered state in a hidden field, and it depends on Form knowing what it rendered. If you put a Zone inside a Form and you refresh the Zone, and the Zone contains input fields (any descendant of Field) then you will usually get an Exception. It's usually a misleading message (something about Form inside a Form IIIRC), but the reason it cannot be allowed is that you're not also refreshing Form's hidden state field.
Without FormInjector, the solution, as Thiago has said, is to always submit the whole Form, typically with mode="UNCONDITIONAL" so that no automatic validation is done, and return the whole Form. It can be in a Zone or in a whole page refresh - that's up to you. The important thing is that all of the fields that were rendered get sent to the server, they match with the hidden formstate, and the response includes a new formstate that matches the newly rendered Form.
BTW, has FormInjector been reinstated? In the 5.4 api docs I can't see anything that says it's being removed.
HTH,
Geoff
On 18 Dec 2014, at 6:28 am, Muhammad Gelbana <m....@gmail.com> wrote:
> Thanks a lot Thiago for your response. As much as it answers my question,
> as much as it makes me sad that I couldn't do it easily using Zones.
>
> *---------------------*
> *Muhammad Gelbana*
> http://www.linkedin.com/in/mgelbana
>
> On Wed, Dec 17, 2014 at 3:18 PM, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>>
>> On Wed, 17 Dec 2014 05:10:53 -0200, Muhammad Gelbana <m....@gmail.com>
>> wrote:
>>
>> Yea I get. But I won't be able to fill these fields with their default
>>> values from the server side.
>>>
>>
>> The user won't see them, so what's the problem? :) Just submit the whole
>> form when the Select value changes, so you don't lose the field values, but
>> with something that tells the server-side the form isn't ready for updating
>> the database yet.
>>
>> The select component may have unpredictable
>>> amount of elements, each element will control what fields to be displayed
>>> and what default values should they have. This is all database driver.
>>> You solution will work but I'll have to load every possible information I
>>> need whenever the page is loaded and save it at the client's browser.
>>> But this is not tapestrish, I would've loved to do this the tapestry way.
>>> Easy and efficient :)
>>>
>>
>> In this case, if you don't think are suggestions are enough, I believe
>> you're trying to use Zone in a scenario more complex than it was designed
>> for. Zone was created for simple AJAX updates of a given portion of a page.
>> Emphasis on simple. If it doesn't cover what you need for your scenario,
>> you'll need to use something else.
>>
>> This is similar to a couple discussions we already had in this mailing
>> list about components such as Grid and BeanEditForm. As Howard once said,
>> BeanEditForm, BeanEditor, and Grid (I'd add Zone here) are meant to be used
>> to get something working quickly, not to be the solution of all scenarios.
>> If you have a too specific scenario, you'll need to write too specific code
>> for it.
>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Muhammad Gelbana <m....@gmail.com>.
Thanks a lot Thiago for your response. As much as it answers my question,
as much as it makes me sad that I couldn't do it easily using Zones.
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Wed, Dec 17, 2014 at 3:18 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
>
> On Wed, 17 Dec 2014 05:10:53 -0200, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
> Yea I get. But I won't be able to fill these fields with their default
>> values from the server side.
>>
>
> The user won't see them, so what's the problem? :) Just submit the whole
> form when the Select value changes, so you don't lose the field values, but
> with something that tells the server-side the form isn't ready for updating
> the database yet.
>
> The select component may have unpredictable
>> amount of elements, each element will control what fields to be displayed
>> and what default values should they have. This is all database driver.
>> You solution will work but I'll have to load every possible information I
>> need whenever the page is loaded and save it at the client's browser.
>> But this is not tapestrish, I would've loved to do this the tapestry way.
>> Easy and efficient :)
>>
>
> In this case, if you don't think are suggestions are enough, I believe
> you're trying to use Zone in a scenario more complex than it was designed
> for. Zone was created for simple AJAX updates of a given portion of a page.
> Emphasis on simple. If it doesn't cover what you need for your scenario,
> you'll need to use something else.
>
> This is similar to a couple discussions we already had in this mailing
> list about components such as Grid and BeanEditForm. As Howard once said,
> BeanEditForm, BeanEditor, and Grid (I'd add Zone here) are meant to be used
> to get something working quickly, not to be the solution of all scenarios.
> If you have a too specific scenario, you'll need to write too specific code
> for it.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 17 Dec 2014 05:10:53 -0200, Muhammad Gelbana <m....@gmail.com>
wrote:
> Yea I get. But I won't be able to fill these fields with their default
> values from the server side.
The user won't see them, so what's the problem? :) Just submit the whole
form when the Select value changes, so you don't lose the field values,
but with something that tells the server-side the form isn't ready for
updating the database yet.
> The select component may have unpredictable
> amount of elements, each element will control what fields to be displayed
> and what default values should they have. This is all database driver.
> You solution will work but I'll have to load every possible information
> I need whenever the page is loaded and save it at the client's browser.
> But this is not tapestrish, I would've loved to do this the tapestry way.
> Easy and efficient :)
In this case, if you don't think are suggestions are enough, I believe
you're trying to use Zone in a scenario more complex than it was designed
for. Zone was created for simple AJAX updates of a given portion of a
page. Emphasis on simple. If it doesn't cover what you need for your
scenario, you'll need to use something else.
This is similar to a couple discussions we already had in this mailing
list about components such as Grid and BeanEditForm. As Howard once said,
BeanEditForm, BeanEditor, and Grid (I'd add Zone here) are meant to be
used to get something working quickly, not to be the solution of all
scenarios. If you have a too specific scenario, you'll need to write too
specific code for it.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Muhammad Gelbana <m....@gmail.com>.
Yea I get. But I won't be able to fill these fields with their default
values from the server side. The select component may have unpredictable
amount of elements, each element will control what fields to be displayed
and what default values should they have. This is all database driver. You
solution will work but I'll have to load every possible information I need
whenever the page is loaded and save it at the client's browser.
But this is not tapestrish, I would've loved to do this the tapestry way.
Easy and efficient :)
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Tue, Dec 16, 2014 at 6:43 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
>
> On Tue, 16 Dec 2014 13:48:50 -0200, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
> @Thiago, do you mean I should do that using ajax on the client side ?
>>
>
> No. :) Maybe some JS, but not AJAX.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 16 Dec 2014 13:48:50 -0200, Muhammad Gelbana <m....@gmail.com>
wrote:
> @Thiago, do you mean I should do that using ajax on the client side ?
No. :) Maybe some JS, but not AJAX.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Muhammad Gelbana <m....@gmail.com>.
@Thiago, do you mean I should do that using ajax on the client side ?
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Tue, Dec 16, 2014 at 3:27 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
>
> On Sun, 14 Dec 2014 18:08:33 -0200, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
> @Thiago
>> I need the server to populate these fields with default values. Also
>> the fields will be unexpected until runtime because the selected element in
>> the Select component is essential to decide which fields to display. These
>> fields are even database driven so the displayed fields cannot be known
>> until the Select component is changed.
>>
>
> The suggestion I've done to you covers your requirements. When a given
> field is not shown at first, leave its value to null.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sun, 14 Dec 2014 18:08:33 -0200, Muhammad Gelbana <m....@gmail.com>
wrote:
> @Thiago
> I need the server to populate these fields with default values. Also
> the fields will be unexpected until runtime because the selected element
> in the Select component is essential to decide which fields to display.
> These
> fields are even database driven so the displayed fields cannot be known
> until the Select component is changed.
The suggestion I've done to you covers your requirements. When a given
field is not shown at first, leave its value to null.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Muhammad Gelbana <m....@gmail.com>.
@Akshay
I understand now. But then I'll have to submit the whole form to (without
validating it) to keep the user input data.
I though there was a more efficient and intuitive method in tapestry. I
like to use tapestry in the best possible way.
Thank you for your time.
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Mon, Dec 15, 2014 at 3:04 AM, Akshay <ak...@gmail.com> wrote:
>
> Hi Muhammad,
>
> That's what I try to explain in my example, that instead of making the
> fields driven by select component Ajax, one can use a single form to show
> or hide them, when the select compinent is changed. I tried using if in my
> example, may be if u have multiple fields or logic , you can use a block
> and delegate to them accordingly , keeping eveything in the same single
> form.
>
>
> Regards
> Akshay
>
> -----Original Message-----
> From: "Muhammad Gelbana" <m....@gmail.com>
> Sent: 14-12-2014 21:09
> To: "Tapestry users" <us...@tapestry.apache.org>
> Subject: Re: [5.4-beta-22] Adding forms to a form using ajax
>
> @Thiago
> I need the server to populate these fields with default values. Also the
> fields will be unexpected until runtime because the selected element in the
> Select component is essential to decide which fields to display. These
> fields are even database driven so the displayed fields cannot be known
> until the Select component is changed.
>
> I really think this is a very reasonable\common requirement.
>
> @Akshay
> May be my question wasn't clear enough. I can do ajax forms, but I'm trying
> to add fields to the form using ajax.
>
> *---------------------*
> *Muhammad Gelbana*
> http://www.linkedin.com/in/mgelbana
>
> On Sun, Dec 14, 2014 at 9:09 PM, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
> >
> > On Sun, 14 Dec 2014 07:22:00 -0200, Muhammad Gelbana <
> m.gelbana@gmail.com>
> > wrote:
> >
> > The ajax-form-loop does it but it doesn't fit my scenario. I need to
> >> display portions of the form based on a Select component changed value.
> >> And even if I try to do it using the Select component change event, I
> >> don't
> >> need to add rows. I just need to update a zone with different form
> fields.
> >>
> >
> > Cannot you use the easy, simple way of having the whole form, with all
> > fields rendered and showing or hiding them?
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Tapestry, Java and Hibernate consultant and developer
> > http://machina.com.br
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
RE: [5.4-beta-22] Adding forms to a form using ajax
Posted by Akshay <ak...@gmail.com>.
Hi Muhammad,
That's what I try to explain in my example, that instead of making the fields driven by select component Ajax, one can use a single form to show or hide them, when the select compinent is changed. I tried using if in my example, may be if u have multiple fields or logic , you can use a block and delegate to them accordingly , keeping eveything in the same single form.
Regards
Akshay
-----Original Message-----
From: "Muhammad Gelbana" <m....@gmail.com>
Sent: 14-12-2014 21:09
To: "Tapestry users" <us...@tapestry.apache.org>
Subject: Re: [5.4-beta-22] Adding forms to a form using ajax
@Thiago
I need the server to populate these fields with default values. Also the
fields will be unexpected until runtime because the selected element in the
Select component is essential to decide which fields to display. These
fields are even database driven so the displayed fields cannot be known
until the Select component is changed.
I really think this is a very reasonable\common requirement.
@Akshay
May be my question wasn't clear enough. I can do ajax forms, but I'm trying
to add fields to the form using ajax.
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Sun, Dec 14, 2014 at 9:09 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
>
> On Sun, 14 Dec 2014 07:22:00 -0200, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
> The ajax-form-loop does it but it doesn't fit my scenario. I need to
>> display portions of the form based on a Select component changed value.
>> And even if I try to do it using the Select component change event, I
>> don't
>> need to add rows. I just need to update a zone with different form fields.
>>
>
> Cannot you use the easy, simple way of having the whole form, with all
> fields rendered and showing or hiding them?
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Muhammad Gelbana <m....@gmail.com>.
@Thiago
I need the server to populate these fields with default values. Also the
fields will be unexpected until runtime because the selected element in the
Select component is essential to decide which fields to display. These
fields are even database driven so the displayed fields cannot be known
until the Select component is changed.
I really think this is a very reasonable\common requirement.
@Akshay
May be my question wasn't clear enough. I can do ajax forms, but I'm trying
to add fields to the form using ajax.
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Sun, Dec 14, 2014 at 9:09 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
>
> On Sun, 14 Dec 2014 07:22:00 -0200, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
> The ajax-form-loop does it but it doesn't fit my scenario. I need to
>> display portions of the form based on a Select component changed value.
>> And even if I try to do it using the Select component change event, I
>> don't
>> need to add rows. I just need to update a zone with different form fields.
>>
>
> Cannot you use the easy, simple way of having the whole form, with all
> fields rendered and showing or hiding them?
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sun, 14 Dec 2014 07:22:00 -0200, Muhammad Gelbana <m....@gmail.com>
wrote:
> The ajax-form-loop does it but it doesn't fit my scenario. I need to
> display portions of the form based on a Select component changed value.
> And even if I try to do it using the Select component change event, I
> don't
> need to add rows. I just need to update a zone with different form
> fields.
Cannot you use the easy, simple way of having the whole form, with all
fields rendered and showing or hiding them?
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Muhammad Gelbana <m....@gmail.com>.
The ajax-form-loop does it but it doesn't fit my scenario. I need to
display portions of the form based on a Select component changed value. And
even if I try to do it using the Select component change event, I don't
need to add rows. I just need to update a zone with different form fields.
I even sometimes need to do it using an Event\Action link. Its nothing no
one else tried to do !
I appreciate your time. Thank you.
*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana
On Sat, Dec 13, 2014 at 11:45 AM, Diego Socaceti <so...@gmail.com> wrote:
> Hi,
>
> have to tried to use the AjaxFormLoop
>
> http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/AjaxFormLoop.html
>
> I just found it in the API docs.
> Unfortunately there are no 5.4 jumpstart examples, but i think you can
> adapt the one from 5.3
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloopwithholders1
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formlooptailored1
>
>
> Kind regards
>
Re: [5.4-beta-22] Adding forms to a form using ajax
Posted by Diego Socaceti <so...@gmail.com>.
Hi,
have to tried to use the AjaxFormLoop
http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/AjaxFormLoop.html
I just found it in the API docs.
Unfortunately there are no 5.4 jumpstart examples, but i think you can
adapt the one from 5.3
http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1
http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloopwithholders1
http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formlooptailored1
Kind regards