Are your components implementing IFormComponent I wonder? Don't remember
anything specific, but they might get their inner components ignored if not?
No idea...

On 3/7/06, Ryan Holmes <[EMAIL PROTECTED]> wrote:
>
> Hmmm... I'm not sure why this isn't working for you. FWIW, I can tell
> you that it *should* work.
>
> Maybe it will help if I relate a trimmed-down verion of a component from
> one of my projects that uses a form.
>
> ExampleFormComponent.jwc:
> <table border="0" cellpadding="3" cellspacing="0">
>     <tr valign="middle">
>         <td><form jwcid="pageSizeForm" style="margin: 0px;">
>             <select jwcid="pageSizeField">
>                 <option>10</option>
>                 <option>20</option>
>                 <option>30</option>
>             </select></form>
>         </td>
>     </tr>
> </table>
>
> ExampleFormComponent.jwc:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE component-specification PUBLIC
>     "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
>     "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";>
>
> <component-specification allow-body="no"
>     allow-informal-parameters="yes">
>
>     <component id="pageSizeField" type="PropertySelection">
>         <binding name="value" value="pageSize" />
>         <binding name="model" value="pageSizeModel" />
>     </component>
>
>     <component id="pageSizeForm" type="Form">
>         <binding name="listener" value="listener:formSubmit" />
>         <binding name="focus" value="false" />
>     </component>
>
> </component-specification>
>
>
> ExampleFormComponent.java:
> public abstract class ExampleFormComponent extends BaseComponent {
>
>   /** List of possible page sizes. */
>   private static final Integer[] PAGE_SIZES= { 10, 20, 30, 40, 50, 100,
> 200 };
>
>   private IPropertySelectionModel pageSizeModel = new
> PageSizeSelectionModel(
>       PAGE_SIZES );
>
>
>   /**
>    * Gets the current page size.
>    *
>    * @return page size
>    */
>   @Persist
>   public abstract Integer getPageSize();
>
>   /**
>    * Sets the current page size.
>    *
>    * @param pageSize
>    *          integer length of page table
>    */
>   public abstract void setPageSize(Integer pageSize);
>
>   /**
>    * Gets the page size selection model.
>    *
>    * @return page size selection model
>    */
>   public IPropertySelectionModel getPageSizeModel() {
>     return this.pageSizeModel;
>   }
>
>   /** Handle the page size form submission. */
>   public void formSubmit() {
>     // Page size property is set by Tapestry.
>   }
>
> }
>
> I cut out most of the guts from the real component (a custom version of
> contrib:Table), but hopefully there's enough left to demonstrate basic
> usage of a component with a form. It looks like I don't really need the
> formSubmit() listener but I've left it in to show you what's working for
> me. Hope this helps.
>
> -Ryan
>
>
> Leo Sakhvoruk wrote:
>
> > The form is nested simply in the sense that it's inside of a component
> > and not in the main page. It is not however nested inside another
> > form. The reason I believe the rewind isn't happening is because the
> > rewindFormComponent(IMarkupWriter, IRequestCycle) method of components
> > inside the form is never called during a trace and the values that are
> > changed before the form submition are not updated.
> >
> > Ryan Holmes wrote:
> >
> >> Why do you think the rewind isn't happening and why did you refer to
> >> the forms as "nested"? I use components with their own forms and
> >> haven't had any problems, so I'm guessing that your page structure is
> >> somehow unusual (or at least different from mine). Is their any
> >> chance you actually have a form within another form (i.e. a literally
> >> nested form in your HTML)?
> >>
> >> -Ryan
> >>
> >> Leo Sakhvoruk wrote:
> >>
> >>> Hi everyone,
> >>>
> >>> I have a page with several components each containing a form. Now
> >>> when the data inside the form is modified, say via TextField, it's
> >>> never updated because the form inside the component is never
> >>> rewound. I've tried to get a hold of the form component using the
> >>> getComponents() method but when I try casting the values I get class
> >>> cast exceptions since the classes are enhanced. Any clues as to what
> >>> I can to here?
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to