You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Cox, Jason" <ja...@citigroup.com> on 2003/11/19 23:15:11 UTC

PropertySelection, how to get back to the top of the list?

Hey folks,

First of all, despite the earlier issues I had about confidentiality, I
suppose with my new subscription it will be painfully obvious who I work
for. I've just been waiting for approval to get on the list from work. Most
of the other developers around here are using Struts. I can't wait to show
them what I'm doing with Tapestry.

Anyway, to my problem. I have a model that is built according to the status
of items in a database. The status is selected by a radio button, and when
the form is submitted with a change of status, the model is rebuilt with
items that match the correct status.

The problem I have is that there are 4 active items, 0 archived, and 2
inactive. If I am on the 3rd active item and try to change status to
archived, I get an IndexOutOfBoundsException because the new model is trying
to start from the 3rd item of a list that has only it's default value (null
lists have a "create new entry" value by default)

Basically, what I need is for the PropertySelection component to go back to
it's 0 index whenever I change the status of the list items.

The current call looks something like this -

public void statusSubmit(IRequestCycle cycle) {
  model = new selectionModel(buildModel(status));
}

The constructor I'm calling is just something that gets the integer value of
the status and makes a call to the database. I don't think it's relevant but
I'll post it if need be.

Jason Cox
Business Intelligence Developer
CitiFinancial Mortgage
jason.o.cox@citigroup.com

This information is considered the property of Citigroup and is confidential




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


Re: PropertySelection, how to get back to the top of the list?

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Simply set the value of the PropertySelection to null!

<component id="..." type="PropertySelection">
	...
	<binding name="value" expression="yourValue" />
	...
</component>

public void submit(IRequestCycle cycle)
{
	...
	setYourValue(null);
	...
}

-Harish

Cox, Jason wrote:

> Hey folks,
> 
> First of all, despite the earlier issues I had about confidentiality, I
> suppose with my new subscription it will be painfully obvious who I work
> for. I've just been waiting for approval to get on the list from work. Most
> of the other developers around here are using Struts. I can't wait to show
> them what I'm doing with Tapestry.
> 
> Anyway, to my problem. I have a model that is built according to the status
> of items in a database. The status is selected by a radio button, and when
> the form is submitted with a change of status, the model is rebuilt with
> items that match the correct status.
> 
> The problem I have is that there are 4 active items, 0 archived, and 2
> inactive. If I am on the 3rd active item and try to change status to
> archived, I get an IndexOutOfBoundsException because the new model is trying
> to start from the 3rd item of a list that has only it's default value (null
> lists have a "create new entry" value by default)
> 
> Basically, what I need is for the PropertySelection component to go back to
> it's 0 index whenever I change the status of the list items.
> 
> The current call looks something like this -
> 
> public void statusSubmit(IRequestCycle cycle) {
>   model = new selectionModel(buildModel(status));
> }
> 
> The constructor I'm calling is just something that gets the integer value of
> the status and makes a call to the database. I don't think it's relevant but
> I'll post it if need be.
> 
> Jason Cox
> Business Intelligence Developer
> CitiFinancial Mortgage
> jason.o.cox@citigroup.com
> 
> This information is considered the property of Citigroup and is confidential
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


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