You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ronaldlee <yi...@hotmail.com> on 2008/01/16 02:15:32 UTC

T5: Get user input of custom components which themselves are forms

Hi,

I created a custom component "Question", and this component simply displays
a question and textfield (or radiobox, depends on the question type) to get
user input. It doesn't have <t:form> defined inside the component's
template.

And now I need to do something like this (see below) on the page which
contains those Question components and not sure how can I can get the user
input from them:

Main.page:
...
<t:form id="mainPageForm">
  <t:loop ...>
    <t:form>
      <t:Question .../>  <!-- my Question component, it display info depends
on what the loop pass in --> 
    </t:form>
  </t:loop>

  <input t:type="submit"/>
</t:form>

So you can see, I need to surround each Question with "<t:form>" as well, it
may look redundant but I need it for a work-round of a DOJO StackContainer
issue, until I find a better solution... 

So how can I get the user input from those Question components in my page's
"onSuccess" function?

thanks!
Ronald
-- 
View this message in context: http://www.nabble.com/T5%3A-Get-user-input-of-custom-components-which-themselves-are-forms-tp14857149p14857149.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Get user input of custom components which themselves are forms

Posted by ronaldlee <yi...@hotmail.com>.
I take it back.. it doesn't store the user input, just for old display
info...

I think some how I need to access my Question component and get those things
out thru getter functions, but the problem is the form is triggered by the
page, not the component. I am able to do that if the page has only one
component, and I can use "@Component Question question" to directly access
the values..


ronaldlee wrote:
> 
> oh it seems that the data structure I use for the loop somehow able to
> store the user response, after making that list @Persist("flash")... may
> be that is good enough for me.
> 
> 
> ronaldlee wrote:
>> 
>> Hi,
>> 
>> I created a custom component "Question", and this component simply
>> displays a question and textfield (or radiobox, depends on the question
>> type) to get user input. It doesn't have <t:form> defined inside the
>> component's template.
>> 
>> And now I need to do something like this (see below) on the page which
>> contains those Question components and not sure how can I can get the
>> user input from them:
>> 
>> Main.page:
>> ...
>> <t:form id="mainPageForm">
>>   <t:loop ...>
>>     <t:form>
>>       <t:Question .../>  <!-- my Question component, it display info
>> depends on what the loop pass in --> 
>>     </t:form>
>>   </t:loop>
>> 
>>   <input t:type="submit"/>
>> </t:form>
>> 
>> So you can see, I need to surround each Question with "<t:form>" as well,
>> it may look redundant but I need it for a work-round of a DOJO
>> StackContainer issue, until I find a better solution... 
>> 
>> So how can I get the user input from those Question components in my
>> page's "onSuccess" function?
>> 
>> thanks!
>> Ronald
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-Get-user-input-of-custom-components-which-themselves-are-forms-tp14857149p14858390.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Get user input of custom components which themselves are forms

Posted by ronaldlee <yi...@hotmail.com>.
oh it seems that the data structure I use for the loop somehow able to store
the user response, after making that list @Persist("flash")... may be that
is good enough for me.


ronaldlee wrote:
> 
> Hi,
> 
> I created a custom component "Question", and this component simply
> displays a question and textfield (or radiobox, depends on the question
> type) to get user input. It doesn't have <t:form> defined inside the
> component's template.
> 
> And now I need to do something like this (see below) on the page which
> contains those Question components and not sure how can I can get the user
> input from them:
> 
> Main.page:
> ...
> <t:form id="mainPageForm">
>   <t:loop ...>
>     <t:form>
>       <t:Question .../>  <!-- my Question component, it display info
> depends on what the loop pass in --> 
>     </t:form>
>   </t:loop>
> 
>   <input t:type="submit"/>
> </t:form>
> 
> So you can see, I need to surround each Question with "<t:form>" as well,
> it may look redundant but I need it for a work-round of a DOJO
> StackContainer issue, until I find a better solution... 
> 
> So how can I get the user input from those Question components in my
> page's "onSuccess" function?
> 
> thanks!
> Ronald
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-Get-user-input-of-custom-components-which-themselves-are-forms-tp14857149p14857708.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org