myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg F├╝chsle <giofy...@googlemail.com>
Subject Problems retrieving selection data from <t:datalist via actionlistener
Date Fri, 08 Apr 2011 09:18:58 GMT
Hallo!


I use Jsf 1.2 with Tomahawk and Facelets.

On a page listing users that belong to a company, I use <t:datalist ..>
To edit one user, I call an actionListener, that retrieves the id of
the selected user.

This works since some years. Now it happens sometimes that the
selection of the user finds a userid of a user that belongs to another
company as listed.

This is really bad... :-(

Is there any advance to replace the actionlistener with
<f:setPropertyActionListener ...?
Has anybody an idea?

Thanks!



here is may actual code:




<table>
	<t:dataList	id="tablebediener"
			rowCountVar="macCount"
			value="#{mbBedienerVerwaltung.bedienerEB}"
			var="bediener"
			rowIndexVar="index">
		<tr>
			<td	class="tabA_rahmen"
				style="padding-left: 5px; width: 310px;">
				<div>
					<t:commandLink	styleClass="aLink"
							value="#{bediener.bedAnzeigeName}"
							action="#{mbBedienerVerwaltung.edit}"
							actionListener="#{mbBedienerVerwaltung.mandantSearch}">
					</t:commandLink>
				</div>
			</td>

			<td>...</td>
		...
		</tr>
		
	</t:dataList>
</table>	




Here my backing bean:



public class MbBedienerVerwaltung implements Serializable
{
	private List<BedienerData> bedienerEB=null;
	private Integer idBediener;



    public void mandantSearch(ActionEvent event)
    {
	this.idBediener = 0;
	try
	{
	    BedienerData bed = null;
	    UIData ob = JsfUtils.getUIDataParent(event);
	    Object tmp = ob.getRowData();
	    bed = (BedienerData) tmp;
	    this.idBediener = bed.getBedId();

	}
	catch (RuntimeException e)
	{
	    log_tech.warn("mandantSearch(): Die BedienerId kann nicht
bestimmt werden! Der Bediener kann nicht editiert werden");
	    this.idBediener = null;
	}

    }

    public String edit()
    {
	if ((mbBediener != null))
	{
		// retrieve Backingbean for User
		MbBediener mbBediener = JsfUtils.getMbBediener();
		// read Userdate for id from Database
	    mbBediener.read(idBediener);
	    return "edit";
	}
	// Error
	return "error";
    }

.....

}

Mime
View raw message