You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Cristian Gonzalo Gary <cr...@gmail.com> on 2007/12/09 21:02:57 UTC

[T5] How Add and Image to Grid Column Label.

Hello
I need to modified the Column label, and put into and image with a link .

Thanks.
Gracias.
-- 
View this message in context: http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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 - BeanEditForm server side validation question

Posted by Chris Campbell <cc...@quaris.com>.
Very good. For completeness for anyone else reading this, I did the
following:

Added to the java class

@Component
private BeanEditForm _form;

public BeanEditForm getForm()
{
    return _form;
}

and changed template to ( notice the <t:beaneditform to <:form )

<t:form id="form" object="bean" model="model"/>	

Thanks!


Filip S. Adamsen wrote:
> Hi Chris,
> 
> Simply inject the BeanEditForm into your page class and use that to
> record the errors. You'll need to give the BeanEditForm an id in your
> template and then use the @Component annotation to inject it.
> 
> Details are here:
> http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/annotations/Component.html
> 
> 
> -Filip
> 
> Chris Campbell skrev:
>> Simple question from a noob: Following form example, mostly works
>> well. Now I want to do some cross validation server side, and can do
>> that, however I cannot figure out how to set the error message on
>> the form.
>>
>> My class has:
>>
>> @Inject
>> private BeanModelSource _beanModelSource;
>>     
>> @Inject
>> private ComponentResources _resources;
>>
>> @Retain
>> private BeanModel _model;
>>
>> etc..
>>
>> but no form object.
>>
>> The template has
>>
>> <t:beaneditform object="bean" model="model">
>>
>> It seems to me that I need to get the form object and use
>> recordError(String err), is that right? How do I access the form if
>> it is not in my class?
>>
>> Thanks in advance, really impressed with T5 so far.
>>
>> Chris
> 
> ---------------------------------------------------------------------
> 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


Re: T5 - BeanEditForm server side validation question

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi Chris,

Simply inject the BeanEditForm into your page class and use that to 
record the errors. You'll need to give the BeanEditForm an id in your 
template and then use the @Component annotation to inject it.

Details are here:
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/annotations/Component.html

-Filip

Chris Campbell skrev:
> Simple question from a noob: Following form example, mostly works
> well. Now I want to do some cross validation server side, and can do
> that, however I cannot figure out how to set the error message on
> the form.
> 
> My class has:
> 
> @Inject
> private BeanModelSource _beanModelSource;
> 	
> @Inject
> private ComponentResources _resources;
> 
> @Retain
> private BeanModel _model;
> 
> etc..
> 
> but no form object.
> 
> The template has
> 
> <t:beaneditform object="bean" model="model">
> 
> It seems to me that I need to get the form object and use
> recordError(String err), is that right? How do I access the form if
> it is not in my class?
> 
> Thanks in advance, really impressed with T5 so far.
> 
> Chris

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


T5 - BeanEditForm server side validation question

Posted by Chris Campbell <cc...@quaris.com>.
Simple question from a noob: Following form example, mostly works
well. Now I want to do some cross validation server side, and can do
that, however I cannot figure out how to set the error message on
the form.

My class has:

@Inject
private BeanModelSource _beanModelSource;
	
@Inject
private ComponentResources _resources;

@Retain
private BeanModel _model;

etc..

but no form object.

The template has

<t:beaneditform object="bean" model="model">

It seems to me that I need to get the form object and use
recordError(String err), is that right? How do I access the form if
it is not in my class?

Thanks in advance, really impressed with T5 so far.

Chris

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


Re: Does adding a Delete column to a Grid still work?

Posted by Geoff Callender <ge...@gmail.com>.
For the record, this works fine if I take the @Property off the  
_delete field. It was interfering with setDelete(boolean delete).   
Thanks to Uli for pointing this out to me.

This wasted so much of my time I'm pleased to see someone's just added  
an issue about @Property.  Please have a look and vote for it if you  
agree. https://issues.apache.org/jira/browse/TAP5-301

Geoff

On 16/10/2008, at 8:12 AM, Geoff Callender wrote:

> Uli,
>
> I'm seeing isDelete() called as it renders the display but I'm not  
> seeing setDelete(boolean delete) being called on submit. Can you  
> please play spot the obvious error?  Here's the code:
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <body>
> 	<form t:type="form" t:id="deletables">
> 		<table t:type="grid" t:source="persons" t:row="person"  
> t:model="mymodel" t:volatile="false">
> 			t:rowsPerPage="2" t:pagerPosition="top">[Persons Grid here]
> 			<t:parameter name="deleteCell">
> 				<input t:type="checkbox" t:id="delete" value="delete"/>
> 			</t:parameter>
> 	 	</table>
> 	 	<input type="submit" value="Save"/>
> 	 </form><br/>
> </body>
> </html>
>
> package jumpstart.web.pages.examples.tables;
>
> import java.util.ArrayList;
> import java.util.List;
>
> import jumpstart.business.domain.examples.Person;
> import jumpstart.business.domain.examples.iface.IPersonServiceLocal;
> import jumpstart.web.services.IBusinessServicesLocator;
>
> import org.apache.tapestry5.ComponentResources;
> import org.apache.tapestry5.annotations.Persist;
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.annotations.Retain;
> import org.apache.tapestry5.beaneditor.BeanModel;
> import org.apache.tapestry5.ioc.annotations.Inject;
> import org.apache.tapestry5.services.BeanModelSource;
>
> public class GridForm {
>
> 	@SuppressWarnings("unused")
> 	@Property
> 	@Persist
> 	private List<Person> _persons;
>
> 	@SuppressWarnings("unused")
> 	@Property
> 	private Person _person;
>
> 	@Inject
> 	private IBusinessServicesLocator _businessServicesLocator;
>
> 	@Inject
> 	private BeanModelSource _beanModelSource;
>
> 	@Inject
> 	private ComponentResources _componentResources;
>
> 	@SuppressWarnings("unchecked")
> 	@Property
> 	@Retain
> 	private BeanModel _myModel;
>
> 	@Property
> 	private boolean _delete;
>
> 	@SuppressWarnings("unused")
> 	private List<Person> _personsToDelete;
>
> 	@SuppressWarnings("unused")
> 	@Property
> 	private Person _personToDelete;
>
> 	void setupRender() {
>
> 		if (_myModel == null) {
> 			_myModel = _beanModelSource.create(Person.class, false,  
> _componentResources.getMessages());
> 			_myModel.add("delete", null);
> 			_myModel.include("id", "firstName", "lastName", "startDate",  
> "delete");
> 		}
>
> 		// Get all persons - ask business service to find them (from the  
> database)
> 		_persons = getPersonService().findPersons();
> 	}
> 	public void onPrepareForSubmit() {
> 		if (_persons == null) {
> 			_persons = new ArrayList<Person>();
> 		}
> 	}
>
> 	void onSuccess() {
> 		List<Person> dudes = getPersonsToDelete();
> 		System.out.println(">>>> dudes = " + dudes);
> 		for (Person p : getPersonsToDelete()) {
> 			System.out.println(">>>> delete " + p.getFirstName());
> 		}
> 	}
>
> 	private IPersonServiceLocal getPersonService() {
> 		// Use our business services locator to get the EJB3 session bean  
> called "PersonServiceLocal".
> 		return _businessServicesLocator.getPersonServiceLocal();
> 	}
>
> 	public List<Person> getPersonsToDelete() {
> 		if (_personsToDelete == null) {
> 			_personsToDelete = new ArrayList<Person>();
> 		}
> 		return _personsToDelete;
> 	}
>
> 	public void setDelete(boolean delete) {
> 		if (delete) {
> 			getPersonsToDelete().add(_person);
> 		}
> 	}
>
> 	public boolean isDelete() {
> 		return _delete;
> 	}
> }
>
>
> Geoff
>
> On 16/10/2008, at 2:13 AM, Ulrich Stärk wrote:
>
>> Please ignore my stupidity. I misinterpreted the error message I  
>> was getting that had nothing to do with this.
>>
>> You can still add a delete column to your model with  
>> model.add("delete", null) and add a "deleteCell" parameter to your  
>> template in order to have a delete column. Works like a charm.
>>
>> Uli
>>
>> Ulrich Stärk schrieb:
>>> Woah! Indeed, this doesn't work anymore. Evil. How are we supposed  
>>> to do this now?
>>> Uli
>>> Geoff Callender schrieb:
>>>> No response, so I guess that means we can't add a Delete column  
>>>> to a Grid any more.
>>>>
>>>>
>>>> On 14/10/2008, at 8:36 PM, Geoff Callender wrote:
>>>>
>>>>> Can anyone tell me if Penyihir's technique for adding a Delete  
>>>>> column to  Grid still works?
>>>>>
>>>>> Please note this is not the same as editing a flag in the source  
>>>>> entity - this is different - it's editing a column that we've  
>>>>> added to the model.
>>>>>
>>>>> On 10/12/2007, at 7:08 PM, Penyihir Kecil wrote:
>>>>>
>>>>>> it might be help :
>>>>>> -------------------
>>>>>> GridClub.tml
>>>>>> ------------------
>>>>>> <form t:type="Form" t:id="clubForm">
>>>>>>      <table t:type="grid" rowsPerPage="5" pagerPosition="top"
>>>>>> source="clubList" row="club" remove="idClub" model="clubModel">
>>>>>>          <t:parameter name="deleteCell">
>>>>>>              <input t:type="Checkbox" t:id="delete"  
>>>>>> value="delete"/>
>>>>>>          </t:parameter>
>>>>>>          <t:parameter name="updateCell">
>>>>>>              <a t:type="PageLink" t:id="update" page="admin/ 
>>>>>> FormClub"
>>>>>> context="club.idClub"><img src="../images/edit.gif"/></a>
>>>>>>          </t:parameter>
>>>>>>          <!-- <t:parameter name="deleteCell">
>>>>>>              <a t:type="ActionLink" t:id="delete"
>>>>>> context="club.idClub">delete</a>
>>>>>>          </t:parameter>-->
>>>>>>      </table>
>>>>>>      <input type="submit" value="delete"/>
>>>>>>
>>>>>> ---------------------
>>>>>> GridClub.java
>>>>>> ---------------------
>>>>>> @Inject
>>>>>>    private IClubDao clubDao;
>>>>>>    private List<Club> clubList;
>>>>>>    private Club club;           @Retain
>>>>>>    private BeanModel clubModel;
>>>>>>    @Inject
>>>>>>    private BeanModelSource beanModelSource;
>>>>>>  @Inject
>>>>>>  private ComponentResources resources;
>>>>>>
>>>>>>  private boolean delete;
>>>>>>  public List<String> deletedList;
>>>>>>
>>>>>>
>>>>>>  public boolean isDelete() {
>>>>>>        return delete;
>>>>>>    }
>>>>>>
>>>>>>    public void setDelete(boolean delete) {
>>>>>>        if(delete) 
>>>>>> {                       getDeletedList().add(club.getIdClub());
>>>>>>        }
>>>>>>           }
>>>>>>            public List<String> getDeletedList() {
>>>>>>        if(deletedList == null){
>>>>>>            deletedList = new  
>>>>>> ArrayList<String>();                       }
>>>>>>        return deletedList;
>>>>>>    }
>>>>>>
>>>>>>    void pageLoaded(){
>>>>>>      clubModel = beanModelSource.create(Club.class, true,  
>>>>>> resources);
>>>>>>      clubModel.add("delete",null);
>>>>>>      clubModel.add("update",null);
>>>>>>             }
>>>>>>
>>>>>>    public Club getClub() {
>>>>>>        return club;
>>>>>>    }
>>>>>>    public void setClub(Club club) {
>>>>>>        this.club = club;
>>>>>>    }
>>>>>>    public IClubDao getClubDao() {
>>>>>>        return clubDao;
>>>>>>    }
>>>>>>    public List<Club> getClubList() {
>>>>>>        if(clubList == null){
>>>>>>            clubList = new ArrayList<Club>();                
>>>>>> clubList = getClubDao().queryForList("", "");
>>>>>>        }
>>>>>>               return clubList;
>>>>>>    }
>>>>>>        public BeanModel getClubModel() {
>>>>>>        return clubModel;
>>>>>>    }
>>>>>>        Object onSuccessFromClubForm(){
>>>>>>        for (Iterator<String> iter =  
>>>>>> getDeletedList().iterator(); iter.hasNext();) {
>>>>>>            String element = iter.next();
>>>>>>            setClub((Club)  
>>>>>> getClubDao().findByPrimaryKey(element));
>>>>>>            getClubDao().delete(getClub());
>>>>>>                                           }            
>>>>>> deletedList = null;
>>>>>>        return GridClub.class;
>>>>>>    }
>>>>>>
>>>>>> On 12/10/07, Cristian Gonzalo Gary <cr...@gmail.com>  
>>>>>> wrote:
>>>>>>>
>>>>>>> Hello
>>>>>>> I need to modified the Column label, and put into and image  
>>>>>>> with a link .
>>>>>>>
>>>>>>> Thanks.
>>>>>>> Gracias.
>>>>>>> -- 
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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
>>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>


Re: Does adding a Delete column to a Grid still work?

Posted by Geoff Callender <ge...@gmail.com>.
Uli,

I'm seeing isDelete() called as it renders the display but I'm not  
seeing setDelete(boolean delete) being called on submit. Can you  
please play spot the obvious error?  Here's the code:

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<body>
	<form t:type="form" t:id="deletables">
		<table t:type="grid" t:source="persons" t:row="person"  
t:model="mymodel" t:volatile="false">
			t:rowsPerPage="2" t:pagerPosition="top">[Persons Grid here]
			<t:parameter name="deleteCell">
				<input t:type="checkbox" t:id="delete" value="delete"/>
			</t:parameter>
	 	</table>
	 	<input type="submit" value="Save"/>
	 </form><br/>
</body>
</html>

package jumpstart.web.pages.examples.tables;

import java.util.ArrayList;
import java.util.List;

import jumpstart.business.domain.examples.Person;
import jumpstart.business.domain.examples.iface.IPersonServiceLocal;
import jumpstart.web.services.IBusinessServicesLocator;

import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.Retain;
import org.apache.tapestry5.beaneditor.BeanModel;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.BeanModelSource;

public class GridForm {

	@SuppressWarnings("unused")
	@Property
	@Persist
	private List<Person> _persons;

	@SuppressWarnings("unused")
	@Property
	private Person _person;

	@Inject
	private IBusinessServicesLocator _businessServicesLocator;

	@Inject
	private BeanModelSource _beanModelSource;

	@Inject
	private ComponentResources _componentResources;

	@SuppressWarnings("unchecked")
	@Property
	@Retain
	private BeanModel _myModel;

	@Property
	private boolean _delete;

	@SuppressWarnings("unused")
	private List<Person> _personsToDelete;

	@SuppressWarnings("unused")
	@Property
	private Person _personToDelete;

	void setupRender() {

		if (_myModel == null) {
			_myModel = _beanModelSource.create(Person.class, false,  
_componentResources.getMessages());
			_myModel.add("delete", null);
			_myModel.include("id", "firstName", "lastName", "startDate",  
"delete");
		}

		// Get all persons - ask business service to find them (from the  
database)
		_persons = getPersonService().findPersons();
	}
	public void onPrepareForSubmit() {
		if (_persons == null) {
			_persons = new ArrayList<Person>();
		}
	}

	void onSuccess() {
		List<Person> dudes = getPersonsToDelete();
		System.out.println(">>>> dudes = " + dudes);
		for (Person p : getPersonsToDelete()) {
			System.out.println(">>>> delete " + p.getFirstName());
		}
	}

	private IPersonServiceLocal getPersonService() {
		// Use our business services locator to get the EJB3 session bean  
called "PersonServiceLocal".
		return _businessServicesLocator.getPersonServiceLocal();
	}

	public List<Person> getPersonsToDelete() {
		if (_personsToDelete == null) {
			_personsToDelete = new ArrayList<Person>();
		}
		return _personsToDelete;
	}

	public void setDelete(boolean delete) {
		if (delete) {
			getPersonsToDelete().add(_person);
		}
	}

	public boolean isDelete() {
		return _delete;
	}
}


Geoff

On 16/10/2008, at 2:13 AM, Ulrich Stärk wrote:

> Please ignore my stupidity. I misinterpreted the error message I was  
> getting that had nothing to do with this.
>
> You can still add a delete column to your model with  
> model.add("delete", null) and add a "deleteCell" parameter to your  
> template in order to have a delete column. Works like a charm.
>
> Uli
>
> Ulrich Stärk schrieb:
>> Woah! Indeed, this doesn't work anymore. Evil. How are we supposed  
>> to do this now?
>> Uli
>> Geoff Callender schrieb:
>>> No response, so I guess that means we can't add a Delete column to  
>>> a Grid any more.
>>>
>>>
>>> On 14/10/2008, at 8:36 PM, Geoff Callender wrote:
>>>
>>>> Can anyone tell me if Penyihir's technique for adding a Delete  
>>>> column to  Grid still works?
>>>>
>>>> Please note this is not the same as editing a flag in the source  
>>>> entity - this is different - it's editing a column that we've  
>>>> added to the model.
>>>>
>>>> On 10/12/2007, at 7:08 PM, Penyihir Kecil wrote:
>>>>
>>>>> it might be help :
>>>>> -------------------
>>>>> GridClub.tml
>>>>> ------------------
>>>>> <form t:type="Form" t:id="clubForm">
>>>>>      <table t:type="grid" rowsPerPage="5" pagerPosition="top"
>>>>> source="clubList" row="club" remove="idClub" model="clubModel">
>>>>>          <t:parameter name="deleteCell">
>>>>>              <input t:type="Checkbox" t:id="delete"  
>>>>> value="delete"/>
>>>>>          </t:parameter>
>>>>>          <t:parameter name="updateCell">
>>>>>              <a t:type="PageLink" t:id="update" page="admin/ 
>>>>> FormClub"
>>>>> context="club.idClub"><img src="../images/edit.gif"/></a>
>>>>>          </t:parameter>
>>>>>          <!-- <t:parameter name="deleteCell">
>>>>>              <a t:type="ActionLink" t:id="delete"
>>>>> context="club.idClub">delete</a>
>>>>>          </t:parameter>-->
>>>>>      </table>
>>>>>      <input type="submit" value="delete"/>
>>>>>
>>>>> ---------------------
>>>>> GridClub.java
>>>>> ---------------------
>>>>> @Inject
>>>>>    private IClubDao clubDao;
>>>>>    private List<Club> clubList;
>>>>>    private Club club;           @Retain
>>>>>    private BeanModel clubModel;
>>>>>    @Inject
>>>>>    private BeanModelSource beanModelSource;
>>>>>  @Inject
>>>>>  private ComponentResources resources;
>>>>>
>>>>>  private boolean delete;
>>>>>  public List<String> deletedList;
>>>>>
>>>>>
>>>>>  public boolean isDelete() {
>>>>>        return delete;
>>>>>    }
>>>>>
>>>>>    public void setDelete(boolean delete) {
>>>>>        if(delete) 
>>>>> {                       getDeletedList().add(club.getIdClub());
>>>>>        }
>>>>>           }
>>>>>            public List<String> getDeletedList() {
>>>>>        if(deletedList == null){
>>>>>            deletedList = new  
>>>>> ArrayList<String>();                       }
>>>>>        return deletedList;
>>>>>    }
>>>>>
>>>>>    void pageLoaded(){
>>>>>      clubModel = beanModelSource.create(Club.class, true,  
>>>>> resources);
>>>>>      clubModel.add("delete",null);
>>>>>      clubModel.add("update",null);
>>>>>             }
>>>>>
>>>>>    public Club getClub() {
>>>>>        return club;
>>>>>    }
>>>>>    public void setClub(Club club) {
>>>>>        this.club = club;
>>>>>    }
>>>>>    public IClubDao getClubDao() {
>>>>>        return clubDao;
>>>>>    }
>>>>>    public List<Club> getClubList() {
>>>>>        if(clubList == null){
>>>>>            clubList = new ArrayList<Club>();                
>>>>> clubList = getClubDao().queryForList("", "");
>>>>>        }
>>>>>               return clubList;
>>>>>    }
>>>>>        public BeanModel getClubModel() {
>>>>>        return clubModel;
>>>>>    }
>>>>>        Object onSuccessFromClubForm(){
>>>>>        for (Iterator<String> iter = getDeletedList().iterator();  
>>>>> iter.hasNext();) {
>>>>>            String element = iter.next();
>>>>>            setClub((Club) getClubDao().findByPrimaryKey(element));
>>>>>            getClubDao().delete(getClub());
>>>>>                                           }            
>>>>> deletedList = null;
>>>>>        return GridClub.class;
>>>>>    }
>>>>>
>>>>> On 12/10/07, Cristian Gonzalo Gary <cr...@gmail.com> wrote:
>>>>>>
>>>>>> Hello
>>>>>> I need to modified the Column label, and put into and image  
>>>>>> with a link .
>>>>>>
>>>>>> Thanks.
>>>>>> Gracias.
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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
>>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


Re: Does adding a Delete column to a Grid still work?

Posted by Ulrich Stärk <ul...@spielviel.de>.
Please ignore my stupidity. I misinterpreted the error message I was getting that had nothing to do 
with this.

You can still add a delete column to your model with model.add("delete", null) and add a 
"deleteCell" parameter to your template in order to have a delete column. Works like a charm.

Uli

Ulrich Stärk schrieb:
> Woah! Indeed, this doesn't work anymore. Evil. How are we supposed to do 
> this now?
> 
> Uli
> 
> Geoff Callender schrieb:
>> No response, so I guess that means we can't add a Delete column to a 
>> Grid any more.
>>
>>
>> On 14/10/2008, at 8:36 PM, Geoff Callender wrote:
>>
>>> Can anyone tell me if Penyihir's technique for adding a Delete column 
>>> to  Grid still works?
>>>
>>> Please note this is not the same as editing a flag in the source 
>>> entity - this is different - it's editing a column that we've added 
>>> to the model.
>>>
>>> On 10/12/2007, at 7:08 PM, Penyihir Kecil wrote:
>>>
>>>> it might be help :
>>>> -------------------
>>>> GridClub.tml
>>>> ------------------
>>>> <form t:type="Form" t:id="clubForm">
>>>>       <table t:type="grid" rowsPerPage="5" pagerPosition="top"
>>>> source="clubList" row="club" remove="idClub" model="clubModel">
>>>>           <t:parameter name="deleteCell">
>>>>               <input t:type="Checkbox" t:id="delete" value="delete"/>
>>>>           </t:parameter>
>>>>           <t:parameter name="updateCell">
>>>>               <a t:type="PageLink" t:id="update" page="admin/FormClub"
>>>> context="club.idClub"><img src="../images/edit.gif"/></a>
>>>>           </t:parameter>
>>>>           <!-- <t:parameter name="deleteCell">
>>>>               <a t:type="ActionLink" t:id="delete"
>>>> context="club.idClub">delete</a>
>>>>           </t:parameter>-->
>>>>       </table>
>>>>       <input type="submit" value="delete"/>
>>>>
>>>> ---------------------
>>>> GridClub.java
>>>> ---------------------
>>>> @Inject
>>>>     private IClubDao clubDao;
>>>>     private List<Club> clubList;
>>>>     private Club club;           @Retain
>>>>     private BeanModel clubModel;
>>>>     @Inject
>>>>     private BeanModelSource beanModelSource;
>>>>   @Inject
>>>>   private ComponentResources resources;
>>>>
>>>>   private boolean delete;
>>>>   public List<String> deletedList;
>>>>
>>>>
>>>>   public boolean isDelete() {
>>>>         return delete;
>>>>     }
>>>>
>>>>     public void setDelete(boolean delete) {
>>>>         if(delete){                       
>>>> getDeletedList().add(club.getIdClub());
>>>>         }
>>>>            }
>>>>             public List<String> getDeletedList() {
>>>>         if(deletedList == null){
>>>>             deletedList = new ArrayList<String>();               
>>>>         }
>>>>         return deletedList;
>>>>     }
>>>>
>>>>     void pageLoaded(){
>>>>       clubModel = beanModelSource.create(Club.class, true, resources);
>>>>       clubModel.add("delete",null);
>>>>       clubModel.add("update",null);
>>>>              }
>>>>
>>>>     public Club getClub() {
>>>>         return club;
>>>>     }
>>>>     public void setClub(Club club) {
>>>>         this.club = club;
>>>>     }
>>>>     public IClubDao getClubDao() {
>>>>         return clubDao;
>>>>     }
>>>>     public List<Club> getClubList() {
>>>>         if(clubList == null){
>>>>             clubList = new ArrayList<Club>();               clubList 
>>>> = getClubDao().queryForList("", "");
>>>>         }
>>>>                return clubList;
>>>>     }
>>>>         public BeanModel getClubModel() {
>>>>         return clubModel;
>>>>     }
>>>>         Object onSuccessFromClubForm(){
>>>>         for (Iterator<String> iter = getDeletedList().iterator(); 
>>>> iter.hasNext();) {
>>>>             String element = iter.next();
>>>>             setClub((Club) getClubDao().findByPrimaryKey(element));
>>>>             getClubDao().delete(getClub());
>>>>                                            }           deletedList = 
>>>> null;
>>>>         return GridClub.class;
>>>>     }
>>>>
>>>> On 12/10/07, Cristian Gonzalo Gary <cr...@gmail.com> wrote:
>>>>>
>>>>> Hello
>>>>> I need to modified the Column label, and put into and image with a 
>>>>> link .
>>>>>
>>>>> Thanks.
>>>>> Gracias.
>>>>> -- 
>>>>> View this message in context:
>>>>> http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 


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


Re: Does adding a Delete column to a Grid still work?

Posted by Ulrich Stärk <ul...@spielviel.de>.
Woah! Indeed, this doesn't work anymore. Evil. How are we supposed to do this now?

Uli

Geoff Callender schrieb:
> No response, so I guess that means we can't add a Delete column to a 
> Grid any more.
> 
> 
> On 14/10/2008, at 8:36 PM, Geoff Callender wrote:
> 
>> Can anyone tell me if Penyihir's technique for adding a Delete column 
>> to  Grid still works?
>>
>> Please note this is not the same as editing a flag in the source 
>> entity - this is different - it's editing a column that we've added to 
>> the model.
>>
>> On 10/12/2007, at 7:08 PM, Penyihir Kecil wrote:
>>
>>> it might be help :
>>> -------------------
>>> GridClub.tml
>>> ------------------
>>> <form t:type="Form" t:id="clubForm">
>>>       <table t:type="grid" rowsPerPage="5" pagerPosition="top"
>>> source="clubList" row="club" remove="idClub" model="clubModel">
>>>           <t:parameter name="deleteCell">
>>>               <input t:type="Checkbox" t:id="delete" value="delete"/>
>>>           </t:parameter>
>>>           <t:parameter name="updateCell">
>>>               <a t:type="PageLink" t:id="update" page="admin/FormClub"
>>> context="club.idClub"><img src="../images/edit.gif"/></a>
>>>           </t:parameter>
>>>           <!-- <t:parameter name="deleteCell">
>>>               <a t:type="ActionLink" t:id="delete"
>>> context="club.idClub">delete</a>
>>>           </t:parameter>-->
>>>       </table>
>>>       <input type="submit" value="delete"/>
>>>
>>> ---------------------
>>> GridClub.java
>>> ---------------------
>>> @Inject
>>>     private IClubDao clubDao;
>>>     private List<Club> clubList;
>>>     private Club club;   
>>>     
>>>     @Retain
>>>     private BeanModel clubModel;
>>>     @Inject
>>>     private BeanModelSource beanModelSource;
>>>   @Inject
>>>   private ComponentResources resources;
>>>
>>>   private boolean delete;
>>>   public List<String> deletedList;
>>>
>>>
>>>   public boolean isDelete() {
>>>         return delete;
>>>     }
>>>
>>>     public void setDelete(boolean delete) {
>>>         if(delete){           
>>>             getDeletedList().add(club.getIdClub());
>>>         }
>>>        
>>>     }
>>>     
>>>     
>>>     public List<String> getDeletedList() {
>>>         if(deletedList == null){
>>>             deletedList = new ArrayList<String>();               
>>>         }
>>>         return deletedList;
>>>     }
>>>
>>>     void pageLoaded(){
>>>       clubModel = beanModelSource.create(Club.class, true, resources);
>>>       clubModel.add("delete",null);
>>>       clubModel.add("update",null);
>>>            
>>>   }
>>>
>>>     public Club getClub() {
>>>         return club;
>>>     }
>>>     public void setClub(Club club) {
>>>         this.club = club;
>>>     }
>>>     public IClubDao getClubDao() {
>>>         return clubDao;
>>>     }
>>>     public List<Club> getClubList() {
>>>         if(clubList == null){
>>>             clubList = new ArrayList<Club>();   
>>>             clubList = getClubDao().queryForList("", "");
>>>         }
>>>        
>>>         return clubList;
>>>     }
>>>     
>>>     public BeanModel getClubModel() {
>>>         return clubModel;
>>>     }
>>>     
>>>     Object onSuccessFromClubForm(){
>>>         for (Iterator<String> iter = getDeletedList().iterator(); 
>>> iter.hasNext();) {
>>>             String element = iter.next();
>>>             setClub((Club) getClubDao().findByPrimaryKey(element));
>>>             getClubDao().delete(getClub());
>>>                                    
>>>         }   
>>>         deletedList = null;
>>>         return GridClub.class;
>>>     }
>>>
>>> On 12/10/07, Cristian Gonzalo Gary <cr...@gmail.com> wrote:
>>>>
>>>> Hello
>>>> I need to modified the Column label, and put into and image with a 
>>>> link .
>>>>
>>>> Thanks.
>>>> Gracias.
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> 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


Does adding a Delete column to a Grid still work?

Posted by Geoff Callender <ge...@gmail.com>.
No response, so I guess that means we can't add a Delete column to a  
Grid any more.


On 14/10/2008, at 8:36 PM, Geoff Callender wrote:

> Can anyone tell me if Penyihir's technique for adding a Delete  
> column to  Grid still works?
>
> Please note this is not the same as editing a flag in the source  
> entity - this is different - it's editing a column that we've added  
> to the model.
>
> On 10/12/2007, at 7:08 PM, Penyihir Kecil wrote:
>
>> it might be help :
>> -------------------
>> GridClub.tml
>> ------------------
>> <form t:type="Form" t:id="clubForm">
>>   	<table t:type="grid" rowsPerPage="5" pagerPosition="top"
>> source="clubList" row="club" remove="idClub" model="clubModel">
>>   		<t:parameter name="deleteCell">
>>   			<input t:type="Checkbox" t:id="delete" value="delete"/>
>>   		</t:parameter>
>>   		<t:parameter name="updateCell">
>>   			<a t:type="PageLink" t:id="update" page="admin/FormClub"
>> context="club.idClub"><img src="../images/edit.gif"/></a>
>>       	</t:parameter>
>>   		<!-- <t:parameter name="deleteCell">
>>   			<a t:type="ActionLink" t:id="delete"
>> context="club.idClub">delete</a>
>>       	</t:parameter>-->
>>   	</table>
>>   	<input type="submit" value="delete"/>
>>
>> ---------------------
>> GridClub.java
>> ---------------------
>> @Inject
>> 	private IClubDao clubDao;
>> 	private List<Club> clubList;
>> 	private Club club;	
>> 	
>> 	@Retain
>> 	private BeanModel clubModel;
>> 	@Inject
>> 	private BeanModelSource beanModelSource;
>>   @Inject
>>   private ComponentResources resources;
>>
>>   private boolean delete;
>>   public List<String> deletedList;
>>
>>
>>   public boolean isDelete() {
>> 		return delete;
>> 	}
>>
>> 	public void setDelete(boolean delete) {
>> 		if(delete){			
>> 			getDeletedList().add(club.getIdClub());
>> 		}
>> 		
>> 	}
>> 	
>> 	
>> 	public List<String> getDeletedList() {
>> 		if(deletedList == null){
>> 			deletedList = new ArrayList<String>();				
>> 		}
>> 		return deletedList;
>> 	}
>>
>> 	void pageLoaded(){
>>   	clubModel = beanModelSource.create(Club.class, true, resources);
>>   	clubModel.add("delete",null);
>>   	clubModel.add("update",null);
>> 			
>>   }
>>
>> 	public Club getClub() {
>> 		return club;
>> 	}
>> 	public void setClub(Club club) {
>> 		this.club = club;
>> 	}
>> 	public IClubDao getClubDao() {
>> 		return clubDao;
>> 	}
>> 	public List<Club> getClubList() {
>> 		if(clubList == null){
>> 			clubList = new ArrayList<Club>();	
>> 			clubList = getClubDao().queryForList("", "");
>> 		}
>> 		
>> 		return clubList;
>> 	}
>> 	
>> 	public BeanModel getClubModel() {
>> 		return clubModel;
>> 	}
>> 	
>> 	Object onSuccessFromClubForm(){
>> 		for (Iterator<String> iter = getDeletedList().iterator();  
>> iter.hasNext();) {
>> 			String element = iter.next();
>> 			setClub((Club) getClubDao().findByPrimaryKey(element));
>> 			getClubDao().delete(getClub());
>> 									
>> 		}	
>> 		deletedList = null;
>> 		return GridClub.class;
>> 	}
>>
>> On 12/10/07, Cristian Gonzalo Gary <cr...@gmail.com> wrote:
>>>
>>> Hello
>>> I need to modified the Column label, and put into and image with a  
>>> link .
>>>
>>> Thanks.
>>> Gracias.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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
>>
>


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


Re: [T5] How Add and Image to Grid Column Label.

Posted by Geoff Callender <ge...@gmail.com>.
Can anyone tell me if Penyihir's technique for adding a Delete column  
to  Grid still works?

Please note this is not the same as editing a flag in the source  
entity - this is different - it's editing a column that we've added to  
the model.

On 10/12/2007, at 7:08 PM, Penyihir Kecil wrote:

> it might be help :
> -------------------
> GridClub.tml
> ------------------
> <form t:type="Form" t:id="clubForm">
>    	<table t:type="grid" rowsPerPage="5" pagerPosition="top"
> source="clubList" row="club" remove="idClub" model="clubModel">
>    		<t:parameter name="deleteCell">
>    			<input t:type="Checkbox" t:id="delete" value="delete"/>
>    		</t:parameter>
>    		<t:parameter name="updateCell">
>    			<a t:type="PageLink" t:id="update" page="admin/FormClub"
> context="club.idClub"><img src="../images/edit.gif"/></a>
>        	</t:parameter>
>    		<!-- <t:parameter name="deleteCell">
>    			<a t:type="ActionLink" t:id="delete"
> context="club.idClub">delete</a>
>        	</t:parameter>-->
>    	</table>
>    	<input type="submit" value="delete"/>
>
> ---------------------
> GridClub.java
> ---------------------
> @Inject
> 	private IClubDao clubDao;
> 	private List<Club> clubList;
> 	private Club club;	
> 	
> 	@Retain
> 	private BeanModel clubModel;
> 	@Inject
> 	private BeanModelSource beanModelSource;
>    @Inject
>    private ComponentResources resources;
>
>    private boolean delete;
>    public List<String> deletedList;
>
>
>    public boolean isDelete() {
> 		return delete;
> 	}
>
> 	public void setDelete(boolean delete) {
> 		if(delete){			
> 			getDeletedList().add(club.getIdClub());
> 		}
> 		
> 	}
> 	
> 	
> 	public List<String> getDeletedList() {
> 		if(deletedList == null){
> 			deletedList = new ArrayList<String>();				
> 		}
> 		return deletedList;
> 	}
>
> 	void pageLoaded(){
>    	clubModel = beanModelSource.create(Club.class, true, resources);
>    	clubModel.add("delete",null);
>    	clubModel.add("update",null);
> 			
>    }
>
> 	public Club getClub() {
> 		return club;
> 	}
> 	public void setClub(Club club) {
> 		this.club = club;
> 	}
> 	public IClubDao getClubDao() {
> 		return clubDao;
> 	}
> 	public List<Club> getClubList() {
> 		if(clubList == null){
> 			clubList = new ArrayList<Club>();	
> 			clubList = getClubDao().queryForList("", "");
> 		}
> 		
> 		return clubList;
> 	}
> 	
> 	public BeanModel getClubModel() {
> 		return clubModel;
> 	}
> 	
> 	Object onSuccessFromClubForm(){
> 		for (Iterator<String> iter = getDeletedList().iterator();  
> iter.hasNext();) {
> 			String element = iter.next();
> 			setClub((Club) getClubDao().findByPrimaryKey(element));
> 			getClubDao().delete(getClub());
> 									
> 		}	
> 		deletedList = null;
> 		return GridClub.class;
> 	}
>
> On 12/10/07, Cristian Gonzalo Gary <cr...@gmail.com> wrote:
>>
>> Hello
>> I need to modified the Column label, and put into and image with a  
>> link .
>>
>> Thanks.
>> Gracias.
>> --
>> View this message in context:
>> http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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
>


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


Re: [T5] How Add and Image to Grid Column Label.

Posted by Penyihir Kecil <pe...@gmail.com>.
it might be help :
-------------------
GridClub.tml
------------------
<form t:type="Form" t:id="clubForm">
    	<table t:type="grid" rowsPerPage="5" pagerPosition="top"
source="clubList" row="club" remove="idClub" model="clubModel">
    		<t:parameter name="deleteCell">
    			<input t:type="Checkbox" t:id="delete" value="delete"/>
    		</t:parameter>
    		<t:parameter name="updateCell">
    			<a t:type="PageLink" t:id="update" page="admin/FormClub"
context="club.idClub"><img src="../images/edit.gif"/></a>
        	</t:parameter>
    		<!-- <t:parameter name="deleteCell">
    			<a t:type="ActionLink" t:id="delete"
context="club.idClub">delete</a>
        	</t:parameter>-->
    	</table>
    	<input type="submit" value="delete"/>

---------------------
GridClub.java
---------------------
@Inject
	private IClubDao clubDao;
	private List<Club> clubList;
	private Club club;	
	
	@Retain
	private BeanModel clubModel;
	@Inject
	private BeanModelSource beanModelSource;
    @Inject
    private ComponentResources resources;

    private boolean delete;
    public List<String> deletedList;


    public boolean isDelete() {
		return delete;
	}

	public void setDelete(boolean delete) {
		if(delete){			
			getDeletedList().add(club.getIdClub());
		}
		
	}
	
	
	public List<String> getDeletedList() {
		if(deletedList == null){
			deletedList = new ArrayList<String>();				
		}
		return deletedList;
	}

	void pageLoaded(){
    	clubModel = beanModelSource.create(Club.class, true, resources);
    	clubModel.add("delete",null);
    	clubModel.add("update",null);
			
    }

	public Club getClub() {
		return club;
	}
	public void setClub(Club club) {
		this.club = club;
	}
	public IClubDao getClubDao() {
		return clubDao;
	}
	public List<Club> getClubList() {
		if(clubList == null){
			clubList = new ArrayList<Club>();	
			clubList = getClubDao().queryForList("", "");
		}
		
		return clubList;
	}
	
	public BeanModel getClubModel() {
		return clubModel;
	}
	
	Object onSuccessFromClubForm(){
		for (Iterator<String> iter = getDeletedList().iterator(); iter.hasNext();) {
			String element = iter.next();
			setClub((Club) getClubDao().findByPrimaryKey(element));
			getClubDao().delete(getClub());
									
		}	
		deletedList = null;
		return GridClub.class;
	}

On 12/10/07, Cristian Gonzalo Gary <cr...@gmail.com> wrote:
>
> Hello
> I need to modified the Column label, and put into and image with a link .
>
> Thanks.
> Gracias.
> --
> View this message in context:
> http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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