You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sibleygh <ge...@bt.com> on 2011/10/05 16:22:21 UTC

Select Model - Adding entries from the form

Hi 

I'm pretty new to Tapestry. 

I have a requirement where I want to add a new entry to a Select Model, if
the entry doesn't exist. e.g. 

- Populate the select model using the onPrepare() method executing a finder
in hibernate, and present this in the page. 
- Allow the user to provide text in the drop down text box, if a new entry
is required in the model. 
- Persist the new data using a form of Tapestry 'onValueChangedFrom' action. 

I've used the select model successfully to process 'bound' lists, but I
don't seem to see any examples or documentation on how to process an
'unbound' list. 

Regards 

George

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Select-Model-Adding-entries-from-the-form-tp4872879p4872879.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: Select Model - Adding entries from the form

Posted by Muhammad Gelbana <m....@gmail.com>.
In addition to the "highlighted" links:
AJAX Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/select1>

On Thu, Oct 6, 2011 at 11:19 AM, Muhammad Gelbana <m....@gmail.com>wrote:

> I still can't see why should this be a problem :)
> By dynamically you mean using ajax ? like without reloading the whole paqe
> ?
>
> Check this page:
> http://jumpstart.doublenegative.com.au/jumpstart/
>
> Specifically these links:
> Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/select/$N/$N/$N/$N>
> Varied Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/varied/$N/$N/$N/$N>
> Easy Object Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyobject>
> Total Control Object Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/totalcontrolobject>
> Id Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/id>
> Easy Id Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyid>
>
> Please tell if you find what you need. Good luck.
>
> On Thu, Oct 6, 2011 at 9:19 AM, sibleygh <ge...@bt.com> wrote:
>
>> Thanks the reply.
>>
>> The "onValueChanged" event is triggered when the value changes in the
>> dropdown in the form. This is the standard tapestry event for select model
>> changes. That bit I understand and have working.
>>
>> My main issue here is that I want to be able to have the tml <select> text
>> field be able to accept new text entries from the form dynamically. I
>> can't
>> see how to do this? The <select> tag doesn't seem to support an unbound
>> list
>> (e.g. a list that can be added to dynamically from the browser).
>>
>> I think I just need someone to confirm that this can't be done and that
>> I'll
>> need to find another solution. I did see a circumvention on another thread
>> where they inserted a static value into the select model (e.g. "add new
>> value") and triggered the adding of the data using this. That just seems
>> so
>> clunky to me though.
>>
>> Regards
>>
>> George
>>
>> --
>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/Select-Model-Adding-entries-from-the-form-tp4872879p4875458.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
>>
>>
>
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: Select Model - Adding entries from the form

Posted by Muhammad Gelbana <m....@gmail.com>.
I still can't see why should this be a problem :)
By dynamically you mean using ajax ? like without reloading the whole paqe ?

Check this page:
http://jumpstart.doublenegative.com.au/jumpstart/

Specifically these links:
Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/select/$N/$N/$N/$N>
Varied Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/varied/$N/$N/$N/$N>
Easy Object Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyobject>
Total Control Object
Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/totalcontrolobject>
Id Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/id>
Easy Id Select<http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyid>

Please tell if you find what you need. Good luck.

On Thu, Oct 6, 2011 at 9:19 AM, sibleygh <ge...@bt.com> wrote:

> Thanks the reply.
>
> The "onValueChanged" event is triggered when the value changes in the
> dropdown in the form. This is the standard tapestry event for select model
> changes. That bit I understand and have working.
>
> My main issue here is that I want to be able to have the tml <select> text
> field be able to accept new text entries from the form dynamically. I can't
> see how to do this? The <select> tag doesn't seem to support an unbound
> list
> (e.g. a list that can be added to dynamically from the browser).
>
> I think I just need someone to confirm that this can't be done and that
> I'll
> need to find another solution. I did see a circumvention on another thread
> where they inserted a static value into the select model (e.g. "add new
> value") and triggered the adding of the data using this. That just seems so
> clunky to me though.
>
> Regards
>
> George
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Select-Model-Adding-entries-from-the-form-tp4872879p4875458.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
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: Select Model - Adding entries from the form

Posted by sibleygh <ge...@bt.com>.
Thanks the reply.

The "onValueChanged" event is triggered when the value changes in the
dropdown in the form. This is the standard tapestry event for select model
changes. That bit I understand and have working.

My main issue here is that I want to be able to have the tml <select> text
field be able to accept new text entries from the form dynamically. I can't
see how to do this? The <select> tag doesn't seem to support an unbound list
(e.g. a list that can be added to dynamically from the browser).

I think I just need someone to confirm that this can't be done and that I'll
need to find another solution. I did see a circumvention on another thread
where they inserted a static value into the select model (e.g. "add new
value") and triggered the adding of the data using this. That just seems so
clunky to me though.

Regards

George

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Select-Model-Adding-entries-from-the-form-tp4872879p4875458.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: Select Model - Adding entries from the form

Posted by Muhammad Gelbana <m....@gmail.com>.
What should fire the "onValueChanged" event you are talking about ?

Anyway here is what I think:
- You'll need to persist your list of items fed by the "onPrepare" method.
- When the form containing the text-field is submitted, obtain the new
value, do your logic and decide whether to add the new item to the persisted
list or not.
- Then "onPrepare" should do the trick on the next page load.

Did I get your question right ?

On Wed, Oct 5, 2011 at 4:22 PM, sibleygh <ge...@bt.com> wrote:

> Hi
>
> I'm pretty new to Tapestry.
>
> I have a requirement where I want to add a new entry to a Select Model, if
> the entry doesn't exist. e.g.
>
> - Populate the select model using the onPrepare() method executing a finder
> in hibernate, and present this in the page.
> - Allow the user to provide text in the drop down text box, if a new entry
> is required in the model.
> - Persist the new data using a form of Tapestry 'onValueChangedFrom'
> action.
>
> I've used the select model successfully to process 'bound' lists, but I
> don't seem to see any examples or documentation on how to process an
> 'unbound' list.
>
> Regards
>
> George
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Select-Model-Adding-entries-from-the-form-tp4872879p4872879.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
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*