[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-07 Thread Newlukai
Great. It works. Thank you.

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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-06 Thread Newlukai
Hi,

I still don't get this working.

Regards
Newlukai

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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-06 Thread danoakland
I wouldn't say that it's without problems, but I did get the sortable table 
working with Seam 1.1.5 (and now upgraded to 1.1.6). I haven't gone to 1.2 yet.

The trick that I had to use is to provide the ice:dataTable with the actual 
DataModel itself, not the outjected variable from Seam. For example, I have a 
bean that manages a table of companies that can be sorted by name or main 
office location:

  | @Stateful
  | @Name(companyList)
  | @Scope(ScopeType.SESSION)
  | public class CompanyListBean extends CompanyList {
  | ...
  | 
  | @DataModel
  | private ListCompanyListObject companies;
  | 
  | ...
  | 
  | public boolean isAscending() {
  | // getter
  | }
  | 
  | public void setAscending(boolean ascending) {
  | // setter
  | }
  | 
  | public String getSortColumn() {
  | // getter
  | }
  | 
  | public void setSortColumn(String columnName) {
  | // setter
  | }
  | 
  | ...
  | 
  | public javax.faces.model.DataModel getResults() {
  | if (companies.size()  1) {
  | // do sort logic if necessary...
  | java.util.Collections.sort(companies, someComparator);
  | }
  | return (javax.faces.model.DataModel) Contexts
  | .getSessionContext().get(companies);
  | }
  | 

Then in the Faces view you use ice:dataTable like this:


  | ice:dataTable value=#{companyList.results} var=result
  | sortColumn=#{companyList.sortColumn}
  | sortAscending=#{companyList.ascending} ... 
  | ice:column
  | f:facet name=header
  | ice:commandSortHeader columnName=name arrow=true
  | ice:outputText value=Company Name /
  | /ice:commandSortHeader
  |  /f:facet
  |  h:outputLink value=#{result.url}
  |  #{result.name}
  |  /h:outputLink
  | /ice:column
  | ice:column
  | f:facet name=header
  | ice:commandSortHeader columnName=city arrow=true
  | ice:outputText value=Main Office /
  | /ice:commandSortHeader
  |  /f:facet
  |  h:outputText
  |  #{result.city}
  |  /h:outputText
  | /ice:column
  | /ice:dataTable
  | 

and it works for me. I may have omitted some stuff from my example there, but 
hopefully you get the gist of it...

It seems that Seam doesn't outject the updated DataModel on a partial submit, 
but the getResults method will.

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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-06 Thread [EMAIL PROTECTED]
I have set up and debugged a Sortable Paged Data Table using IceFaces.

It seems to work fine.

If you are still stuck I can post code and/or a link to the development box 
running it.


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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-06 Thread [EMAIL PROTECTED]
aha. I didnt use @DataModelSelectionIndex...
I just added buttons on each line to go to actions:

  | s:button value=#{messages.button_read}
  | 
action=#{cRUDOrganisationController.startRead(the_organisation)}/
  | s:button value=#{messages.button_update}
  | 
action=#{cRUDOrganisationController.startUpdate(the_organisation)}/  
  | s:button value=#{messages.button_delete}
  | 
action=#{cRUDOrganisationController.startDelete(the_organisation)}/
  | s:button value=#{messages.button_add_image}
  | 
action=#{uploadController.startUpload(the_organisation)}/
  | 

As the-organisation is in scope then I pass the whole object to my action.

None of this fiddling with Indexes...

Just lasy I guess.

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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-06 Thread danoakland
The example I posted above does make use of the @DataModelSelection annotation, 
although I left it out of the example (stupidly). I make use of the 
companyList via the @In annotation in another bean, and I can call a getter 
which returns the currently selected row of the DataModel. I'm pretty sure the 
trick is just to set the value attribute of the dataTable to a getter method 
that will supply an updated model even on a partial submit.

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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-06 Thread [EMAIL PROTECTED]
I map it to the model...
@DataModel
private Organisation[] organisations;

(Easier to work with IceFaces with an Array!)

Thats all..

From Page...

  | ice:dataTable id=organisationsTableComponent value=#{organisations} 
var=the_organisation sortColumn=#{findOrganisationController.sortColumn}
   sortAscending=#{findOrganisationController.ascending} rows=10
  | 

From backing Bean

  | /** 
  |  * @author Tony Herstell 
  |  * @version $Revision: 1.5 $ $Date: 2007-02-13 04:46:40 $ 
  |  */ 
  | @CacheConfig(idleTimeoutSeconds=1800)
  | @Stateful
  | @Name(findOrganisationController)
  | @Scope(ScopeType.SESSION)
  | public class FindOrganisationControllerImpl implements Serializable, 
FindOrganisationController {
  | 
  | @PersistenceContext(type = EXTENDED)
  | private EntityManager em;
  | 
  | @DataModel
  | private Organisation[] organisations;
  | 
  | @Logger
  | private Log log;
  | 
  | @In(create=true)
  | @Out
  | private Organisation organisation;
  | 
  | @In(value=organisationSearchCriteria, create=true)
  | private Organisation organisationSearchCriteria;
  | 
  | @In
  | private MapString, String messages;
  | 
  | /*
  |  *  GUI Support
  |  */
  | public static final String ALL_OPTION = all;
  | public static final String FILTERED_OPTION = filtered;
  | private String selectedSearchCriteriaPanel = ALL_OPTION;
  | 
  | private String sortColumn;
  | private boolean ascending = false;  
  | 
  | private boolean physicalDontCare = true; // Used for filtering only.
  | private static final String PHYSICAL_VALUE_REQUIRED = 
physical_required;
  | private static final String PHYSICAL_VALUE_NOT_REQUIRED = 
physical_not_required;
  | private String physicalValueRequiredPanel = PHYSICAL_VALUE_REQUIRED;
  | 
  | /*
  |  * Searh String
  |  */
  | private static final String ALL_QUERY = select o from Organisation o;
  | 
  | private Query query;
  | 
  | /*
  |  * Methods
  |  */
  | @Factory(organisations) // Is run whenever this bean is created (we 
know its going to be the All query.
  | public void initOrganisations() {
  | log.info( initOrganisations);
  | applyAllQuery();
  | log.info( initOrganisations);
  | }
  | 
  | 



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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-06 Thread Newlukai
Thanks for your answers. But the thing is that - under certain circumstances - 
the sorting does work in my application.

My problem is a little bit more complex. Imagine that you just want to show up 
companies (danoakland) or organisations (Tony) that match certain criterias 
which can be varied by the user with selectOneMenus. Just think of one 
selectOneMenu which gives the user the option to filter for companies which 
have just 0-25, 25-50 or 50 employees.
Implementing this let me decide between two options how the application would 
act:

1 - The filtering works correctly, which means that the dataTable always show 
the entries matching the current filters. But: @DataModelSelection(Index) 
doesn't work.
2 - @DataModelSelection(Index) works, but then the dataTable shows the entries 
matching the filters the request before the current request.

It's just driving me crazy.

But I would thank you, Tony, you just give me some hope, that I would get it to 
work with your use of the_organisation in the buttons. Does this work in 
normal ice:commandLinks or does it only work with s:buttons?
Anyhow, it shows me I have to attend to EL again.

Thanks in advance
Newlukai

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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-03-05 Thread ector7280
Anyone,

Is there a way to get a sortable icefaces dataTable to work with Seam or
does this need to be added to the JIRA?

thanks,

JR

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

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


[jboss-user] [JBoss Seam] - Re: How to use ice:dataTable and @DataModel?

2007-02-08 Thread Newlukai
I'm wondering if there's anybody using ice:dataTable, @DataModel and 
@DataModelSelectionIndex without any problems.

Imagine you have a list rendered by an ice:dataTable. One column consists of  
h:commandLinks. The action method gathers information about the selected item 
and returns an outcome that tells JSF to show a page where the selected item is 
displayed more detailed.
Just like a list of users. You click on a username and on the next page you see 
his address or something.

The problem is that the @DataModelSelection(Index) is injected with the default 
value.

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

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