Hi , I try to use setOutputMarkupId and setMarkupId to generate the id for
the component radio button 

the hierarchy is 

List<IncomeDetail> incomeDetail has a child List<IncomeA> incomeA.

 I use PropertyListView to loop List incomeDetail and in populateItem method

I use another PropertyListView to loop List IncomeA, then in the child
PropertyListView, I want to get the current index of parent list
incomeDetail to construnct an id for the radio button object in IncomeA.

code is like below

final PropertyModel<List&lt;IncomeDetail>> currentIncomeList = new
PropertyModel<List&lt;IncomeDetail>>(sectionThreeModel, "incomes");

final PropertyListView<IncomeDetail> incomeExpenseDetail = new
PropertyListView<IncomeDetail>("section3.currentIncome", currentIncomeList,
IncomeDetail.class){
                                        
                                private static final long serialVersionUID = 1L;
                                int a =1;
                                        
                                @Override
                                protected void 
populateItem(ListItem<IncomeDetail> item) {
                                        IncomeDetail incomeDetail = 
(IncomeDetail) item.getModelObject();
final PropertyModel<List&lt;IncomeA>> populateIncomeList = new
PropertyModel<List&lt;IncomeA>>(item.getDefaultModelObject(),
"incomeEstimate");

final PropertyListView<IncomeA> incomeListView = new
PropertyListView<IncomeA>("section3.incomes.populateIncomeDetail", 
                                                        populateIncomeList 
,IncomeA.class){

                                        
                                                        private static final 
long serialVersionUID = 1L;

                                                        
                                                        @Override
                                                        protected void 
populateItem(ListItem<IncomeA> item ) {
IncomeA income = (IncomeA) item.getModelObject();
......
yesRadio.setOutputMarkupId(true).setMarkupId("corectRadio_Y_"+* i * );
.........

here *i *should be the parent listview current index.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-get-parent-listView-item-index-in-the-child-listview-populateItem-method-tp4678401.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to