[jboss-user] [JBoss Seam] - Re: Question On @Datamodel Outjection

2007-05-21 Thread baz
Hello,
what are you trying to do? Show the xtml pages.
But, nevertheless, your code looks not quite correct.

You do have a bean called budgetOverview in Conversation scope. And you try to 
outject the same name to conversation scope in scmanager.
I do not understand whta you are trying to do.
For your Datamodel costitems you need an initialization method. Either a 
factory or a method called from user interface would do the job.
These concepts are well described in the seam documentation and are covered in 
the seam examples.

But trying to outject an object which is already setup by seam, semms not right 
to me.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4047174#4047174

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4047174
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Question On @Datamodel Outjection

2007-05-21 Thread hasc
Hi,

i work mainly with 4 classes.

CalculationManager:
- serves the business logic for the interaction with the user
- holds a Calculation Object

Calculation:
- Entity Bean
- holds all data provided by the user

 ExpressCalculator:
- executes a calculation for a passed Calculation object
- returns a BudgetOverview object

BudgetOverview:
- holds all data which should be returned to the user

Workflow:
1. every time the user starts a calculation a (long running) conversation is 
started and a Calculation object is created which holds all data.
2. When the user has passed all information a calculation is executed. and the 
response is stored in the BudgetOverview object
3. the CalculationManager gets this BudgetOverview object and outjects it to 
the conversation scope. Then the user is redirected to the page where the 
response is rendered and after that the conversation ends.

And within the BudgetOverview there is the DataModel selectitems which should 
also be outjected to the conversation scope.

the part of the xhtml looks like that:
ui:define name=content
  |h1Budget Overview/h1
  |div
  |   spanBuildingTyp: /span
  |   h:outputText value=#{budgetOverview.buildingType}/br/
  |   spanArea: /span
  |   h:outputText value=#{budgetOverview.area}/
  |/div
  |h:dataTable value=#{costitems} var=item
  |... columns
  |/h:dataTable
  | /ui:define

works fine fot the #{budgetOverview.attributes} but not for the @Datamodel

thanks for help,
hasc

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4047182#4047182

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4047182
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Question On @Datamodel Outjection

2007-05-21 Thread hasc
the @Datamodel selectitems is initialized by the ExpressCalculator 's method 
calculateInstallationCosts(). it executes a private method which returns the 
Set. I just did not write it down here. selectitems is properly initialized 
because i can e.g display the size of it by writing a method in BudgetOverview

public int getSize() {
  |return selectitems.size();
  | }

and display it like

h:outputText value#{budgetOverview.size}/

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4047183#4047183

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4047183
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Question On @Datamodel Outjection

2007-05-21 Thread baz
Hi,
now it is hopefully clear to me.
You have an object 'budgetOverview' which is managed by seam, due to the @name 
annotation .


At some stage in your workflow an object called budgetOverview is created (new 
...) This object is NOT managed by seam. And you are outjecting this object 
into the same scope as the seam managed object resides in.

So the datamodel can not be outjected, since you are not having a managed 
object in the scope.

You should not create, with new, the budgetOverview object. Try to inject this 
bean into expresscalculator.

From your code i suppose that you are not familar with the seam way of 
programming. Try to investigate the seam examples until you understand them. 
Or buy the very good new seam book, read documentation and experiment for 
yourself.

If you have questions abourt the examples or documentation do not hesitate to 
ask here.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4047189#4047189

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4047189
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Question On @Datamodel Outjection

2007-05-21 Thread hasc
ok thanks for your help. i understand your point.

i have to think about it...

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4047210#4047210

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4047210
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user