You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by daoudja <da...@gmail.com> on 2011/09/12 10:56:29 UTC

ajaxformloop inside ajaxformlopp

Hello,
I want to make an ajaxformloop inside an ajaxformloop
But it seems that the one which is inside    is the same for all the
elements  of the big ajaxformloop
this is a problem because i can't differentiate beteween elements and i have
problems of concurrent access
when writing on this ajaxformloop.

please can you help me?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/ajaxformloop-inside-ajaxformlopp-tp4793513p4793513.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: ajaxformloop inside ajaxformlopp

Posted by LLTYK <LL...@mailinator.com>.
You probably need a public List onAddRowFromOuterLoop(). Assuming each
element in your outer loop is a list which is used by the inner loop. Then
you'd need to store these multiple lists somewhere.

--
View this message in context: http://tapestry-users.832.n2.nabble.com/ajaxformloop-inside-ajaxformlopp-tp6782680p6782985.html
Sent from the Tapestry Users 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: ajaxformloop inside ajaxformlopp

Posted by daoudja <da...@gmail.com>.
I have a dateHolder that holds my objects in the ajaxformloop     


public DateHolder onAddRowFromdateLoop(){
    	if (dateList == null){
    		dateList = new ArrayList<cleverListDate.DateHolder>();
    	}
    	DateHolder dateHolder = new DateHolder();
    	log.trace("add " + dateHolder.getKey());
		dateList.add(dateHolder);
		return dateHolder;
    }
	
    public void onRemoveRowFromdateLoop(DateHolder date){
    	if(date == null) {
			log.error("on remove row from financial conditions - [DateHolder] is
null.");
			return;
    	}
    	log.trace("delete "+date.getKey());
    	if(!dateList.contains(date))
    		dateList.remove(date);	
    	else
    		date.setDeleted(true);  	
    }

 public ValueEncoder<DateHolder> getdateEncoder() {
		return new ValueEncoder<DateHolder>() {
			public String toClient(DateHolder fc) {
				return fc.getKey().toString();
			}
			public DateHolder toValue(String ks) {
				String k = new String(ks);
				int i =0;
				DateHolder fc1 = null;
				for (DateHolder fc : dateList){
					if (fc.getKey().toString().equals(k))  fc1=fc ;
				log.error("Date encoder - Received key \"" + k
						+ "\" which has no counterpart in this collection: " +
dateList.get(i).getKey());
				}
				return fc1;
			}
		};
	}

the encoder give me a unique key
but the problem is the fact that tapestry creates only one datelist .


the setdeleted makes the element disapear from the list but still exist.

is there anyway to tell tapestry to create a list for each element of the
big list
or is it simply a bug ?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/ajaxformloop-inside-ajaxformlopp-tp4793513p4793625.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: ajaxformloop inside ajaxformlopp

Posted by Steve Eynon <st...@alienfactory.co.uk>.
Woah! A double loop! I've never tried one of those!

I know the ValueEncoder is really important to AjaxFormLoops - could
you post the one you're using along with the add and remove methods?

Steve.


On 12 September 2011 16:56, daoudja <da...@gmail.com> wrote:
> Hello,
> I want to make an ajaxformloop inside an ajaxformloop
> But it seems that the one which is inside    is the same for all the
> elements  of the big ajaxformloop
> this is a problem because i can't differentiate beteween elements and i have
> problems of concurrent access
> when writing on this ajaxformloop.
>
> please can you help me?
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/ajaxformloop-inside-ajaxformlopp-tp4793513p4793513.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
>
>

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