[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
In this case you can use: yourBean.getYourModel.getRowData(); | yourBean.getYourModel.getRowIndex(); | But you should not create DataModel each time in a getter. I use it something like this: private DataModel dm = null; | | public DataModel getDetails() { | if (dm==null){ | dm = new ListDataModel(); | } | return dm; | } | | private void syncDetails() { | Client o = getObject(); | if (o!=null){ | getDetails().setWrappedData(o.getDocuments()); | } | } | | private IdentityCard getSelectedDocument() { | return (IdentityCard)getDetails().getRowData(); | } | Frankly, I do not like @DataModel @DataModelSelection @DataModelSelectionIndex View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971862#3971862 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971862 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
8 wrote : | However, when I do this, I don't seem to be getting the DataModel, but rather the actual List itself. This is evidenced by the fact that a method in the class that uses the DataModelSelection is always stuck at pointing to the first item in the List list... | Can you elaborate on that bit, especially the first item in the List. The way it is, your List will get wrapped into a ListDataModel before its sent out to the view and unwrapped on its way back. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971480#3971480 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971480 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
You should use it like this #{list}, because when you use @DataModel Seam outjected wrapper into the current context with name of the property (list in your case) Another way you should wrap it by yourself, only then you can use it the way #{YourBean.YourModel} View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971484#3971484 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971484 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
denis-karpov wrote : You should use it like this #{list}, because when you use @DataModel Seam outjected wrapper into the current context with name of the property (list in your case) Right. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971501#3971501 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971501 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
It would be nice to change the Seam spec such that one can apply the DataModel annotation to the getter method of the list so that one can use the DataModel in multiple roles without explicitly wrapping the list (in the source code) in a DataModel object. I guess I'm suggesting this because I'm quite sure I will run into this problem in the future (and I just hate explicitly wrapping the list in a DataModel). Again, thanks for all the help. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971615#3971615 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971615 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
You can use @DataModel on a getter method. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971619#3971619 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971619 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
[EMAIL PROTECTED] wrote : You can use @DataModel on a getter method. Hi Gavin, I understand you can use the DataModel annotation on the getter method, but if you have two instances of this component alive at the same time, with one component associated with the default component name and the other with another role, then it would not work - because the outjected context DataModel context variable cannot be associated with two roles at the same time - i.e. the client cannot distinguish if the list DataModel context variable belongs to the component1 role or the component2 role. This is the limitation I was referring to and something I hope can be dealt with in the future. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971651#3971651 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971651 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
I think the only way to do this is to create a getter that returns the already wrapped field and then use the parent components name , something like |public DataModel getListModel() { | return new ListDataModel(list); | then #{component1.listModel} and #{component2.listModel} should return the appropriate models. And yes, there's a bug with selection and index in the same class: http://jira.jboss.org/jira/browse/JBSEAM-270 View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971760#3971760 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971760 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel
I hate to move this thread up (and it's probably bad etiquette), but I would really appreciate some help here. I'm really at a lost here and I certainly don't want to explicitly wrap the List object in a DataModel object... I don't think it should take too long to respond either - please tell me if I'm doing something stupid... :) Please help! Thanks! View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971466#3971466 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971466 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user