• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

object cascading in a template

 
Kalle Brecht
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

it seemed to be a little and easy question. Unfortunatelly i didn't find anything in the internet and I'm a noob in struts...
Here the Problem:
I give an object (obj1) to the template and I want to access to the id-variable of the object (obj2) within the object (obj1).
I thougt it's possible to things like:



The Action and every object has all getter/setter and I'm able to get the variables of obj1.

I think I only make a misstake how I want to access at the id... I also tried thinks like:


Perhaps, somebody can help me?

Greetz
V
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this <s:property value="%{obj1.obj2.id}"/> This works when you are accessing directly from valueStack.
 
Kalle Brecht
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

unfortunatelly it wasn't the solution... perhaps i make an other mistake...

i also tried:

the value (%{#aDate.id}) is correct, but when i try to acces at the id of the event, nothing is shown
I have also checked that there is realy an event and I'm sure that the getter/setter in the model of aDate is correct.
I don't know where my mistake is...
Greetz
V
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put your project in debug mode and hit the url adding the following ?debug=xml
It will give the valueStack data in xml format. This will confirms that you are getting the data or not. And let me know what you are trying to do exactly in words.
 
Kalle Brecht
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this really helps you:


1 false 1 class de.nak.timetable.action.ShowTimetableAction class de.nak.centuryAdministration.model.Century class de.nak.cohortAdministration.model.Cohort 1 9 1 12 cent99 sdasd 9 class de.nak.timetable.model.TimetableDate class de.nak.eventAdmin.model.Event 12 dscr name short Seminar 1 2 2 class java.util.GregorianCalendar 2 class java.util.Date 15 5 1 0 9 0 -12219292800000 -60 -318 true 4 class java.util.Date 11 5 12 12 10 0 1321009920000 -60 111 1321009920000 3600000 Europe/Berlin class sun.util.calendar.ZoneInfo false


I have a list of TimetableDate-models. I iterate this list and want to get the id (for example) of the Event-model which is in every TimetableDate.
I doesn't thought that this is so complicated ^^
Thank's for your help!
 
Kalle Brecht
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a solution!



It seemed to be, that i can't give a name of the variable for the iterator....
Greetz
V
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic