Re: Sorting dataTable

2006-01-10 Thread gramani

Marco [EMAIL PROTECTED] wrote on 01/10/2006
07:41:34 AM:

 Hi Everybody;
 
 Thanks a lot for last replies :)
 
 I need to know the steps to make a dataTable sortable ?
 
 Thanks a lot
 

As Ronald wrote, look at the examples first - they
are pretty good. Also i quote below what Simon wrote when I had trouble
seeing what was needed:

The sortColumn attribute should point
to a backing bean property that 
is of type String. That property gets set (ie its setter gets called) 
with the columnName value of whatever column the user chose to sort on.

The sortAscending attribute should point to a backing bean
property 
that is of type boolean. That property gets set to true/false when the

user clicks repeatedly on the same column header (ie sorts 
asc/desc/asc/desc).

Your worklist.assignments method (ie the one referred to by the table's

value attribute) is then required to look at the backing bean's

properties that are the target of sortColumn and sortAscending and 
return its list in the order specified by those (String, boolean) 
properties.

If you are still having trouble, search this archive.
About a week back there was a long thread involving just this problem titled
Getting sorting to work in data table -- header click does not call
sort method and Data Table Sorting still not working.
There is code as well as discussion there you may find useful.

Regards,
Geeta


Re: Sorting dataTable

2006-01-10 Thread gramani

Marco [EMAIL PROTECTED] wrote on 01/10/2006
08:52:39 AM:

 OK
 
 I tried to do like the examples said but nothing worked..maybe 
 because i did not have the source beans of the examples leaded me
to
 misunderstanding.
 
  i tired another way..
 
 This is what i thought..The header will be command link that has an

 action="" bean.sort, When i click the header I'll send the
column 
 value through the request params then read it by the method sort and
 perform the sort..but it does not work correctly :(
 
 Thanks
 

Hi Marco, why don't you have the source? You can download
it..?
Regards,
Geeta


Re: Sorting dataTable

2006-01-10 Thread gramani

Marco [EMAIL PROTECTED] wrote on 01/10/2006
09:02:08 AM:

 Can you please give me the URL ?
 
 Thanks a lot
 

You mean for the source? http://myfaces.apache.org/source.cgi
will give you the release version.. not sure if this is what you are asking..?

Regards,
Geeta


Re: Sorting dataTable

2006-01-10 Thread gramani

Marco [EMAIL PROTECTED] wrote on 01/10/2006
09:17:55 AM:

 No..I meant the sortable dataTable source (jsp, beans  config).
 
 Thanks
 

Beans: src\examples\simple\src\java\org\apache\myfaces\examples\listexample\
jsps: src\examples\simple\
config: src\examples\simple\WEB-INF\

Geeta


Re: AddResource issue

2006-01-08 Thread gramani

Simon Kitching [EMAIL PROTECTED] wrote
on 01/08/2006 04:57:59 PM:

 
 The code that processes queued resources and actually modifies the

 generated page to include them is the ExtensionsFilter. If you don't

 have this filter mapped for *.jsf then that would explain
your problem.
 
  filter-mapping
   filter-nameextensionsFilter/filter-name
   url-pattern*.jsf/url-pattern
  /filter-mapping
 

Simon, shouldn't there be entries for url-patterns
*.faces as well as for /faces/*?

 Regards,
 
 Simon

Regards,
Geeta


Re: h:dataTable t:dataTable Dynamic Columns

2006-01-06 Thread gramani

Matias Gomez Carabias [EMAIL PROTECTED]
wrote on 01/06/2006 09:29:57 AM:

 Hi all, I came up with the following problem and I was wondering if
 someone experienced the same issue.
 
 The deal is the following. I have to fill up the dataTable with values
 sent by the backend to the WebTier of the application. The problem
is
 that I don't know until runtime the number of columns to display or
the
 title of each column.
 
 Any tips?

Matias, you could take a look at this:
http://myfaces.apache.org/tomahawk/columns.html

 
 
 Thanks a lot
 
 Matias Gomez Carabias

Regards,
Geeta


Re: Open new browser window.

2006-01-03 Thread gramani

Matias Gomez Carabias [EMAIL PROTECTED]
wrote on 01/03/2006 10:41:38 AM:

 Hi guys, I need a tip on how to open a new window, let's say via an
 commandLink or outputLink with parameters, and set some properties
to
 the new page, such as scrollbars=no, height, width, etc...
 If I have to do this via _javascript_, hoy can I pass the parameters
and
 call a backingBean?
 The idea is the following, pass some parameters to a backing bean
via
 the f:param and call a backingBean method, and after the method is
 executed, to open a new window but with the properties described above.
 
 
 Thanks a lot for your help
 
 Matias

Hi Matias,

I do some of what you are describing. Here's my code
(and I have tried to simplify it for clarity):

My nextAssignment.jsp has:
h:commandLink
rendered=#{worklist$nextAssignmentHome1.currentActivityInAgentsSwimLane}
action=#{worklist$nextAssignmentHome1.acceptAssignment}
immediate=true
h:outputText
  
 value=#{rowIndexVariable+1}.
#{assignment.urlDisplay}
/
/h:commandLink

My backing bean (corresponding to #{worklist$nextAssignmentHome1)
does its work in acceptAssignment() method and returns a String twowindows
which is mapped to a jsp (via tiles etc.) to a jsp with this code:

script
language=_javascript_
type=text/_javascript_
!--
/
  Author:
Eric King
  Url:
http://redrival.com/eak/index.shtml
  This
script is free to use as long as this info is left in
  Featured
on Dynamic Drive script library (http://www.dynamicdrive.com)
/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos==random){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos==center){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!=center
 pos!=random)
|| pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}

function popUpAssessment(mypage){
  
 NewWindow(mypage,'Assessment','600','800','yes','center');
}



var assessmentWindow;
var assessmentWindowUrl
= h:outputText
escape=false
value=#{twoWindows1.processLight.nextUrl.url}
/;
var cval
= h:outputText
value=#{twoWindows1.processLight.urlCount}
/;
// --
/script

/head
body
onLoad=popUpAssessment(assessmentWindowUrl);

etc.

Hope this helps you towards a solution
to your problem.

Regards,
Geeta


RE: Open new browser window.

2006-01-03 Thread gramani

Matias Gomez Carabias [EMAIL PROTECTED]
wrote on 01/03/2006 12:59:04 PM:

 Geeta, thanks for your reply, Ive solved using the following approach:
 
 h:commandLink id=dTSearch styleClass=aSearch
>
 open('DocumentTypes.faces','','width=200,height=300,top=100,left=100')
   h:outputText value=Find
DocType/
   f:param name=activeFolder
value=#{documentBean.activeFolderName}/
  /h:commandLink
 
 The problem Im having is that when a link is
clicked in the new 
 window with some value, I want that value to fill up an h:inputText

 in the main page which called the new window. 
 
 In the new window Im doing something like this:
 
 h:commandLink immediate=true
action="">
 selectDocumentType} >
   h:outputText
value=#{node.description} 
 styleClass=nodeFolder/
   h:outputText
value= (#{node.childCount}) 
 styleClass=childCount rendered=#{!empty node.children}/
   
  
  
 
 f:param name=selectedDocType value=#{node.description}/
 /h:commandLink
 
 and in the documentHandler.selectDocumentType
Im setting the value 
 in the property bound to the h:inputText , but the main page is 
 never refreshed so the change is not made. 
 
 Did you have a similar problem?
 
 Thanks a lot
 
 Matias

Hi Matias, I didn't have to do anything in the new
window which had to be transferred back to the old one, so
I did not have your problem. However, check this link out; it may solve
your problem:

http://lists.evolt.org/archive/Week-of-Mon-2731/014953.html

Regards,
Geeta



Re: Paging Control -- Help

2006-01-03 Thread gramani

Mike [EMAIL PROTECTED] wrote on
01/03/2006 10:00:30 AM:

 Hello all,
 
 I think I've almost gotten the paging component working with the 
 sorting component for an ArrayList-based data model.
 
 If I remove the paging part from the JSP, the page still sorts and

 saves correctly.
 
 But, when I add the paging logic into the JSP, I get this message,

 which really doesn't help much. The log does refer to the JSP page,

 but the line number is bigger than the actual number of lines in the
 file so that's not helpful either.

Hi Mike,

Here's a barebones paging code (I removed all style
for simplicity) which works for me:

h:form
id=contactscrollerpagerform
t:saveState
id=savesearchstate
value=#{search}
/
h:panelGrid
styleClass=scrollerTableNoBorder
  
 rendered=#{search.results}

   h:column

   h:panelGrid
id=contactInfoPanelGrid


   
   f:facet
name=header

   
   h:outputText
value=Demographic
search results /

   
   /f:facet

   
   t:dataTable
id=contactsearchdata
  
   
   
 var=contact
value=#{search.matchingContacts}
rows=7
  
   
   
 rowId=#{contact.id}
sortColumn=#{search.sort}

   
   sortAscending=#{search.ascending}
preserveSort=true


   
   
   h:column

   
   f:facet
name=header

   
   
   t:commandSortHeader
columnName=lastname
arrow=true
  
   
   
 
   immediate=false

   
   
   h:outputText
value=Last
Name /

   
   
   /t:commandSortHeader

   
   /f:facet

   
   
   h:outputText
value=#{contact.lastName}
/

   
   
   /h:column
  
   
   
 !--etc..add other
columns here..--
  
   
 /t:dataTable

   /h:panelGrid

   h:panelGrid

   
   t:dataScroller
id=scroll_1
for=contactsearchdata
fastStep=10
  
   
   
 pageCountVar=pageCount
pageIndexVar=pageIndex
  
   
   
 paginator=true
paginatorMaxPages=3
  
   
   
 paginatorTableClass=paginator
  
   
   
 paginatorActiveColumnStyle=font-weight:bold;

  
   
   
 f:facet
name=first

   
   
   t:graphicImage
url=images/arrow-first.gif
border=1
/

   
   /f:facet

   
   f:facet
name=last

   
   
   t:graphicImage
url=images/arrow-last.gif
border=1
/

   
   /f:facet

   
   f:facet
name=previous

   
   
   t:graphicImage
url=images/arrow-previous.gif
border=1
/

   
   /f:facet

   
   f:facet
name=next

   
   
   t:graphicImage
url=images/arrow-next.gif
border=1
/

   
   /f:facet

   
   /t:dataScroller

   /h:panelGrid

   /h:column
/h:panelGrid
/h:form

You are right about the for of the datascroller
needing to match the id of the datatable. Also note I didn't
have have any actionListeners at all. Plus, the style stuff is in basic.css
(at least it was in the version i downloaded a little while back. So as
long as you import that style sheet at the top of your jsp, the style will
be picked up.

Hope this helps,
Geeta


Re: Paging Control -- Help

2006-01-03 Thread gramani

Mike [EMAIL PROTECTED] wrote on
01/03/2006 12:37:30 PM:

 Hi Geeta,
 
 Can you explain what the rowId signifies in the data table when 
 using the paging component?

I believe it identifies a unique row within your data
table. For example, your tx class should have a getType() method
and type should uniquely identify your tx object. 

 
 I'm still getting errors (see below, but I think it's still pretty

 basic). I added the basic.css to the JSP directory, but that didn't
help.

Did you also add a link notation within the head
in your jsp to this style sheet? 


 And, my paging header:
  
 
  
 
  
f:actionListener 
 type=DataScrollerActionListener /


What happens when you remove the f:actionListener?


 type Exception report
 message 
 description The server encountered an internal
error () that 
 prevented it from fulfilling this request.
 exception 
 javax.servlet.ServletException: javax.servlet.ServletException:

 javax.servlet.jsp.JspException: null
  javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)

Finally, did you enclose everything within a h:form
as in the example I gave you earlier?

Regards,
Geeta


Re: Paging Control -- Help

2006-01-03 Thread gramani

Mike [EMAIL PROTECTED] wrote on
01/03/2006 01:39:37 PM:

 Hi Geeta,
 
 Thanks for the suggestionOkay, we're getting close :-) 
 
 I added the link href="" rel=stylesheet
type=text/css 
 / to the JSP. 
 
 When I removed the f:actionListener type=DataScrollerActionListener/
 
 it works!
 
 Well, kinda...
 
 If I click any of the nav buttons I get errors like below.
 
 Do I need to do anything for the variables in the paging control?
It
 doesn't seem so based on the example.
 
  id=scroll_1
  
  for="">
  
  fastStep=10
  
  pageCountVar=pageCount ???
  
  pageIndexVar=pageIndex  ???
  
  styleClass=scroller
  
  paginator=true
  
  paginatorMaxPages=9
  
  paginatorTableClass=paginator
  
  paginatorActiveColumnStyle=font-weight:bold;
 
 I mean do any of these need to be in the managed bean or handled in
any way?

No, I don't believe so.

 
 I don't know if the errors below are from my removing the 
 DataScrollerActionListener.
 

Are you using t:saveState for your table? Also,
do you have everything (datatable as well as datascroller) enclosed in
a h:form as in the example I sent you earlier?

Regards,
Geeta


Re: Formating outputText

2006-01-03 Thread gramani

Vladimir Coutinho [EMAIL PROTECTED] wrote
on 01/03/2006 03:43:59 PM:

 I'm trying to output a row of a table and I need a diferent format.

 There is a way to use a function to format the output in jsf?

 On 1/3/06, Simon Kitching [EMAIL PROTECTED]
 wrote:
 On Mon, 2006-01-02 at 15:41 -0300, Vladimir Coutinho
wrote:
  I'm trying to use a function to format the text of the outputText:

  h:outputText
  value=#{util.text.FormatText.formatCNPJ_CPF(c.CNPJ_CPF)}/
 
  But I'm having the following error:
 
  javax.servlet.ServletException: Invalid _expression_: 
  '${util.text.FormatText.formatCNPJ_CPF(c.CNPJ_CPF)}'
 
 Yep, that's an invalid EL _expression_. EL doesn't support passing
 parameters. Why do you want to do this? Are you trying to output data
in
 a row of a table, or perhaps you are trying to use c:forEach? 
 
 
 Regards,
 
 Simon

Vladimir, if the styleClass attribute
of h:outputText does not do what you want, I think one way to achieve
what you want is to have a getter method in your bean do the formatting
work for you. Then you can reference that method in the usual way using
EL.

Regards,
Geeta


Re: Getting sorting to work in data table -- header click does not call sort method

2005-12-30 Thread gramani

Hi Mike,

Mike [EMAIL PROTECTED] wrote on
12/30/2005 09:29:47 AM:

 Hello,
 
 I think I have everything set up correctly now to sort my Data 
 Table, but clicking on a header column still does not call the 
 sort() method. In fact, nothing happens.
  


I had the exact same problem a while back and Simon
pointed me in the right direction. Here's the relevant link:
http://www.mail-archive.com/users@myfaces.apache.org/msg10458.html
Hth,
Geeta


Re: Getting sorting to work in data table -- header click does not call sort method

2005-12-30 Thread gramani

hi again Mike,

Mike [EMAIL PROTECTED] wrote on
12/30/2005 11:50:17 AM:

 Thanks for the info. I'm a little closer, but I'm still having problems.
 

 
 h:column
  f:facet name=header
  t:commandSortHeader columnName=personName arrow=true

   h:outputText value=#{msgs.PersonName}
/
/t:commandSortHeader   
  

   /f:facet 
  

   h:outputText value=#{update.personName}
/
  /h:column
 
 I'd be almost done if I could just get clicking on the header to 
 actually set the sortColumn property.
 
 Thanks again for any suggestions.
 
   Mike

First, since you have a columnName as personName,
your sort method should have something like this:
if (column.equals(personName)) {
return ascending
? c1.personName().compareTo(
 
  c2.getPersonName()) : c2.PersonName().compareTo(c1.PersonName());

Do you?

Also in my bean I have code like this for sorting
against lastname column. Maybe you can check your code for
something like this too?

private String
_sort; //with getter and setter

private boolean
_ascending; //with getter and setter

public SearchBean()
{
 
  _sort = lastname;
 
  _ascending = isDefaultAscending(lastname);
}

public SearchBean(String
defaultSortColumn) {
 
  _sort = defaultSortColumn;
 
  _ascending = isDefaultAscending(defaultSortColumn);
}

protected boolean
isDefaultAscending(String sortColumn) {
 
  return true;
}
public void sort(String
sortColumn) {
 
  if (sortColumn == null) {
 
  throw new IllegalArgumentException(
 
   
  Argument
sortColumn must not be null.);
 
  }

 
  if (_sort.equals(sortColumn)) {
 
  // current sort
equals new sortColumn - reverse sort order
 
  _ascending =
!_ascending;
 
  } else {
 
  // sort new column
in default direction
 
  _sort = sortColumn;
 
  _ascending =
isDefaultAscending(_sort);
 
  }

 
  sort(_sort, _ascending);
}

regards,
Geeta


Re: Getting sorting to work in data table -- header click does not call sort method

2005-12-30 Thread gramani

Mike [EMAIL PROTECTED] wrote on
12/30/2005 12:36:39 PM:

 Hi Gretta!
 
 Thanks for your reply.
 Please see my comments in-line below

 
 Mine is: value =#{TD.getPersons} 
 

Shouldn't you simply have #{TD.persons}
? Here's what i have:
t:dataTable
id=contactsearchdata
styleClass=scrollerTable
  
 headerClass=standardTable_BgWhiteHeader
  
 footerClass=standardTable_Header
  
 rowClasses=standardTable_Row1,standardTable_Row2
  
 columnClasses=standardTable_ColumnCentered,standardTable_Column,standardTable_Column,standardTable_ColumnCentered,standardTable_ColumnCentered,standardTable_ColumnCentered
  
 var=contact

  
value=#{search.matchingContacts}

  
 rows=7
  
 rowId=#{contact.id}

  
 sortColumn=#{search.sort}
sortAscending=#{search.ascending}

  
 preserveSort=true


Also, if all else fails, try replacing your name TD
with something else. I remember (though this was a long time ago!) short
names which were capitalised created trouble with reflection..

 
 
 Strange, huh?
 
   Mike

Regards,
Geeta (..umm.. not Gretta ;))


RE: Data Table Sorting still not working

2005-12-30 Thread gramani
Mike, Tom:FirstMike, maybe it was a typo, but you said you had "Persons". Hope you meant "persons" (lower case).Here's a complete example which works fine for me. I'll try to explain what i understand what needs to be done. But first the code:My backing bean (or the bean that's "behind" the current jsp) is "SearchBean". It has a list of contacts" which I am trying to display in a datatable. This is the list that i want sorted.public class SearchBean extends AbstractViewController implements Serializable {private Contact contact = new Contact();private List matchingContacts = new ArrayList();private transient DataModel matchingContactsModel = new ListDataModel();/* * Code below is added on for sorting. */private String _sort;private boolean _ascending;public SearchBean() {_sort = "lastname";_ascending = isDefaultAscending("lastname");}/* * This method is needed so consequtive clicks on header will sort  * asecending/descending/ascending/descending etc..*/public SearchBean(String defaultSortColumn) {_sort = defaultSortColumn;_ascending = isDefaultAscending(defaultSortColumn);}protected boolean isDefaultAscending(String sortColumn) {return true;}protected void sort(final String column, final boolean ascending) {Comparator comparator = new Comparator() {public int compare(Object o1, Object o2) {Contact c1 = (Contact) o1;Contact c2 = (Contact) o2;if (column == null) {return 0;}if (column.equals("firstname")) {return ascending ? c1.getFirstName().compareTo(c2.getFirstName()) : c2.getFirstName().compareTo(c1.getFirstName());} else if (column.equals("lastname")) {return ascending ? c1.getLastName().compareTo(c2.getLastName()) : c2.getLastName().compareTo(c1.getLastName());} else if (column.equals("ssn")) {return ascending ? c1.getSocialSecurityNumber().compareTo(c2.getSocialSecurityNumber()) : c2.getSocialSecurityNumber().compareTo(c1.getSocialSecurityNumber());} else if (column.equals("callbacknumber")) {return ascending ? c1.getCallBackNumber().compareTo(c2.getCallBackNumber()) : c2.getCallBackNumber().compareTo(c1.getCallBackNumber());} else if (column.equals("dateofbirth")) {return ascending ? c1.getDob().compareTo(c2.getDob()) : c2.getDob().compareTo(c1.getDob());}elsereturn 0;}};Collections.sort(matchingContacts, comparator);}public DataModel getMatchingContacts() {if ((matchingContactsModel == null)|| (matchingContactsModel.getRowCount() = 0)) {matchingContactsModel = new ListDataModel();matchingContactsModel.setWrappedData(matchingContacts);}sort(_sort, _ascending);return matchingContactsModel;}public void sort(String sortColumn) {if (sortColumn == null) {throw new IllegalArgumentException("Argument sortColumn must not be null.");}if (_sort.equals(sortColumn)) {// current sort equals new sortColumn - reverse sort order_ascending = !_ascending;} else {// sort new column in default direction_sort = sortColumn;_ascending = isDefaultAscending(_sort);}sort(_sort, _ascending);}public String getSort() {return _sort;}public void setSort(String sort) {_sort = sort;}public boolean isAscending() {return _ascending;}public void setAscending(boolean ascending) {_ascending = ascending;}}Finally in my jsp:h:form id="contactscrollerpagerform"t:saveState id="savesearchstate" value="#{search}" /h:panelGrid styleClass="scrollerTableNoBorder"h:columnt:dataTable id="contactsearchdata" var="contact"value="#{search.matchingContacts}" rows="7"rowId="#{contact.id}" sortColumn="#{search.sort}"sortAscending="#{search.ascending}" preserveSort="true"h:columnf:facet name="header"t:commandSortHeader columnName="lastname" arrow="true"immediate="false"h:outputText value="Last Name" //t:commandSortHeader/f:faceth:outputText value="#{contact.lastName}" //h:column h:columnf:facet name="header"t:commandSortHeader columnName="firstname" arrow="true"immediate="false"h:outputText value="First Name" //t:commandSortHeader/f:faceth:outputText value="#{contact.firstName}" //h:column  etc..I quote below what Simon wrote and point out how I that is realised in my code:"The "sortColumn" attribute should point to a backing bean property that is of type String. That property gets set (ie its setter gets called) with the columnName value of whatever column the user chose to sort on."So in above example, I have sortColumn="#{search.sort}". So my bean has a String called "_sort", and a "getSort()" and a "setSort(String)"."The "sortAscending" attribute should point to a backing bean property that is of type boolean. That property gets set to true/false when the user clicks repeatedly on the same column header (ie sorts asc/desc/asc/desc)."In my example, I have sortAscending="#{search.ascending}". So my beanhas a getAscending() and setAscending(boolean)"Your worklist.assignments method (ie the one referred to by the table's "value" attribute) is then required to look at the backing bean's properties that are the target of sortColumn and sortAscending and return its list in the order specified by those (String, boolean)"properties.In my example, I have 

Re: Getting sorting to work in data table -- header click does not call sort method

2005-12-30 Thread gramani
-Simon Kitching [EMAIL PROTECTED] wrote: -I think you're referring to issues about mapping javabean property names to getter/setter method names. This is indeed a bit complicated when the property name starts with a capital letter.However that does not apply in this case; the TD is a managed bean name not a property name.   Cheers,SimonOh, right you are: big duh on me..! Thanks, Geeta

Re: Javascript problems with inputDate with calendar enabled

2005-12-21 Thread gramani

Luiz Carlos Geron [EMAIL PROTECTED] wrote
on 12/21/2005 06:38:03 AM:

 I saw a page [1] on myfaces site saying that I need to use the extensions

 filter, so I added these lines to my web.xml:
 
 filter
 filter-nameMyFacesExtensionsFilter/filter-name
 
 filter-classorg.apache.myfaces.component.html.util.
 ExtensionsFilter/filter-class
   /filter
   filter-mapping
 filter-nameMyFacesExtensionsFilter/filter-name
 url-pattern*.faces/url-pattern
   /filter-mapping


Luiz, try adding this too as a filter mapping for
your MyFacesExtensionsFilter:
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
url-pattern/faces/*/url-pattern
/filter-mapping

I had trouble with my calendar till i added this..

 
 Thanks,
 Luiz Carlos Geron
 
 [1] http://myfaces.apache.org/tomahawk/extensionsFilter.html

Regards,
Geeta


Re: inputDate - no popupCalendar

2005-12-14 Thread gramani

Jan [EMAIL PROTECTED] wrote on
12/14/2005 03:24:51 PM:

 Hi,
 
 Does somebody know what's the trick to get inputDate or inputCalendar
 calendarpopup to work?
 What ever I try, the popup just doesn't show - no matter using Firefox
or
 IE.
 Are there special filters, config params something else to mention?
 
 I'm just using the following tag:
 t:inputDate id=recordalCreatedFor popupCalendar=true
 value=#{RecordalBackingBean.roBB.emptyRecordal.recordalCreatedFor}/
 
 I'm using tiles, subviews and divs - might this have something to
do with
 the failure?

Hi Jan, i just ran into this problem
which was solved by Mike Duffy who had just run into this problem..;) Here's
the solution:

You need the MyFaces extensions Filter:
(http://myfaces.apache.org/tomahawk/extensionsFilter.html).

 
 Jan :)
 
Good luck!
Geeta


Re: AW: inputDate - no popupCalendar

2005-12-14 Thread gramani

Jan [EMAIL PROTECTED] wrote on
12/14/2005 04:34:55 PM:

 Hi,
 
 unfortunately I already configured the extension
filter. 
 The Filter maps to /jsp/*, *.jsp, *.jsf, *.htm
. I tried everything.
 And it seems to work  the needed *.js files
are included.
 But somehow, the popup never pops up  
 (I have multiple forms on my page  is this
a problem?)
 
 What else can I do?

Here's what i have in my web.xml:
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
url-pattern*.jsf/url-pattern
/filter-mapping
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
url-pattern*.faces/url-pattern
/filter-mapping
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
url-pattern/faces/*/url-pattern
/filter-mapping

The last one was what i was missing..
Do you have them all?

 
 Jan :)

Geeta


Re: AW: AW: inputDate - no popupCalendar - solved

2005-12-14 Thread gramani

Jan [EMAIL PROTECTED] wrote on
12/14/2005 04:58:49 PM:

 hmm I thought these mappings have something in common with my own
used files.
 And I dont have files named *.faces and no
folder called faces.
 So I didnt include these filter mappings..
 Im pinky, not brain !
 
 
 AND YOU ARE THE KING OF THE DAY :)

Hmm.. always wondered how royalty'd feel.. So, make
that queen and we can both be happy!;) 

 
 Thank you  now it works :)
 
 Jan
 

Glad it works..:)
Geeta


Re: t:inputCalendar with renderPopup = true

2005-12-12 Thread gramani

Mike Duffy [EMAIL PROTECTED] wrote on
12/12/2005 01:00:28 PM:

 I just went through the same thing. 
 
 From a previous post:
 
 It would be a good idea to add a note to the documentation page for

 t:inputCalendar/
 (http://myfaces.apache.org/tomahawk/calendar.html), stating, This

 component requires the MyFaces'
 Extensions Filter (http://myfaces.apache.org/tomahawk/extensionsFilter.html).
 
 Good luck.
 
 Mike

Hi Mike, thanks for your reply! I remember this discussion
and in fact had earlier confirmed that i had the extensions filter configured
in my web.xml. After reading your note, I rechecked my web.xml and noticed
I only had:
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
url-pattern*.faces/url-pattern
/filter-mapping

I added this bit:
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
url-pattern/faces/*/url-pattern
/filter-mapping

.. and then ... yipee!!... things started
working right..:)

Thanks so much for steering me
right!
Geeta


Re: dataTable question

2005-12-08 Thread gramani

news [EMAIL PROTECTED] wrote on 12/08/2005
05:02:15 PM:

 hilz wrote:

 In other words... does the property that i bind to the outputText
have 
 to be a real bean property with a getter and a setter? or could it
be 
 just a getter (like what i showed in the example above) without the

 actual property and the setter.

I believe it is enough to have just a getter (if that's
all you want to do in your app).

 
 and to put the question in another form, is what i did a normal thing
to 
 do? or did it work just by coincidence?

So, no I don't think it worked just by coincidence..:)

 
 thanks

Regards,
Geeta


Re: f:verbatim problem

2005-12-07 Thread gramani

news [EMAIL PROTECTED] wrote on 12/07/2005
02:46:07 PM:

 Hi all...
 I have the following dataTable:
 
 
 h:dataTable binding=#{CreateInstance.dataTable1}
   id=dataTable1
   value=#{CreateInstance.dataTable1Model}
   var=currentRow 
 
   f:verbatim
colgroup
 col width=200px/
 col width=200px/
 col width=200px/
 col width=500px/
/colgroup
   /f:verbatim
 
  h:column .
 
 
 
 
 
 the colgroup element does not show up in the rendered html at all...
as 
 it if is ignored...
 i tried to remove the f:verbatim tags too, and it will still
not work
 does anyone know why is that? 

I think this will work: try putting stuff inside h:column
elements.. 

and how can i set he column widths?
 

Also, adding style class elements like 
h:dataTable
columnClasses=searchTable_Column
.. will get you the style you want..(make sure you declare the style sheet
up top).


 thanks
 

Regards,
Geeta


Re: f:verbatim problem

2005-12-07 Thread gramani

news [EMAIL PROTECTED] wrote on 12/07/2005
03:39:11 PM:

 
 Thanks for the answer Geeta
 Adding them in the h:column will show up in the html file,
but it 
 won't give the results i want. the table looks weird if i do that...
 
 I think the style suggestion is the way to go, but...now this turned

 into a style question!
 I hope you can still help me with that!
 so how do i specify the width of individual column in the style ?

Here's an example from
my jsp:

t:dataTable
id=items
var=assignment

  
 value=#{assignmentList.assignments}
rowCountVar=rowsCount
  
 headerClass=searchTable_Header
footerClass=searchTable_Footer
  
 columnClasses=searchTable_Column,searchTable_Column_Centered

   h:column

   f:facet
name=header

   
   h:outputText
value=Patient
Name /

   /f:facet

   h:outputText
value=#{assignment.contactName}
/

   /h:column

   h:column

   f:facet
name=header

   
   h:outputText
value=Activity/Call
/

   /f:facet

   h:outputText
value=#{assignment.urlForDisplay}
/

   /h:column
/t:dataTable


My style sheet has:
.searchTable_Column_Centered
{
font-family
: Arial,
Helvetica, verdana, Geneva, sans-serif;
font-size:
12px;
background-color:
#FF;
  color:
#00;
  padding:
2;
  text-align:
center;
  border:
none;
}
.searchTable_Column {
font-family
: Arial,
Helvetica, verdana, Geneva, sans-serif;
font-size:
12px;
font-weight:
bold;
background-color:
#FF;
  color:
#00;
  padding:
2;
  text-align:
left;
  border:
none;
}

(You should be able to add something
like width:760px
above to get the width you want).

And up top in my layout.jsp (I use tiles):

link
rel=stylesheet
  
 href=h:outputText
value=#{facesContext.externalContext.requestContextPath}/style/basic.css
/
/


Hth,
Geeta


Re: AW: WIKI article - How JSF State Management Works

2005-11-30 Thread gramani

Hi Mathias, I think your problem is similar
to mine. Mathias Brökelmann solved it:

http://www.mail-archive.com/users@myfaces.apache.org/msg11289.html

Regards,
Geeta

[EMAIL PROTECTED] wrote on 11/30/2005 12:50:18 PM:

 Hi!
 
 
 Many thanks for your response. I just implemented the Serializable
interface
 in my BackingBeans, but I get errors from JBoss now, saying that
 javax.faces.model.ListDataModel is not serializable. I need to use
 ListDataModel to wrap the java.util.List instances of data shown in
 dataTables.
 
 How did you solve that problem, if it had been a task for you?
 
 The problem has also been mentioned in the following post, but it
shows no
 concrete solutions for me.
 
 http://www.mail-archive.com/users@myfaces.apache.org/msg12092.html
 
 
 
 Regards,
 Matthias
 
  -Ursprüngliche Nachricht-
  Von: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]
Auftrag
  von Mike Kienenberger
  Gesendet: Dienstag, 29. November 2005 17:49
  An: MyFaces Discussion
  Betreff: Re: WIKI article - How JSF State Management Works
 
 
  I think JSF doesn't perform saveState on backing beans in this
  situation.  I'm not an expert on container session serialization,
but
  your container might attempt to serialize session-scoped backing
beans
  when the container shuts down or for clustering reasons.
 
  Again, I'm guessing somewhat on this as I've never really researched
  it.  If you want to be safe, always implement serializable.
 If it's
  not used, it only costs you a little code (just an implements
  statement in most cases). And if it's used (whether by
the container
  or JSF), then you don't have to worry about it.
 
  On 11/29/05, Matthias Kahlau [EMAIL PROTECTED] wrote:
   Hi!
  
  
   Yes, I use server-side state saving and session-scoped BackingBeans.
My
   BackingBeans don't have any superclasses, and don't implement
  Serializable
   or StateHolder directly. Referencing to your explanation,
the Container
   seems to manage the state saving. Is this really container
  dependent, that
   said, is it possible, that the app won't run in a different
  container. Do I
   have to implement Serializable in the BackingBeans, that
the app is
   container-independent, and will that be enough? (that isn't
  mentioned in the
   JSF book from Andy Bosch that I read, is that MyFaces specific?)
  
  
   Regards,
   Matthias
  
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
   
  [mailto:[EMAIL PROTECTED]
Auftrag
von Mike Kienenberger
Gesendet: Dienstag, 29. November 2005 17:24
An: MyFaces Discussion
Betreff: Re: WIKI article - How JSF State Management
Works
   
   
It's hard to comment without a specific use case.
   
You only have to implement Serializable or StateHolder
if you're going
to save the bean. Maybe you're not saving the
bean.  If you're using
server-side state management and session-scoped beans,
it'd depend on
your container whether they're saved.
   
If you're using client-side state management, they
should always
be saved.
   
Also, check your inheritance hierarchy. Perhaps
some base superclass
is already implementing Serializable.
   
On 11/29/05, Matthias Kahlau [EMAIL PROTECTED]
wrote:
 Hi!


 I have a question regarding a MyFaces WIKI article
about state
management.
 In the article is described, that BackingBeans
will have to
implement the
 Serializable interface or StateHolder. I neither
implement
Serializable, nor
 StateHolder, but my BackingBeans work. Isn't the
article
up-to-date, or is
 there some misunderstanding?

 http://wiki.apache.org/myfaces/How_JSF_State_Management_Works



 Regards,
 Matthias


  
  
 
 
 -- 
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 

 
 CONFIDENTIALITY NOTICE:This email is intended solely for the person

 or entity to which it is addressed and may contain confidential 
 and/or protected health information. Any duplication, 
 dissemination, action taken in reliance upon, or other use of this

 information by persons or entities other than the intended recipient
 is prohibited and may violate applicable laws. If this email
has 
 been received in error, please notify the sender and delete the 
 information from your system. The views expressed in this email
are
 those of the sender and may not necessarily represent the views of

 IntelliCare.

method of managed bean is not hit unless it is in session scope..?

2005-11-29 Thread gramani

I have a Shale/MyFaces/tiles application
which almost works. I have been staring at this so long I think
I'm confusing myself even further.. Here's my problem (which may or may
not be related to opening new windows using _javascript_):

I have the foll. code in worklist/nextAssignment.jsp:

h:commandLink
action=#{worklist$nextAssignmentHome.startAssignment}
immediate=true
h:outputText
value=#{assignment.urlDisplay}
/
/h:commandLink

The backing bean corresponding to worklist$nextAssignmentHome
is AssignmentBean. AssignmentBean.startAssignment()
returns the String twoWindows which maps to /twoWindows.jsp
which has _javascript_ so that a child window is opened. The idea is that
when people have finished their work on the child window, they will (close
it and) return to the parent window and click on a button/link which says
they are done.

The backing bean for twoWindows
is TwoWindowsBean.

Now in the parent window
I have the following:
h:commandLink
action=#{twoWindows.activityDone}
value=Done
/

This is what I have noticed: if the
managed bean twoWindows
has session scope then things work. However if it has request scope then
the activityDone method is not even hit. I am not sure why this is so..?

Thanks very much for your time,
Geeta


Re: Accessing a session-scoped backingbean

2005-11-18 Thread gramani

Bobby Rosenberger [EMAIL PROTECTED] wrote
on 11/18/2005 11:57:28 AM:

 Hey guys,
 
 I would like to access a session scoped backingbean (user)
from an
 actionListener... I'm currently doing something along the lines of:
 
 FacesContext context = FacesContext.getCurrentInstance();
 HttpServletRequest request = (HttpServletRequest)context.
 getExternalContext().getRequest();
 HttpSession session = request.getSession();
 UserBean user = (UserBean)session.getAttribute(user);
 
 Is there a better way?

If you use Shale, (and if your backing
bean extends AbstractViewController), then I believe you can simply say
getBean(user);

 
 Thanks,
 
 Bobby Rosenberger
 

Regards,
Geeta


Re: Accessing a session-scoped backingbean

2005-11-18 Thread gramani

Sorry, please ignore what i said.. didn't read your
question properly..sorry!
Geeta


Re: Accessing a session-scoped backingbean

2005-11-18 Thread gramani

[EMAIL PROTECTED] wrote on 11/18/2005 12:09:16 PM:

 
 Actually, that method *does* work as well, if your backing bean 
 extends Shale's AbstractViewController base class.

umm.. well, ok... I just figured I must be wrong seeing
as you didn't choose that answer..! (I guess your answer covers the more
general JSF way, yes..?)..

 
 Craig

Geeta


Re: Error at startup

2005-11-08 Thread gramani

sri [EMAIL PROTECTED] wrote on 11/08/2005
12:04:25 PM:

 Nov 8, 2005 11:18:47 AM org.apache.myfaces.config.FacesConfigurator

 feedClassloaderConfigurations
 INFO: Reading config jndi:C:\oc4j904Test\oc4j9.0.4.
 1\j2ee\home\applications\TestApp\web\WEB-INF\lib\myfaces.jar/META-
 INF/faces-config.xml

Hi Sri,

Is the META-INF directory supposed to contain a faces-config.xml?
Wondering if the wrong faces-config file is being read..? I
know a while ago I had a problem which (I think) was something like this
and soembody on google said the config file in the META-INF directory was
at fault and should be removed. Not sure this is your problem of course..!

Geeta


RE: Some notes of my loadtest results

2005-11-04 Thread gramani

CONNER, BRENDAN \(SBCSI\) [EMAIL PROTECTED]
wrote on 11/04/2005 10:16:25 AM:

 The app I'm working on is currently using 
 STATE_SAVING_METHOD=client, because, at the time our code was 
 written, that was the only way to handle the back-button (and pop-up
 windows) correctly. Can I assume from some of the notes that
have 
 been passed around that:
 
 1. We can now use STATE_SAVING_METHOD=server, and the back-button

 (and pop-up windows) will work correctly (e.g., when my pop-up 
 window closes, my base window won't have forgotten its state)?
 2. Using STATE_SAVING_METHOD=server is faster and thus recommended?
 
 Just wondering what the current state of affairs is regarding the

 tradeoffs between server and client state saving method.

+1 for this question..:) I have gone back and forth
between the two and now am not at all sure which is recommended under what
circumstances and why. I would also like to know, if MyFaces 1.1.1 is good
enough or the answer given, whatver it may be, pertains to the latest
nightly builds.

 
 - Brendan

thanks,
Geeta

Re: Question about serialization of backing beans

2005-11-02 Thread gramani

Mathias Brökelmann [EMAIL PROTECTED]
wrote on 11/02/2005 04:27:56 AM:

 I usually have a list field which contains the serializable row
 objects. This field is not transient. If you need the datamodel for
 the datatable use a transient field for this and check in the getter
 method for this field if the transient field and initialize it if
it
 is null. Doing so saves you a lot of time since writing the
 serialization is not required any more.

Thank you for your reply, Mathias! I knew I was working
way too hard.. I tried your idea and it works perfectly; thanks again!
:)

Regards,
Geeta


Question about serialization of backing beans

2005-11-01 Thread gramani

I have a Shale/MyFaces web app which
upon logon displays a worklist.jsp which has a t:datatable of assignment
links. I am using tomahawk's datatable with sorting and paging with preserveDataModel
as *false*. Also, I have STATE_SAVING_METHOD
as client, and my WorkListManagerBean
has scope of request. 

My WorkListManagerBean
has a ListDataModel called assignmentsModel and a List _assignments. _assignments
is a List of ShaleAssignment objects (I know, bad name!) which
implements Serializable (using default serialization).

In order to make everything work, I
have had to make WorkListManagerBean
implement Serializable. Seems to me I should declare _assignments and assignmentModel
transient and then write methods writeObject(ObjectOutputStream) and readObject(ObjectInputStream).
So, well, I did do all this, and everything seems to work fine. My question
is just this: is this the correct approach or am i working too hard?

Here are the details of my writeObject
and readObject methods:
private void writeObject(ObjectOutputStream
s) throws IOException{

.
//do default stuff first.. then:

List
shaleAs = (List) assignmentsModel.getWrappedData();
Object[]
shaleAsAsArray = shaleAs.toArray();
for
(int i=0; ishaleAsAsArray.length; i++) {

   s.writeObject(shaleAsAsArray[i]);
}

}
private void readObject(ObjectInputStream
s) throws IOException, ClassNotFoundException {

...
//do default stuff.. then:

for
(int i=0; isize; i++) {

   shaleAssignmentsAsArray[i] = (ShaleAssignment)
s.readObject();
}
_assignments
= Arrays.asList(shaleAssignmentsAsArray);

   
//
have to sort now I think..?
sort(_sort,
_ascending);
assignmentsModel
= new ListDataModel();
assignmentsModel.setWrappedData(_assignments);

}

Many thanks in advance for your help!
Regards,
Geeta

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

2005-10-31 Thread gramani

Myfaces..

Thanks again,
Geeta

Mathias Brökelmann [EMAIL PROTECTED]
wrote on 10/31/2005 04:29:56 AM:

 do you use sun´s ri or myfaces for the core jsf implementation?
 
 2005/10/30, [EMAIL PROTECTED] [EMAIL PROTECTED]:
 
  Thanks for your reply Mathias. I attach my bean code here. Please
note that
  the command links work correctly when within an ordinary
datatable with no
  paging/sorting. It was when i was attempting to see why that
I noticed the
  pattern of what looks like incorrectly computed rowIndices that
i mentioned
  earlier..
 
  Thanks again,
  Geeta
 
  Mathias Brökelmann [EMAIL PROTECTED] wrote
on 10/29/2005
  03:29:17 AM:
 
 
   Could you post your bean code?
  
   2005/10/29, [EMAIL PROTECTED] [EMAIL PROTECTED]:
   
So.. maybe I can ask this question differently..?
   
Has anybody made command links work within a
t:datatable with
  scrolling and
sorting also enabled (using tomahawk.jar's tags)?
If so would you
  please
post your code?
   
Many thanks in advance!
Geeta
   
[EMAIL PROTECTED] wrote on 10/28/2005 05:28:13
PM:
   
   

 Hi all:

 I am having trouble getting command
links to work correctly when I
 use tomahawk's t:dataTable for
scrolling and sorting. Briefly, the
 rowIndex doesn't seem to be correct:
I have breakpoints in my code
 which shows me that while rowCount
is correctly computed, for some
 reason rowIndex seems to be incorrectly
computed according to the
 foll. pattern:

 1. Page 1 has rows 1 to 5, the rowIndex
for all the links in this
  page is
4.
 2. Page 2 has rows 6 to 10, the rowIndex
for all the links in this
  page
is 9.
 3. Page 3 has rows 11 to 15 ,..and
yep,.. rowIndex for everything
  here is
14.

 int rowCount = assignmentsModel.getRowCount();
 int rowIndex = assignmentsModel.getRowIndex();

 However if I forget about the scrolling/sorting
features everything
 is calculated properly.

 Details: I downloaded the brand new
MyFaces1.1.1 just today. Also,
 my worklist bean (extends Shale's
AbstractViewController) has
 request scope, and STATE_SAVING_METHOD
is server, returns a
 ListDataModel for its getAssignments()
method.

 More details:
 My jsp code pretty much follows what
is in the simple examples
 pagedSortTable.jsp:

 h:form id=form1
 t:saveState
id=worklist value=#{worklist} /
 t:dataTable
 
   id=items
 
   styleClass=scrollerTable
 
   headerClass=standardTable_Header
 
   footerClass=standardTable_Header

rowClasses=standardTable_Row1,standardTable_Row2

  columnClasses=standardTable_Column,
 standardTable_ColumnCentered,standardTable_Column
 
   var=assignment
 
   value=#{worklist.assignments}
 
   preserveDataModel=true
 
   rows=5
 
   rowId=#{assignment.activityKey}
 
   sortColumn=#{worklist.sort}
 
   sortAscending=#{worklist.ascending}
 
   preserveSort=true
 
   

 h:column
 
   f:facet name=header
 
  
t:commandSortHeader
  columnName=name
arrow=
 true immediate=false
 
  
h:outputText
  value=Assignment
/
 
  
/t:commandSortHeader
 
   /f:facet
 
   h:commandLink rendered=#{assignment.
 startPhoneAssignment}

action="">
 immediate=false
 
  
h:outputText
value=#{assignment.activityKey}
  /
 
   /h:commandLink
 
   /h:column

 etc.

 thanks very much for all help!
 Geeta
  
   --
   Mathias
 
 
 
 
 
 
 --
 Mathias
 
 -- 
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 

 
 CONFIDENTIALITY NOTICE:This email is intended solely for the person

 or entity to which it is addressed and may contain confidential 
 and/or protected health information. Any duplication, 
 dissemination, action taken in reliance upon, or other use of this

 information by persons or entities other than the intended recipient
 is prohibited and may violate applicable laws. If this email
has 
 been received in error, please notify the sender and delete the 
 information from your system. The views expressed in this email
are
 those of the sender and may not necessarily represent the views of

 IntelliCare.

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

2005-10-31 Thread gramani

Mathias Brökelmann [EMAIL PROTECTED]
wrote on 10/31/2005 08:35:43 AM:

 the problem is a little bit tricky ;)
 
 If you use preserveDataModel=true the value of your datamodel
is not
 requested until in the renderphase and will not be used for iteration
 and setting rowindex. This is the reason why you don´t get a valid
 value for your rowindex and rowdata in process application phase.
I
 suggest you to change your jsp/bean code into one of the following
 way:
 
 - implement your action method into a WfAssignment wrapper class and
 use instances of it in your datamodel. Change your jsp code to call
 this action method in the wrapped class.
 
 - don´t use preserveDataModel and make sure that your getter method
of
 the datamodel returns a non null or empty value during the decode
 phase.
 
 - provide a setter method for your datamodel. This method is being
 called in the update model phase to set the preserved datamodel. The
 preserved datamodel will only contain the values for the rendered
 page.
 

Thanks very much for your response. I shall try each
of your ideas in turn. But I do have another question. You say using preserveDataModel=true
means that the value of the datamodel is not requested till the render
phase. Does this explain why the rowIndex *always* is one less than the
index of the largest index of the item currently shown? (I mean all pages
have 5 items shown, and page1 has rowindex of all items as 4, page 2 has
rowindex of all items as 9, page 3 has rowindex of all items as 14.. I
can accept I think that rowindex can have wrong values but seems wierd
that the the wrong values are following a pattern, and worse, always returning
a constant (per page). Of course I am quite new with all this so I am probably
missing something quite basic..

Thank you for your continued interest and time - I
really appreciate it!
Geeta


Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

2005-10-31 Thread gramani

Mathias Brökelmann [EMAIL PROTECTED]
wrote on 10/31/2005 08:35:43 AM:

 the problem is a little bit tricky ;)
 
 If you use preserveDataModel=true the value of your datamodel
is not
 requested until in the renderphase and will not be used for iteration
 and setting rowindex. This is the reason why you don´t get a valid
 value for your rowindex and rowdata in process application phase.
I
 suggest you to change your jsp/bean code into one of the following
 way:
 
 - implement your action method into a WfAssignment wrapper class and
 use instances of it in your datamodel. Change your jsp code to call
 this action method in the wrapped class.
 
 - don´t use preserveDataModel and make sure that your getter method
of
 the datamodel returns a non null or empty value during the decode
 phase.
 
 - provide a setter method for your datamodel. This method is being
 called in the update model phase to set the preserved datamodel. The
 preserved datamodel will only contain the values for the rendered
 page.

For the sake of completeness of this thread, I want
to let you know a combination of your suggestions worked Mathias.:) I didn't
use preserveDatModel and also provided a setter for my datamodel - and
now the rowIndex is calculated correctly and things work great!

Thank you again for yout time!
Geeta



Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

2005-10-30 Thread gramani

Thanks for your reply Mathias. I attach
my bean code here. Please note that the command links work correctly when
within an ordinary datatable with no paging/sorting. It was
when i was attempting to see why that I noticed the pattern of what looks
like incorrectly computed rowIndices that i mentioned earlier..

Thanks again,
Geeta

Mathias Brökelmann [EMAIL PROTECTED]
wrote on 10/29/2005 03:29:17 AM:

 Could you post your bean code?
 
 2005/10/29, [EMAIL PROTECTED] [EMAIL PROTECTED]:
 
  So.. maybe I can ask this question differently..?
 
  Has anybody made command links work within a t:datatable
with scrolling and
  sorting also enabled (using tomahawk.jar's tags)? If so would
you please
  post your code?
 
  Many thanks in advance!
  Geeta
 
  [EMAIL PROTECTED] wrote on 10/28/2005 05:28:13 PM:
 
 
  
   Hi all:
  
   I am having trouble getting command links to work
correctly when I
   use tomahawk's t:dataTable for scrolling and sorting.
Briefly, the
   rowIndex doesn't seem to be correct: I have breakpoints
in my code
   which shows me that while rowCount is correctly computed,
for some
   reason rowIndex seems to be incorrectly computed according
to the
   foll. pattern:
  
   1. Page 1 has rows 1 to 5, the rowIndex for all the
links in this page is
  4.
   2. Page 2 has rows 6 to 10, the rowIndex for all the
links in this page
  is 9.
   3. Page 3 has rows 11 to 15 ,..and yep,.. rowIndex
for everything here is
  14.
  
   int rowCount = assignmentsModel.getRowCount();
   int rowIndex = assignmentsModel.getRowIndex();
  
   However if I forget about the scrolling/sorting features
everything
   is calculated properly.
  
   Details: I downloaded the brand new MyFaces1.1.1 just
today. Also,
   my worklist bean (extends Shale's AbstractViewController)
has
   request scope, and STATE_SAVING_METHOD is server,
returns a
   ListDataModel for its getAssignments() method.
  
   More details:
   My jsp code pretty much follows what is in the simple
examples
   pagedSortTable.jsp:
  
   h:form id=form1
   t:saveState id=worklist
value=#{worklist} /
   t:dataTable
  
id=items
  
styleClass=scrollerTable
  
headerClass=standardTable_Header
  
footerClass=standardTable_Header
  
  rowClasses=standardTable_Row1,standardTable_Row2
  
columnClasses=standardTable_Column,
   standardTable_ColumnCentered,standardTable_Column
  
var=assignment
  
value=#{worklist.assignments}
  
preserveDataModel=true
  
rows=5
  
rowId=#{assignment.activityKey}
  
sortColumn=#{worklist.sort}
  
sortAscending=#{worklist.ascending}
  
preserveSort=true
  

  
   h:column
  
f:facet name=header
  
t:commandSortHeader
columnName=name
  arrow=
   true immediate=false
  
  
 h:outputText value=Assignment
  /
  
/t:commandSortHeader
  
/f:facet
  
h:commandLink rendered=#{assignment.
   startPhoneAssignment}
  
  action="">
   immediate=false
  
h:outputText
  value=#{assignment.activityKey}
/
  
/h:commandLink
  
/h:column
  
   etc.
  
   thanks very much for all help!
   Geeta
 
 --
 Mathias


 

WorkListManagerBean.java
Description: Binary data


Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

2005-10-28 Thread gramani

Hi all:

I am having trouble getting command
links to work correctly when I use tomahawk's t:dataTable
for scrolling and sorting. Briefly, the rowIndex doesn't seem to be correct:
I have breakpoints in my code which shows me that while rowCount is correctly
computed, for some reason rowIndex seems to be incorrectly computed according
to the foll. pattern:

1. Page 1 has rows 1 to 5, the rowIndex
for all the links in this page is 4.
2. Page 2 has rows 6 to 10, the rowIndex
for all the links in this page is 9.
3. Page 3 has rows 11 to 15 ,..and yep,..
rowIndex for everything here is 14. 

int rowCount = assignmentsModel.getRowCount();
int rowIndex = assignmentsModel.getRowIndex();

However if I forget about the scrolling/sorting
features everything is calculated properly.

Details: I downloaded the brand new
MyFaces1.1.1 just today. Also, my worklist bean (extends Shale's AbstractViewController)
has request scope, and STATE_SAVING_METHOD
is server, returns a ListDataModel for its getAssignments() method.

More details:
My jsp code pretty much follows what
is in the simple examples pagedSortTable.jsp:

h:form
id=form1
t:saveState
id=worklist
value=#{worklist}
/
t:dataTable

  
 id=items

  
 styleClass=scrollerTable
  
 headerClass=standardTable_Header

  
 footerClass=standardTable_Header
  
 rowClasses=standardTable_Row1,standardTable_Row2
  
 columnClasses=standardTable_Column,standardTable_ColumnCentered,standardTable_Column
  
 var=assignment

  
 value=#{worklist.assignments}

   preserveDataModel=true
  
 rows=5
  
 rowId=#{assignment.activityKey}

   sortColumn=#{worklist.sort}

   sortAscending=#{worklist.ascending}


   preserveSort=true

  
 

h:column

   f:facet
name=header

   
   t:commandSortHeader
columnName=name
arrow=true
immediate=false

   
   h:outputText
value=Assignment
/

   
   /t:commandSortHeader

   /f:facet

   h:commandLink
rendered=#{assignment.startPhoneAssignment}

   
   action=#{worklist.acceptPhoneAssignment}
immediate=false

   
   h:outputText
value=#{assignment.activityKey}
/

   /h:commandLink

   /h:column

etc.

thanks very much for all help!
Geeta


Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

2005-10-28 Thread gramani

So.. maybe I can ask this question differently..?


Has anybody made command links work
within a t:datatable with scrolling and sorting also enabled (using
tomahawk.jar's tags)? If so would you please post your code?

Many thanks in advance!
Geeta

[EMAIL PROTECTED] wrote on 10/28/2005 05:28:13
PM:

 
 Hi all: 
 
 I am having trouble getting command links to work correctly when I

 use tomahawk's t:dataTable for scrolling and sorting. Briefly,
the 
 rowIndex doesn't seem to be correct: I have breakpoints in my code

 which shows me that while rowCount is correctly computed, for some

 reason rowIndex seems to be incorrectly computed according to the

 foll. pattern: 
 
 1. Page 1 has rows 1 to 5, the rowIndex for all the links in this
page is 4. 
 2. Page 2 has rows 6 to 10, the rowIndex for all the links in this
page is 9.
 3. Page 3 has rows 11 to 15 ,..and yep,.. rowIndex for everything
here is 14. 
 
 int rowCount = assignmentsModel.getRowCount(); 
 int rowIndex = assignmentsModel.getRowIndex(); 
 
 However if I forget about the scrolling/sorting features everything

 is calculated properly. 
 
 Details: I downloaded the brand new MyFaces1.1.1 just today. Also,

 my worklist bean (extends Shale's AbstractViewController) has 
 request scope, and STATE_SAVING_METHOD is server, returns a 
 ListDataModel for its getAssignments() method. 
 
 More details: 
 My jsp code pretty much follows what is in the simple
examples 
 pagedSortTable.jsp: 
 
 h:form id=form1 
 t:saveState id=worklist
value=#{worklist} / 
 t:dataTable 
 id=items

 styleClass=scrollerTable

 headerClass=standardTable_Header

 footerClass=standardTable_Header

 rowClasses=standardTable_Row1,standardTable_Row2

 columnClasses=standardTable_Column,
 standardTable_ColumnCentered,standardTable_Column 
 var=assignment

 value=#{worklist.assignments}

 preserveDataModel=true

 rows=5

 rowId=#{assignment.activityKey}

 sortColumn=#{worklist.sort}

 sortAscending=#{worklist.ascending}

 preserveSort=true

  
 
 h:column 
  
  f:facet name=header 
  
  t:commandSortHeader columnName=name
arrow=
 true immediate=false 
  
  h:outputText
value=Assignment / 
  
  /t:commandSortHeader

  
  /f:facet 
  
  h:commandLink rendered=#{assignment.
 startPhoneAssignment} 
  
  action=""

 immediate=false 
  
  h:outputText value=#{assignment.activityKey}
  / 
  
  /h:commandLink 
 /h:column

 
 etc. 
 
 thanks very much for all help! 
 Geeta 
 
 -- 
 This message has been scanned for viruses and 
 dangerous content by MailScanner, and is 
 believed to be clean. 
 
 CONFIDENTIALITY NOTICE:This email is intended solely for the person

 or entity to which it is addressed and may contain confidential 
 and/or protected health information. Any duplication, 
 dissemination, action taken in reliance upon, or other use of this

 information by persons or entities other than the intended recipient
 is prohibited and may violate applicable laws. If this email
has 
 been received in error, please notify the sender and delete the 
 information from your system. The views expressed in this email
are
 those of the sender and may not necessarily represent the views of

 IntelliCare.

Re: Value binding - exception: can somone explain?

2005-10-21 Thread gramani

Not sure but aren't you mixing up firstName
and surname maybe..?
Geeta

Jeffrey Porter [EMAIL PROTECTED]
wrote on 10/21/2005 11:47:45 AM:

 
 Hello all again,
 
 Ive got the following tag in my JSP. UserController.user.surname

 is a string. 
 
 h:inputText id=enteredByUID value=#{UserController.user.surname}

 maxlength=20 size=20 required=true
/
 
 But I get an exception when I try to save the
page.
 
 javax.faces.el.EvaluationException: Cannot set
value for _expression_ 
 '#{UserController.user.firstName}' to a new value of type java.lang.String
 
 Anyone got any ideas? Or am I being an idiot
again and missing the obvious?
 
 Jeff
 

RE: Value binding - exception: can somone explain?

2005-10-21 Thread gramani

Jeffrey Porter [EMAIL PROTECTED]
wrote on 10/21/2005 12:04:27 PM:

 Opps, typo. I moved some code around to try firstname. Both fail though.
 
 Let me test one more time
 
 JSP
 h:inputText id=enteredByUID value=#{UserController.user.
 surname} maxlength=20 size=20 required=true
/ 

 Code
   public String getSurname() {
 return surname;
   }
 
 
 Error
 None.
 
 Oh great, so I reboot the box  it works.
Didnt even recompile the 
 code, argh.  :-|
 
 Ill be over in the corner hiding my face in
shame.

naaahhh... All's allowed on a Friday..;))

 
 Jeff.
 

Geeta


Re: Error starting App listeners

2005-10-20 Thread gramani

[EMAIL PROTECTED] wrote on 10/20/2005
02:18:26 AM:

 Hi,
 
 We are moving from Sun RI to MyFaces. However,
when I deploy my 
 application on Jboss, I get the following error. Can anyone throw

 some light on this error.
 I have cross checked all my deployment file and
it does not refer 
 to the sun's listeners. 
 
 Thanks
 Bala
 
 11:10:26,828 ERROR [[/QuantumFramework]] Error
configuring 
 application listener of class com.sun.faces.config.ConfigureListener
 java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
 at org.apache.catalina.loader.WebappClassLoader.

I recently did exactly this and got this error too.
I solved it (as others have mentioned) by making sure none of sun's implementation
jars were present in the classpath (double check your WEB-INF/lib directory),
and then doing a complete rebuild. Also you may want to delete all your
old compiled jsps in your work directory before you restart tomcat.

Hope this helps,
Geeta


Re: IF statement..?

2005-10-20 Thread gramani

[EMAIL PROTECTED] wrote on 10/20/2005 01:50:37
PM:

 
 Jeffrey Porter [EMAIL PROTECTED]
wrote on 
 10/20/2005 01:45:04 PM:
 
   
   
  Does MyFaces contain an IF statement? 
   
  Something like 
   
  x:if user.admin == true  
  h:outputLabel value=ADMIN / 
  x:else  
  h:outputLabel value=NOT ADMIN / 
  /x 
   
   
  I would put my IF statement in JSP. 
  But this doesnt seem to work. 
   
  For example 
   
  %=user.admin% 
   
 
 You should I think be able to use the rendered attribute
within 
 h:outputLabel..? As in: 
 h:outputLabel value=ADMIN rendered=user.admin
/ 
 

umm,.. sorry.. I meant:
rendered=#{user.admin}

 Geeta 


Re: Problem with t:commandSortHeader within t:dataTable

2005-10-19 Thread gramani

Simon Kitching [EMAIL PROTECTED] wrote
on 10/18/2005 05:25:13 PM:

 
 The sortColumn attribute should point to a backing bean
property that 
 is of type String. That property gets set (ie its setter gets called)

 with the columnName value of whatever column the user chose to sort
on.
 
 The sortAscending attribute should point to a backing
bean property 
 that is of type boolean. That property gets set to true/false when
the 
 user clicks repeatedly on the same column header (ie sorts 
 asc/desc/asc/desc).
 
 Your worklist.assignments method (ie the one referred to by the table's

 value attribute) is then required to look at the backing
bean's 
 properties that are the target of sortColumn and sortAscending and

 return its list in the order specified by those (String, boolean)

 properties.
 
 I hope that's the info you were looking for.

Thanks very much, Simon! This is exactly the information
I was looking for - my sorting works now..:)

 
 Regards,
 
 Simon
 

Geeta


Problem with t:commandSortHeader within t:dataTable

2005-10-18 Thread gramani

I just started working with myFaces
(and tomahawk) for the past couple of days and so I apologize if this question
is really basic.

Here's what I have:

A (Shale) backing bean called worklist
with:
private DataModel assignmentsModel =
new ListDataModel();
..etc..
private List _assignments;
..etc..
public String getWorkList() {
//do
some work to populate_assignments ..then..
assignmentsModel.setWrappedData(_assignments);
}
finally,
public DataModel getAssignments() {
return
assignmentsModel;
}

I display my worklist in worklist.jsp
and everything works great.

Now I want to introduce sorting into
my table and therefore looked into t:commandSortHeader
working within a t:dataTable. I think I'm supposed to have something
like this in my worklist.jsp:

t:dataTable
id=items
value=#{worklist.assignments}

   var=assignment
sortColumn=#{worklist.sort}

   sortAscending=#{worklist.ascending}
preserveDataModel=true
  
 preserveSort=true


   h:column

   f:facet
name=header

   
   t:commandSortHeader
columnName=name
arrow=true

   
   h:outputText
value=Assignment
/

   
   /t:commandSortHeader

   /f:facet
etc..

So I added methods getSort(), isAscending(),
sort (final String column, final boolean ascending) etc. to my worklist
backingbean (using sample code from MyFaces' listexample as
a guide). My worklist.jsp page does display with the little arrow but clicking
on it returns me to the same page (though the arrow faces the opposite
way upon click - yeah!!), however, no sorting happens, which is no major
surprise since my bean's sorting method isn't even hit..(:(

So my questions are:
0. Is my approach all wrong and should
Ibe doing everything differently?
1. Does anybody see what i'm doing wrong?
2. Where should I add breakpoints to
see what I'm messing up? (My code doesn't even hit the sort method in my
backing bean.)

Thanks very much in advance!
Geeta

Re: Tiles standalone

2005-10-04 Thread gramani

Here's a bare-bones you can download
Shale/jsf app with tiles integration:

http://www.sightsoftware.com/shale/

But please use at your own risk..:)

Geeta

Sean Schofield [EMAIL PROTECTED] wrote
on 10/04/2005 11:06:49 AM:

 I've used the Tiles addon from both MyFaces and Shale JSF and they
 both work fine. Facelets might be nice but it has nothing to
do with
 whether or not Tiles will work with JSF (which it does.)
 
 sean
 
 On 10/4/05, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote:
 
  We're using Tiles with JSF quite successfully, although the JAR
file we're
  using is struts.jar (not stand-alone Tiles). Most books
on JSF (e.g., Core
  JavaServer Faces and O'Reilly's JavaServer Faces) have a chapter
on using
  Tiles with JSF.
 
  I haven't looked into facelets, though, so that could well be
better
 
  - Brendan
 
 
 
  -Original Message-
  From: Andrew robinson [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, October 04, 2005 9:22 AM
  To: MyFaces Discussion; Rafael Nami
  Subject: Re: Tiles standalone
 
  Don't attempt to use Tiles with JSF, it is kluged and messy.
Use facelets
  instead, they have much better fuctionality for integration with
JSF.
 
  https://facelets.dev.java.net/
 
 
 
 
  On 10/4/05, Rafael Nami [EMAIL PROTECTED] wrote:
   Hi everyone.
  
   I was trying to search some info about tiles standalone,
but I
   couldn't find anything in apache jakarta site. Where can
i find such
   info?
   What is the compatibility with JSF/MyFaces?
  
   Thanks in advance
  
   Rafael Mauricio Nami
  
 
 
 
 -- 
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 

 
 CONFIDENTIALITY NOTICE:This email is intended solely for the person

 or entity to which it is addressed and may contain confidential 
 and/or protected health information. Any duplication, 
 dissemination, action taken in reliance upon, or other use of this

 information by persons or entities other than the intended recipient
 is prohibited and may violate applicable laws. If this email
has 
 been received in error, please notify the sender and delete the 
 information from your system. The views expressed in this email
are
 those of the sender and may not necessarily represent the views of

 IntelliCare.

Re: Colspan and h:panelGrid

2005-10-04 Thread gramani

Hi,

Check this example out: http://www.exadel.com/tutorial/jsf/jsftags-guide.html

I think the example under UIPanel
should give you the answer.

Geeta

hicham abassi [EMAIL PROTECTED] wrote on 10/04/2005
03:02:02 PM:

 Hello,
 
 i have a form with a h:panelgrid for my label,input,message
components
 
 h:panelGrid columns=3
 
 h:ouputLabel for="">
 h:inputText id=inputName ...
 h:message for="" ...
 
 i want here to put 2 set of components here for example postal code
 and town without disturbing the alignement of above components
 
 h:panelGrid columns=6
   h:ouputLabel for="" ...
   h:inputText id=inputPC ...
   h:message for="" 
 
   h:ouputLabel for="" ...
   h:inputText id=inputTown ...
  h:message for="">
 /h:panelGrid
 h:panelGroup/
 h:panelGroup/
 
 Problem : the input and message of the first row are moved to the
right
 
 
 
 /h:panelGrid
 
 
 
 Is there a way to do colspan on h:panelGrid row ?
 
 Thanks.
 
 
 
 
 
 --
 
 hicham ABASSI
 [EMAIL PROTECTED]
 
 -- 
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 

 
 CONFIDENTIALITY NOTICE:This email is intended solely for the person

 or entity to which it is addressed and may contain confidential 
 and/or protected health information. Any duplication, 
 dissemination, action taken in reliance upon, or other use of this

 information by persons or entities other than the intended recipient
 is prohibited and may violate applicable laws. If this email
has 
 been received in error, please notify the sender and delete the 
 information from your system. The views expressed in this email
are
 those of the sender and may not necessarily represent the views of

 IntelliCare.

Re: NotSerializableException

2005-09-30 Thread gramani

Martin Marinschek [EMAIL PROTECTED]
wrote on 09/30/2005 12:11:59 PM:

 A very nice summary of the topic!
 
 Why don't you integrate this summary somewhere on the WIKI - where
it fits?
 
 We need more commentary like this on the WIKI!

+1!! my email MyFaces-save subfolder is
getting filled up ...;)

 
 regards,
 
 Martin

Geeta