You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by 滕训华 <te...@magic-sw.com.cn> on 2008/06/30 07:46:34 UTC
About the null of the select component
I have a component in my tml page:
<t:select model="questionStatusBeans" encoder="questionStatusBeans"
value="selectQuestionStatus"/>
And in my page class:
private TblQuestionStatus selectQuestionStatus;
private GenericSelectModel<TblQuestionStatus> questionStatusBeans;
public TblQuestionStatus getSelectQuestionStatus() {
return selectQuestionStatus;
}
public void setSelectQuestionStatus(TblQuestionStatus
selectQuestionStatus) {
this.selectQuestionStatus = selectQuestionStatus;
}
public GenericSelectModel<TblQuestionStatus> getQuestionStatusBeans(){
return questionStatusBeans;
}
@Inject
@Service("questionStatusManager")
private QuestionStatusManager questionStatusManager;
public AddQuestionFlow(){
List<TblQuestionStatus>
questionStatusList=questionStatusManager.getAllQuestionStatus();
questionStatusBeans = new
GenericSelectModel<TblQuestionStatus>(questionStatusList,TblQuestionStatus.c
lass,"statusType","statusTypeCode",_access);
}
Then user can select the item from the List<TblQuestionStauts>,but there is
another actionLink and its event is:
@InjectPage
private DisplayQuestionFlow disFlow;
DisplayQuestionFlow onActionFromSaveButton(long questionId){
System.out.println(selectQuestionStatus);
return disFlow;
}
But when I select a item from the status list and press the link,it display
the selectQuestionStatus is null,Why it is null?
AW: About the null of the select component
Posted by Martin Kersten <Ma...@mercateo.com>.
Hi there,
not that sure but FORM submit goes through various stages. Struggling
with it myself in the past, I can say the following things:
1. Use onSuccess (instead onAction)
2. onAction does not process various form elements
(wondering if even the form bean is present)
3. Normal flow (correct me if I am wrong): onAction -> Validation -> onSuccess()
So you see, onAction is quite before the validation phase and therefore there is no
such thing as processed selection events or Form elements carrying this kind of
Information to you.
Cheers,
Martin (Kersten)
-----Ursprüngliche Nachricht-----
Von: 滕训华 [mailto:tengxh@magic-sw.com.cn]
Gesendet: Montag, 30. Juni 2008 07:47
An: 'Tapestry users'
Betreff: About the null of the select component
I have a component in my tml page:
<t:select model="questionStatusBeans" encoder="questionStatusBeans"
value="selectQuestionStatus"/>
And in my page class:
private TblQuestionStatus selectQuestionStatus;
private GenericSelectModel<TblQuestionStatus> questionStatusBeans;
public TblQuestionStatus getSelectQuestionStatus() {
return selectQuestionStatus;
}
public void setSelectQuestionStatus(TblQuestionStatus
selectQuestionStatus) {
this.selectQuestionStatus = selectQuestionStatus;
}
public GenericSelectModel<TblQuestionStatus> getQuestionStatusBeans(){
return questionStatusBeans;
}
@Inject
@Service("questionStatusManager")
private QuestionStatusManager questionStatusManager;
public AddQuestionFlow(){
List<TblQuestionStatus>
questionStatusList=questionStatusManager.getAllQuestionStatus();
questionStatusBeans = new
GenericSelectModel<TblQuestionStatus>(questionStatusList,TblQuestionStatus.c
lass,"statusType","statusTypeCode",_access);
}
Then user can select the item from the List<TblQuestionStauts>,but there is another actionLink and its event is:
@InjectPage
private DisplayQuestionFlow disFlow;
DisplayQuestionFlow onActionFromSaveButton(long questionId){
System.out.println(selectQuestionStatus);
return disFlow;
}
But when I select a item from the status list and press the link,it display the selectQuestionStatus is null,Why it is null?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org