You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nn kk <in...@abv.bg> on 2014/03/02 17:26:00 UTC

Problem by editing form in loop

 Hi, I have the following code:

<t:zone id="gamesZone" t:id="gamesZone">
<t:form t:id="gamesForm" id="gamesForm" t:zone="gamesZone">
		<t:Loop t:source="game.gameResultsByPeriod" t:value="gameResult">
			<div class="t-beaneditor-row">
				<label>Period:</label>
				${gameResult.gamePeriod.name}
			</div>
			<div class="t-beaneditor-row">
				<label>First Team Goals</label>
				<t:textfield t:value="gameResult.firstTeamGoals"></t:textfield>
			</div>
			<div class="t-beaneditor-row">
				<label>Second Team Goals</label>
				<t:textfield t:value="gameResult.secondTeamGoals"></t:textfield>
			</div>
		</t:Loop>
		<div class="t-beaneditor-row">
			<input t:type="submit" value="Save" />
		</div>
	</div>
</t:form>
</t:zone>

By pressing the submit, I receive 

Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Property 'gameResult' (within property expression 'gameResult.firstTeamGoals', of com.empters.football.pages.AdminPage@7752bd97) is null. [at classpath:com/empters/football/pages/AdminPage.tml, line 442]
	at org.apache.tapestry5.internal.bindings.PropBinding.set(PropBinding.java:76) [tapestry-core-5.3.7.jar:]
	at org.apache.tapestry5.internal.transform.ParameterWorker$3$1.writeToBinding(ParameterWorker.java:298) [tapestry-core-5.3.7.jar:]
	... 85 more
Caused by: java.lang.NullPointerException: Property 'gameResult' (within property expression 'gameResult.firstTeamGoals', of com.empters.football.pages.AdminPage@7752bd97) is null.
	at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.nullTerm(PropertyConduitSourceImpl.java:1537) [tapestry-core-5.3.7.jar:]
	at $InternalPropertyConduit_1a24021095bb.navigate(Unknown Source)	at $InternalPropertyConduit_1a24021095bb.set(Unknown Source)	at org.apache.tapestry5.internal.bindings.PropBinding.set(PropBinding.java:72) [tapestry-core-5.3.7.jar:]
	... 86 more

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


Re: Problem by editing form in loop

Posted by Daniel Jue <te...@gmail.com>.
gameResult is not being set.  So calling gameResult.firstTeamGoals gives
you the NPE.




On Sun, Mar 2, 2014 at 2:12 PM, Lance Java <la...@googlemail.com>wrote:

> I think the error message provided by Tapestry is telling you exactly what
> you need to know. Have you read it?
>

Re: Problem by editing form in loop

Posted by Lance Java <la...@googlemail.com>.
I think the error message provided by Tapestry is telling you exactly what
you need to know. Have you read it?