Re: Updating a size 20 map with On Change event of 20 select components

2012-07-25 Thread Russell John-Baptiste
Thanks Carsten and Jonathan, I really appreciate the input...

As usual, I made this harder than it needed to be. I have a business 
requirement to fufill which is why I had to do it this way.

I got it working...

In my page class I have:

 public  User getGroupUser(){
       return groupMap.get(group);
    }
    public void setGroupUser(User user){
     groupMap.put(group, user);
    }

Group gets unwound in the loop.

When you are displaying the data form tapestry loops through all the values 
updating each select component with the value of each coresponding group.

When u submit the form it does the same thing via setGroupUser in reverse.

TML for anyone who cares:

http://tapestry.apache.org/schema/tapestry_5_3.xsd";>
    

        Edit User

        

            
           

              
               
               Group 
                 
                   
                    
                    ${group.groupName} 
                     
                   
           

            
                
         
            

        



Thanks again!
-Russell



 From: Jonathan Barker 
To: Tapestry users ; carsten.kl...@axn-software.de 
Sent: Tuesday, July 24, 2012 10:43 AM
Subject: Re: Updating a size 20 map with On Change event of 20 select components
 
Actually, the built-in select component will handle option groups, but
you need to provide a custom SelectModel.

On Mon, Jul 23, 2012 at 3:13 PM, Carsten Klein
 wrote:
> This should have gone to the mailing list so I will repost it here:
>
>
> Hi Russell,
>
> see http://tapestry.apache.org/using-select-with-a-list.html for a
> thorough explanation on how to do this.
>
> The problem I see in your approach is that you a an arbitrary number of
> select components having the same name. Perhaps you should try and make
> this a single component instead, where the group names are used for
> grouping individual options, namely the users that belong to that group.
>
> E.g.
>
>    Morgue Accessoires Sales Dep
>       John Doe
>       Frank Stein
>    Liquor Sales Dep
>       George Doubleu
>       John Wayne
>
> This is also supported by the HTML select element, using option groups.
>
> And, considering that this will render a single select element instead of
> twenty, this will increase overall useability a lot.
>
> The standard select component does not support this, but you can always
> extend upon that behaviour and implement your own custom component.
>
> Cheers
> -- Carsten
>
>> I am trying to wrap my head around how to do this in tapestry.
>>
>> I have a form with 20 select components that are created with the loop
>> component.
>>
>> Given a Map groupMap...
>>
>> Each select component's value (user) is a value in the map.
>>
>> Each label (group) for each select is the key of the map
>>
>> when a select components value has been changed, I want to update the map
>> with it value.
>>
>> I understand that if this was just one select component I could just say
>> something like OnChangeFromSelectID or a zone.
>>
>> But I'm trying to understand how to do this with 20 select components:
>>
>> TML:
>> 
>>
>>   
>>    
>>      Group
>>        
>>          
>>           
>>             ${group.groupName}
>>             > value="GroupUser"  />
>>           
>> 
>>
>> PAGE CLASS?:
>>     public Object onGroupNameChange(User user)
>>     {
>>       groupMap.put(group, recipient);
>>     }
>>
>>
>> I'm still new but i'm starting to get the hang of T5...
>> Thanks!
>> -Russell
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>



-- 
Jonathan Barker
ITStrategic

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

Re: Updating a size 20 map with On Change event of 20 select components

2012-07-24 Thread Jonathan Barker
Actually, the built-in select component will handle option groups, but
you need to provide a custom SelectModel.

On Mon, Jul 23, 2012 at 3:13 PM, Carsten Klein
 wrote:
> This should have gone to the mailing list so I will repost it here:
>
>
> Hi Russell,
>
> see http://tapestry.apache.org/using-select-with-a-list.html for a
> thorough explanation on how to do this.
>
> The problem I see in your approach is that you a an arbitrary number of
> select components having the same name. Perhaps you should try and make
> this a single component instead, where the group names are used for
> grouping individual options, namely the users that belong to that group.
>
> E.g.
>
>Morgue Accessoires Sales Dep
>   John Doe
>   Frank Stein
>Liquor Sales Dep
>   George Doubleu
>   John Wayne
>
> This is also supported by the HTML select element, using option groups.
>
> And, considering that this will render a single select element instead of
> twenty, this will increase overall useability a lot.
>
> The standard select component does not support this, but you can always
> extend upon that behaviour and implement your own custom component.
>
> Cheers
> -- Carsten
>
>> I am trying to wrap my head around how to do this in tapestry.
>>
>> I have a form with 20 select components that are created with the loop
>> component.
>>
>> Given a Map groupMap...
>>
>> Each select component's value (user) is a value in the map.
>>
>> Each label (group) for each select is the key of the map
>>
>> when a select components value has been changed, I want to update the map
>> with it value.
>>
>> I understand that if this was just one select component I could just say
>> something like OnChangeFromSelectID or a zone.
>>
>> But I'm trying to understand how to do this with 20 select components:
>>
>> TML:
>> 
>>
>>   
>>
>>  Group
>>
>>  
>>   
>> ${group.groupName}
>> > value="GroupUser"  />
>>   
>> 
>>
>> PAGE CLASS?:
>> public Object onGroupNameChange(User user)
>> {
>>   groupMap.put(group, recipient);
>> }
>>
>>
>> I'm still new but i'm starting to get the hang of T5...
>> Thanks!
>> -Russell
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>



-- 
Jonathan Barker
ITStrategic

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



Re: Updating a size 20 map with On Change event of 20 select components

2012-07-23 Thread Carsten Klein
This should have gone to the mailing list so I will repost it here:


Hi Russell,

see http://tapestry.apache.org/using-select-with-a-list.html for a
thorough explanation on how to do this.

The problem I see in your approach is that you a an arbitrary number of
select components having the same name. Perhaps you should try and make
this a single component instead, where the group names are used for
grouping individual options, namely the users that belong to that group.

E.g.

   Morgue Accessoires Sales Dep
  John Doe
  Frank Stein
   Liquor Sales Dep
  George Doubleu
  John Wayne

This is also supported by the HTML select element, using option groups.

And, considering that this will render a single select element instead of
twenty, this will increase overall useability a lot.

The standard select component does not support this, but you can always
extend upon that behaviour and implement your own custom component.

Cheers
-- Carsten

> I am trying to wrap my head around how to do this in tapestry. 
>
> I have a form with 20 select components that are created with the loop
> component. 
>
> Given a Map groupMap...
>
> Each select component's value (user) is a value in the map. 
>
> Each label (group) for each select is the key of the map
>
> when a select components value has been changed, I want to update the map
> with it value.
>
> I understand that if this was just one select component I could just say
> something like OnChangeFromSelectID or a zone. 
>
> But I'm trying to understand how to do this with 20 select components:
>
> TML:
> 
>
>   
>    
>      Group
>        
>          
>           
>             ${group.groupName}
>              value="GroupUser"  />
>           
> 
>
> PAGE CLASS?:
>     public Object onGroupNameChange(User user)
>     {    
>       groupMap.put(group, recipient);
>     }
>
>
> I'm still new but i'm starting to get the hang of T5...
> Thanks!
> -Russell




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



Updating a size 20 map with On Change event of 20 select components

2012-07-23 Thread Russell John-Baptiste
I am trying to wrap my head around how to do this in tapestry. 

I have a form with 20 select components that are created with the loop 
component. 

Given a Map groupMap...

Each select component's value (user) is a value in the map. 

Each label (group) for each select is the key of the map

when a select components value has been changed, I want to update the map with 
it value.

I understand that if this was just one select component I could just say 
something like OnChangeFromSelectID or a zone. 

But I'm trying to understand how to do this with 20 select components:

TML:


  
   
     Group
       
         
          
            ${group.groupName}
            
          


PAGE CLASS?:
    public Object onGroupNameChange(User user)
    {    
      groupMap.put(group, recipient);
    }


I'm still new but i'm starting to get the hang of T5...
Thanks!
-Russell

Re: Chaining of Select components

2011-08-17 Thread Chris-1977
I should add that if I remove the @Persist annotation from availableModels,
the onValueChanged method does exist, as shown by the log:

[DEBUG] pages.Contact [ENTER] onValueChanged(AUDI)
[DEBUG] pages.Contact [ EXIT] onValueChanged [Block[Body of
Contact:modelzone, at classpath:com/example/tutorial/pages/Contact.tml, line
14]]

However, nothing happens on the SelectZoneDemo.tml page.  The body of the
modelZone does not become visible.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Chaining-of-Select-components-tp4706131p4710049.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Select components

2008-09-23 Thread Zlatko Kuvendziski


wow!! thanx a lot!! I think that this will work...
I'll get beck to you to let you know...




Marcelo Lotif wrote:

It's possible if you use OnEvent mixin from t5components
http://87.193.218.134:8080/t5c-demo/oneventpage

there's a clue on how to do this in this thread

http://www.nabble.com/T5:-Select-component-%2B-onchange()-to16876151.html#a16900277

On Mon, Sep 22, 2008 at 1:03 PM, Zlatko Kuvendziski <
[EMAIL PROTECTED]> wrote:


is there a possible workaround with the 5.0.15 release?





Ulrich Stärk wrote:


This will work as soon as https://issues.apache.org/jira/browse/TAP5-138
is implemented. You can create a JIRA account and watch and/or vote for
this issue. Until then I think a full submit is the only way to get this
behaviour.

Uli

Am Mo, 22.09.2008, 16:08, schrieb Zlatko Kuvendziski:


hi!

I would like to ask if anyone knows how to make two select components in
T5, where the second one is dependent on the first. And it has to be
ajax based, without full submit.

For example, there are two select components, from the first one, you
select a project, and from the second one, you select a sub-project
based on the project already selected...

thanx!

-
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]






ww


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Select components

2008-09-22 Thread Marcelo Lotif
It's possible if you use OnEvent mixin from t5components
http://87.193.218.134:8080/t5c-demo/oneventpage

there's a clue on how to do this in this thread

http://www.nabble.com/T5:-Select-component-%2B-onchange()-to16876151.html#a16900277

On Mon, Sep 22, 2008 at 1:03 PM, Zlatko Kuvendziski <
[EMAIL PROTECTED]> wrote:

> is there a possible workaround with the 5.0.15 release?
>
>
>
>
>
> Ulrich Stärk wrote:
>
>> This will work as soon as https://issues.apache.org/jira/browse/TAP5-138
>> is implemented. You can create a JIRA account and watch and/or vote for
>> this issue. Until then I think a full submit is the only way to get this
>> behaviour.
>>
>> Uli
>>
>> Am Mo, 22.09.2008, 16:08, schrieb Zlatko Kuvendziski:
>>
>>> hi!
>>>
>>> I would like to ask if anyone knows how to make two select components in
>>> T5, where the second one is dependent on the first. And it has to be
>>> ajax based, without full submit.
>>>
>>> For example, there are two select components, from the first one, you
>>> select a project, and from the second one, you select a sub-project
>>> based on the project already selected...
>>>
>>> thanx!
>>>
>>> -
>>> 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]
>
>


-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3477-5910


Re: Select components

2008-09-22 Thread Zlatko Kuvendziski

is there a possible workaround with the 5.0.15 release?




Ulrich Stärk wrote:

This will work as soon as https://issues.apache.org/jira/browse/TAP5-138
is implemented. You can create a JIRA account and watch and/or vote for
this issue. Until then I think a full submit is the only way to get this
behaviour.

Uli

Am Mo, 22.09.2008, 16:08, schrieb Zlatko Kuvendziski:

hi!

I would like to ask if anyone knows how to make two select components in
T5, where the second one is dependent on the first. And it has to be
ajax based, without full submit.

For example, there are two select components, from the first one, you
select a project, and from the second one, you select a sub-project
based on the project already selected...

thanx!

-
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]



Re: Select components

2008-09-22 Thread Geoff Callender

You might like to vote for this:

Add Zone parameter to Select component
https://issues.apache.org/jira/browse/TAP5-138

Cheers,

Geoff

On 23/09/2008, at 12:08 AM, Zlatko Kuvendziski wrote:


hi!

I would like to ask if anyone knows how to make two select  
components in T5, where the second one is dependent on the first.  
And it has to be ajax based, without full submit.


For example, there are two select components, from the first one,  
you select a project, and from the second one, you select a sub- 
project based on the project already selected...


thanx!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: Select components

2008-09-22 Thread Ulrich Stärk
This will work as soon as https://issues.apache.org/jira/browse/TAP5-138
is implemented. You can create a JIRA account and watch and/or vote for
this issue. Until then I think a full submit is the only way to get this
behaviour.

Uli

Am Mo, 22.09.2008, 16:08, schrieb Zlatko Kuvendziski:
> hi!
>
> I would like to ask if anyone knows how to make two select components in
> T5, where the second one is dependent on the first. And it has to be
> ajax based, without full submit.
>
> For example, there are two select components, from the first one, you
> select a project, and from the second one, you select a sub-project
> based on the project already selected...
>
> thanx!
>
> -
> 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]



Select components

2008-09-22 Thread Zlatko Kuvendziski

hi!

I would like to ask if anyone knows how to make two select components in 
T5, where the second one is dependent on the first. And it has to be 
ajax based, without full submit.


For example, there are two select components, from the first one, you 
select a project, and from the second one, you select a sub-project 
based on the project already selected...


thanx!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]