Re: t:dataTable using problem

2006-08-10 Thread vasiliy.kiryanov

Are you asking how to convert this jsp code into JSF components? 
two days ago i was seeking for best aproach. Now I see that I was need to
convert my code JSF component.
I have done it using DataTable. 

thank you.
-- 
View this message in context: 
http://www.nabble.com/t%3AdataTable-using-problem-tf2073378.html#a5739289
Sent from the MyFaces - Users forum at Nabble.com.



t:buffer doesn't work

2006-08-10 Thread vasiliy.kiryanov

Good morning.

I have next working code:
t:dataTable 
styleClass=standardTable
headerClass=cellk
footerClass=cellk
rowClasses=celltce
cellspacing=1
cellpadding=1
width=95%
var=customer
   
value=#{ReportingBackBean.customersValuesAsCollection}
preserveDataModel=false
preserveSort=false

f:facet name=header
h:outputText value=monthly reporting /
/f:facet

h:column
f:facet name=header
h:outputText value=#{bundle.reporting_id}
/
/f:facet
h:outputText value=#{customer.customerCppk}/
 
/h:column
h:column
f:facet name=header
h:outputText
value=#{bundle.reporting_customerName} /
/f:facet
h:outputText value=#{customer.customerName} /
/h:column
h:column
f:facet name=header
h:outputText
value=#{bundle.reporting_components} /
/f:facet
h:outputText
value=#{customer.componentsNumberAsString} escape=false/
/h:column
h:column
f:facet name=header
h:outputText
value=#{bundle.reporting_typeOfContract} /
/f:facet
h:outputText value=#{customer.contractType} /
/h:column
h:column
f:facet name=header
h:outputText
value=#{bundle.reporting_numerOfLicenses} /
/f:facet
h:outputText value=#{customer.licensesNumber} /
/h:column
h:column
f:facet name=header
h:outputText
value=#{bundle.reporting_typeOfSubscription} /
/f:facet
h:outputText value=#{customer.subscriptionType}
/
/h:column
h:column
f:facet name=header
h:outputText
value=#{bundle.reporting_Group_Coefficient} /
/f:facet
h:outputText value=#{customer.groupCoefficient}
/
/h:column
h:column
f:facet name=header
h:outputText
value=#{bundle.reporting_Price} /
/f:facet
h:outputText value=#{customer.offeringPrice} /
/h:column

/t:dataTable
---

Then when I surrounds it with 
t:buffer into=DataExportBackBean.htmlBuffer
/t:buffer

I see that t:buffer write null to htmlBuffer variable. Therefore I don't
add t:output because it can;t output null.

does somebody have ideas?
thank you.




-- 
View this message in context: 
http://www.nabble.com/%3Ct%3Abuffer%3E-doesn%27t-work-tf2083070.html#a5739373
Sent from the MyFaces - Users forum at Nabble.com.



Compare two password fields with a validator

2006-08-10 Thread Tom Serru

Hi,

Is there a way to create a validator to compare two fields (like a password
and a password check field) ? I would like to have something like this as
result:

...
h:inputSecret id=password
f:validator validatorId=CompareFields otherField=passwordCheck/
/h:inputSecret
...
h:inputSecret id=passwordCheck
...

Thx...
-- 
View this message in context: 
http://www.nabble.com/Compare-two-password-fields-with-a-validator-tf2083442.html#a5740422
Sent from the MyFaces - Users forum at Nabble.com.



Re: Compare two password fields with a validator

2006-08-10 Thread Murat Hazer
There is a sandbox compareTo componenent, you can try itregards...On 8/10/06, Tom Serru [EMAIL PROTECTED]
 wrote:Hi,Is there a way to create a validator to compare two fields (like a password
and a password check field) ? I would like to have something like this asresult:...h:inputSecret id=passwordf:validator validatorId=CompareFields otherField=passwordCheck/
/h:inputSecret...h:inputSecret id=passwordCheck...Thx...--View this message in context: 
http://www.nabble.com/Compare-two-password-fields-with-a-validator-tf2083442.html#a5740422Sent from the MyFaces - Users forum at Nabble.com.
-- Murat HAZERElektrik-Elektronik Mühendisi - Electrical-Electronics EngineerBlog URL: http://www.projedunyasi.org


RE: Compare two password fields with a validator

2006-08-10 Thread Robert Locklear
http://myfaces.apache.org/tomahawk/validateEqual.html 

Thanks,
Robert
-Original Message-
From: Tom Serru [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 10, 2006 10:32 AM
To: users@myfaces.apache.org
Subject: Compare two password fields with a validator


Hi,

Is there a way to create a validator to compare two fields (like a
password
and a password check field) ? I would like to have something like this
as
result:

...
h:inputSecret id=password
f:validator validatorId=CompareFields
otherField=passwordCheck/
/h:inputSecret
...
h:inputSecret id=passwordCheck
...

Thx...
-- 
View this message in context:
http://www.nabble.com/Compare-two-password-fields-with-a-validator-tf208
3442.html#a5740422
Sent from the MyFaces - Users forum at Nabble.com.



characters encoding problems?

2006-08-10 Thread David Delbecq
Hello, i have got a characters encoding problem here. In my java code i 
have  this


UISelectOne selectDocumentType = 
(UISelectOne)application.createComponent(HtmlSelectOneRadio.COMPONENT_TYPE);

.
selectDocumentType.getAttributes().put(onchange, alert(\'Cliqué\'););

When the radio group is rendered, i get this:
input type=radio name= value=3 
onchange=alert('Cliqu#195;#169;'); /


As you can see, when rendering, Myfaces did convert my one character 
('é') to 2 html entities (#195;#169;), which obviously renders wrong 
on screen. Of course,  #195;#169; is the 2 byte utf-8 for the 
character 'é' but it should be encoded a a 2byte entity, not 2 one byte 
entities.

Why this behaviour? How to fix it?

Note i use myfaces


Page with dynamically changed structure

2006-08-10 Thread Dmitry Y. Shyshkin

I have a jsf page, that includes other pages depend on application state:

t:div rendered=#{mainMenuHandler.results}
[EMAIL PROTECTED] file=results.jsp%
/t:div

t:div rendered=#{mainMenuHandler.orders}
[EMAIL PROTECTED] file=orders.jsp%
/t:div

t:div rendered=#{mainMenuHandler.patientData}
[EMAIL PROTECTED] file=patientData.jsp%
/t:div

results.jsp, orders.jsp, patientData.jsp have many jsp code. And it 
executed even if rendered attribute is false. So I decide rewrite this 
to follow code:


% MainMenuHandler  mainMenuHandler = ... ;%

% if (mainMenuHandler.isResults()) { %
t:div 
[EMAIL PROTECTED] file=results.jsp%
/t:div
% } %

% if (mainMenuHandler.isOrders()) { %
t:div 
[EMAIL PROTECTED] file=orders.jsp%
/t:div
% } %

% if (mainMenuHandler.isPatientData()) { %
t:div 
[EMAIL PROTECTED] file=patientData.jsp%
/t:div
% } %

But when status is changed (for example isResults() switch from false to 
true) I recieved an error: Component with dublicate id in tree 
Is this a bug in my-faces or tree structure in jsf page can't be changed 
dynamically?


Re: t:buffer doesn't work

2006-08-10 Thread Torsten Krah
Have you tried to to it like in the example from t:buffer?

t:buffer into=#{mytable} /

kind regards

Am Donnerstag, den 10.08.2006, 00:10 -0700 schrieb vasiliy.kiryanov:
 Good morning.
 
 I have next working code:
   t:dataTable 
   styleClass=standardTable
 headerClass=cellk
 footerClass=cellk
 rowClasses=celltce
 cellspacing=1
 cellpadding=1
 width=95%
 var=customer

 value=#{ReportingBackBean.customersValuesAsCollection}
 preserveDataModel=false
 preserveSort=false
 
 f:facet name=header
 h:outputText value=monthly reporting /
 /f:facet
 
 h:column
 f:facet name=header
 h:outputText value=#{bundle.reporting_id}
 /
 /f:facet
 h:outputText value=#{customer.customerCppk}/  

 /h:column
 h:column
 f:facet name=header
 h:outputText
 value=#{bundle.reporting_customerName} /
 /f:facet
 h:outputText value=#{customer.customerName} /
 /h:column
 h:column
 f:facet name=header
 h:outputText
 value=#{bundle.reporting_components} /
 /f:facet
 h:outputText
 value=#{customer.componentsNumberAsString} escape=false/
 /h:column
 h:column
 f:facet name=header
 h:outputText
 value=#{bundle.reporting_typeOfContract} /
 /f:facet
 h:outputText value=#{customer.contractType} /
 /h:column
 h:column
 f:facet name=header
 h:outputText
 value=#{bundle.reporting_numerOfLicenses} /
 /f:facet
 h:outputText value=#{customer.licensesNumber} /
 /h:column
 h:column
 f:facet name=header
 h:outputText
 value=#{bundle.reporting_typeOfSubscription} /
 /f:facet
 h:outputText value=#{customer.subscriptionType}
 /
 /h:column
 h:column
 f:facet name=header
 h:outputText
 value=#{bundle.reporting_Group_Coefficient} /
 /f:facet
 h:outputText value=#{customer.groupCoefficient}
 /
 /h:column
 h:column
 f:facet name=header
 h:outputText
 value=#{bundle.reporting_Price} /
 /f:facet
 h:outputText value=#{customer.offeringPrice} /
 /h:column
 
 /t:dataTable
 ---
 
 Then when I surrounds it with 
 t:buffer into=DataExportBackBean.htmlBuffer
 /t:buffer
 
 I see that t:buffer write null to htmlBuffer variable. Therefore I don't
 add t:output because it can;t output null.
 
 does somebody have ideas?
 thank you.
 
 
 
 



A problem with radio buttons in datatables

2006-08-10 Thread Wetterau, Jan








Hello,



I have a problem with a set of radio buttons using it
in a datatable:



t:dataTable
value=#{BackingBean.dataList} var=dataItem 



t:column

f:facet
name=header

nbsp;

/f:facet

h:selectOneRadio
id=radioList

f:selectItem
value=#{dataItem.id} /

/h:selectOneRadio

/t:column



t:column

f:facet
name=header

h:outputText
value=Description /

/f:facet

h:outputText
value=#{dataItem.description} /

/t:column



/t:dataTable 





I have a datatable (MyFaces Tomahawk) where I need one
radio button for each row. My Problem is that I can't make a set out of the
radio buttons, so that the user can select only one item, because there is no
attribute 'name' for the radio buttons, like in HTML. The code example above
allows the user to select more than just one radio button. So my question is:
How can I build a set of radio buttons where every radio button represents one
row of the datatable?



Thank you,

Jan 








RE: A problem with radio buttons in datatables

2006-08-10 Thread Robert Locklear








Here is a sandbox example those does exactly
what youre looking for.



http://www.irian.at/myfaces-sandbox/selectOneRow.jsf






Robert











From: Wetterau, Jan
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 10, 2006
11:54 AM
To: users@myfaces.apache.org
Subject: A problem with radio buttons
in datatables





Hello,



I have a problem with a set of radio buttons using it
in a datatable:



t:dataTable value=#{BackingBean.dataList}
var=dataItem 



t:column

f:facet
name=header

nbsp;

/f:facet

h:selectOneRadio
id=radioList

f:selectItem
value=#{dataItem.id} /

/h:selectOneRadio

/t:column



t:column

f:facet
name=header

h:outputText
value=Description /

/f:facet

h:outputText
value=#{dataItem.description} /

/t:column



/t:dataTable 





I have a datatable (MyFaces Tomahawk) where I need one
radio button for each row. My Problem is that I can't make a set out of the radio
buttons, so that the user can select only one item, because there is no
attribute 'name' for the radio buttons, like in HTML. The code example above
allows the user to select more than just one radio button. So my question is:
How can I build a set of radio buttons where every radio button represents one
row of the datatable?



Thank you,

Jan 








RE: A problem with radio buttons in datatables

2006-08-10 Thread Robert Locklear








Wow.you can tell I need some sleep.
those=that.





Robert











From: Robert Locklear
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 10, 2006
12:01 PM
To: MyFaces Discussion
Subject: RE: A problem with radio
buttons in datatables





Here is a sandbox example those does
exactly what youre looking for.



http://www.irian.at/myfaces-sandbox/selectOneRow.jsf






Robert











From: Wetterau, Jan [mailto:[EMAIL PROTECTED]

Sent: Thursday, August 10, 2006
11:54 AM
To: users@myfaces.apache.org
Subject: A problem with radio
buttons in datatables





Hello,



I have a problem with a set of radio buttons using it
in a datatable:



t:dataTable value=#{BackingBean.dataList}
var=dataItem 



t:column

f:facet
name=header

nbsp;

/f:facet

h:selectOneRadio
id=radioList

f:selectItem
value=#{dataItem.id} /

/h:selectOneRadio

/t:column



t:column

f:facet
name=header

h:outputText
value=Description /

/f:facet

h:outputText
value=#{dataItem.description} /

/t:column



/t:dataTable 





I have a datatable (MyFaces Tomahawk) where I need one
radio button for each row. My Problem is that I can't make a set out of the
radio buttons, so that the user can select only one item, because there is no
attribute 'name' for the radio buttons, like in HTML. The code example above
allows the user to select more than just one radio button. So my question is:
How can I build a set of radio buttons where every radio button represents one
row of the datatable?



Thank you,

Jan 








RE: many components to one (or more) validation?

2006-08-10 Thread Conway. Fintan \(IT Solutions\)
Hi Joe,

If you bind each component in the group to a backing bean, then you
attach a custom converter to the last control of the group that appears
on the page (e.g. input field).


public class BackingBean {
private SelectOneRadio radio;
private UIInput radioInput;
...
public void validateRadioText(FacesContext context, UIComponent
component, Object value) {
   Boolean buttonClicked = ((Boolean)
radio.getLocalValue()).booleanValue();
   String radioText = (String)value;  // 1

   if (buttonClicked) {
  if(!validText(radioText)) {
 FacesMessage message = ...;
 throw new ValidatorException(message);
  }
   }
}

Private validText(String textToValidate) {
   // validate the text here
}
...
}

NB - The last component will not have its local value set yet (see //1)

In the JSF page set the validator of the last component to this
validator method
t:inputText value=#{...} binding=#{bb.radioInput}
validator=#{bb.validateRadioText}

Where bb is set as a managed Backing Bean in faces-config.

Alternatively you could use a hidden field which is the last field on
the page :
h:inputHidden validator=#{bb.validateRadioText} value=needed/

In this case you get the value for radioText (see //1), similarly to how
it was gotten for buttonClicked, as the local value has been set.

Otherwise you can define your own component similarly to above, if you
will need this functionality in more than one page.

Regards,

Fintan


-Original Message-
From: Joe ersinghaus [mailto:[EMAIL PROTECTED] 
Sent: 10 August 2006 00:35
To: MyFaces Discussion
Subject: many components to one (or more) validation?


Hello,

Is it possible to have more than one component validated as a group? For

example:  let's say I've have a radio button that when activated, text 
must be entered/validated in that radio button's associated input field?

In other words, only when the radio button is selected, should the input

filed be validated.


Thanks,
Joe


* ** *** ** * ** *** ** * ** *** ** * 
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they 
are addressed. 
Any views or opinions presented are solely those of the author, and do not 
necessarily  represent those of ESB. 
If you have received this email in error please notify the sender. 
 
Although ESB scans e-mail and attachments for viruses, it does not guarantee 
that either are virus-free and accepts no liability for any damage sustained 
as a result of viruses. 
 
* ** *** ** * ** *** ** * ** *** ** *



2 screen mode

2006-08-10 Thread Michael Heinen








Hi,



I just want to know whether it is generally possible
to work with 2 screens simultaneously in a JSF application.

The 2 screen mode should be optional depending on
user preferences.

State saving mode should be server side.



My first screen is a kind of a workbench with many
controls on it.

The second screen should just display some detail
data depending on actions or selections on the first screen.

In other words if a button is clicked on the first
screen I have to refresh both screens.

Both are in the same session of course.



Can I handle this with JSF or are there any special
pitfalls?



Michael








RE: [OT] Book

2006-08-10 Thread Conway. Fintan \(IT Solutions\)
Should we wait for the next edition when Tomahawk has upgraded to JSF
1.2?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: 09 August 2006 22:06
To: MyFaces Discussion
Subject: [OT] Book


look!
what I found JavaServer Faces Component Catalog: From Tomahawk to
AJAX. I nice title, I think I order it :)


[1] http://www.cashncarrion.co.uk/products/17391/340/
-- 
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


* ** *** ** * ** *** ** * ** *** ** * 
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they 
are addressed. 
Any views or opinions presented are solely those of the author, and do not 
necessarily  represent those of ESB. 
If you have received this email in error please notify the sender. 
 
Although ESB scans e-mail and attachments for viruses, it does not guarantee 
that either are virus-free and accepts no liability for any damage sustained 
as a result of viruses. 
 
* ** *** ** * ** *** ** * ** *** ** *



SV: SUNs studio enterprise 8 and web.xml config problem

2006-08-10 Thread Sköldheimer Fredrik
Hello!

Well, I have struggled with my web.xml for quite some time now and I just can't 
get this to work with myFaces. 

First things first:
I'm using SUN Java Studio 8.0 Enterprise and the application server that comes 
with de program on localhost. The application I'm building workes fine if I'm 
not using MyFaces modification in web.xml but now I want to use the calendar 
component in myFaces.

My web.xml looked like this when it didn't contain any myFaces filters.
 8 
?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
servlet
servlet-nameFacesServlet/servlet-name
servlet-classjavax.faces.webapp.FacesServlet/servlet-class
load-on-startup1/load-on-startup
/servlet
servlet-mapping
servlet-nameFacesServlet/servlet-name
url-pattern*.jsf/url-pattern
/servlet-mapping
session-config
session-timeout30/session-timeout
/session-config
welcome-file-list
welcome-filesurvey.jsf/welcome-file
/welcome-file-list
/web-app


I could browse my aplication by pointing the browser to: 
http://localhost:6060/testapl/index.jsf

Now, I have done the modification to web.xml according to apache/myfaces 
homepage so now it looks like this:

-- 8 ---
?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
filter
filter-nameMyFacesExtensionsFilter/filter-name

filter-classorg.apache.myfaces.webapp.filter.ExtensionsFilter/filter-class
init-param
descriptionSet the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
/description
param-namemaxFileSize/param-name
param-value20m/param-value

/init-param
/filter

!-- extension mapping for adding script/, link/, and other resource tags 
to JSF-pages  --
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
!-- servlet-name must match the name of your 
javax.faces.webapp.FacesServlet entry --
servlet-nameFaces Servlet/servlet-name
/filter-mapping

!-- extension mapping for serving page-independent resources (javascript, 
stylesheets, images, etc.)  --
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
url-pattern/faces/myFacesExtensionResource/*/url-pattern
/filter-mapping

servlet
servlet-nameFacesServlet/servlet-name
servlet-classjavax.faces.webapp.FacesServlet/servlet-class
load-on-startup1/load-on-startup
/servlet
servlet-mapping
servlet-nameFacesServlet/servlet-name
url-pattern*.jsf/url-pattern
/servlet-mapping
session-config
session-timeout30/session-timeout
/session-config
welcome-file-list
welcome-filetest.jsf/welcome-file
/welcome-file-list
/web-app


And now I get an 404 page missing error when i point my browser to:
http://localhost:6060/testapl/index.jsf

I have also tried:
http://localhost:6060/testapl/index.jsp
http://localhost:6060/testapl/index.faces
http://localhost:6060/testapl/faces/index.jsf
http://localhost:6060/testapl/faces/index.jsp

With no luck. 
Feels like I'm missing something important. But what?

Thanks
Fredrik



Från: Chandra Sekhar [mailto:[EMAIL PROTECTED] 
Skickat: den 5 augusti 2006 08:10
Till: MyFaces Discussion
Ämne: Re: SUNs studio enterprise 8 and web.xml config problem


Hi,
 
Create a mapping for your servlet and try accessing in this way.
 Can you try once accessing your form as 
project/faces/test.jsf.
 
I'm attaching my web.xml havea reference to it and the problem can  be solved.
 
 
?xml version=1.0 encoding=UTF-8?

web-app xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; version=2.4 
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

!--Configuring facesConfig.xml --

context-param

param-namejavax.faces.CONFIG_FILES/param-name

param-value/WEB-INF/faces-config.xml/param-value

/context-param

!-- State Saving Method for Client and Server --

context-param

param-namejavax.faces.STATE_SAVING_METHOD/param-name

param-valueclient/param-value

/context-param

!-- This is the Tag which allows JavaScript into your JSF Application .Default 
is true --

context-param

param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name

param-valuetrue/param-value

/context-param

!-- This is the tag for AutoScroll of your JSF page default is true --

context-param


Re: Internet Explorer on Windows 2003, 2000 breaks myFaces Tobago

2006-08-10 Thread Udo Schnurpfeil

Hi John,

a) check if there occurs a JavaScript error.
   Is there the JavaScript Debugger installed?
   (I've had a problem with the aktivation of the debugger must switch
   it off and on before it works)

b) Does e.g. the tobago-example-demo works on your system?

c) jsf version? tobago version?

Regards

Udo

John schrieb:
After 3 weeks of battling this, adding no-caching headers and such, we 
had to release our software without support for Internet Explorer on 
Windows 2003, Windows 2000 and Windows 2000 PRO.
 
With Tomcat running on any of the above including XP.
Our myFaces/Tobago application only works on Internet Explorer 6  7, 
running on Windows XP (regardless of where Tomcat is hosted). Clicking 
on anything just refreshes the page. Javascript works, but the page is 
not rebuilt from the server. Firefox works great on all configurations.
 
At one point, with Internet Explorer 6 running on Windows 2003 server, 
the app functioned correctly if I connected as http://machineName:9090 
(Internet Zone), but failed if I connected as http://localhost:9090 
(Intranet zone). I had custom security settings. I could repeatedly 
switch back and forth with the URL (works-doesn't-works-doesn't). Now 
during debugging I've reset the security to default. Can't rememberr 
exactly what I had. But if I enable all the options, it still doesn't 
work. But this makes me think it's the browser settings not cache headers...
 
I'm completely lost and could really use some help with this. Customers 
are turning extremely ugly.
 
Thanks for any help,
 
John


a way to pass parameters in el expressions

2006-08-10 Thread L Frohman
I am sharing this for anyone who may find it useful.

To pass a parameter to a method inside an el expression, extend the DummyMap
class (below) and implement the get(Object obj) method to pass obj as a
parameter
to that method.

As a trivial example, to pass a parameter to the changeToUpperCase() method,
the get() method takes the String, testBean.widget here, as a parameter
and calls changeToUpperCase() with that parameter.
This will result in the page showing WIDGET.


--
public class Uppercaser extends DummyMap implements Map {
public String changeToUpperCase(String stg) {
return stg.toUpperCase();
}

public Object get(Object obj) {
return changeToUpperCase((String)obj);
}
}
--
public class TestBean implements Serializable {
private static final long serialVersionUID = 1L;
private Uppercaser uppercaser = new Uppercaser();
public Uppercaser getUppercaser() {
return uppercaser;
}
public String getWidget() {
return widget;
}
}
--
%@ taglib uri=http://java.sun.com/jsf/html; prefix=h%
%@ taglib uri=http://java.sun.com/jsf/core; prefix=f%

f:view
html
body
h:form
h:outputText
value=#{testBean.uppercaser[testBean.widget]} /
/h:form
/body
/html
/f:view
--


the abstract class:
--
// abstract class used by java server faces to pass parameter to a method as
map key
public abstract class DummyMap implements Map {
 public Collection values() {return null;}
 public Object put(Object key, Object value) {return null;}
 public Set keySet() {return null;}
 public boolean isEmpty() {return false;}
 public int size() {return 0;}
 public void putAll(Map t) {}
 public void clear() {}
 public boolean containsValue(Object value) {return false;}
 public Object remove(Object key) {return null; }
 public boolean containsKey(Object key) {return false;}
 public Set entrySet() {return null;}
 
 // subclasses should override this method call their method with obj as the
parameter
 public abstract Object get(Object obj);
}
--




Re: SUNs studio enterprise 8 and web.xml config problem

2006-08-10 Thread nimisha sharma
If you have read the post on wiki, it says that you dont need to do any modifications in your web.xml. Follow these steps:



Change the config security file so that MyFaces can delete it's temporary files. 

In {InstallDir}/SunOne8.1/domains/domain1/config/server.policy 


Change permission 
java.io.FilePermission ALL FILES, read,write; 


to 
java.io.FilePermission ALL FILES, read,write,delete; 


Prevent the sun reference implementation from being used 

In your WEB-INF, create a sun-web.xml file containing 
?xml version=1.0 encoding=UTF-8? 
sun-web-app 


class-loader delegate=false/ 
/sun-web-app 
That way, myfaces classes will be loaded instead of Sun RI ones. 


And prevent MyFaces from loading the Sun RI context listener 
By creating in your webapp a fake com.sun.faces.config.ConfigureListener that will be loaded BEFORE the sun RI one's. 

Like that: 
package com.sun.faces.config; 
import javax.servlet.*; 
/** 


This class is here to prevent from using the real one from the sun reference implementation 

/ 
public class ConfigureListener implements ServletContextListener
 { 


public void contextInitialized(ServletContextEvent servletContextEvent) { 


//To change body of implemented methods use File | Settings | File Templates. 
} 
public void contextDestroyed(ServletContextEvent servletContextEvent) { 


//To change body of implemented methods use File | Settings | File Templates. 
} 
} 
This is for 8.1 but it works for 8.2 also... so i am assuming that this soln would work for 8.0 also.. Hope it helps you.

Nimisha.
On 8/10/06, Sköldheimer Fredrik [EMAIL PROTECTED] wrote:
Hello!Well, I have struggled with my web.xml for quite some time now and I just can't get this to work with myFaces.
First things first:I'm using SUN Java Studio 8.0 Enterprise and the application server that comes with de program on localhost. The application I'm building workes fine if I'm not using MyFaces modification in 
web.xml but now I want to use the calendar component in myFaces.My web.xml looked like this when it didn't contain any myFaces filters. 8 ?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
 servlet servlet-nameFacesServlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup
 /servlet servlet-mapping servlet-nameFacesServlet/servlet-name url-pattern*.jsf/url-pattern /servlet-mapping session-config
 session-timeout30/session-timeout /session-config welcome-file-list welcome-filesurvey.jsf/welcome-file /welcome-file-list
/web-appI could browse my aplication by pointing the browser to:http://localhost:6060/testapl/index.jsfNow, I have done the modification to 
web.xml according to apache/myfaces homepage so now it looks like this:-- 8 ---?xml version=1.0 encoding=UTF-8?web-app version=2.4 xmlns=
http://java.sun.com/xml/ns/j2ee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=
http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsdfilter filter-nameMyFacesExtensionsFilter/filter-name
 filter-classorg.apache.myfaces.webapp.filter.ExtensionsFilter/filter-class init-param descriptionSet the size limit for uploaded files. Format: 10 - 10 bytes
 10k - 10 KB 10m - 10 MB 1g - 1 GB /description param-namemaxFileSize/param-name param-value20m/param-value
 /init-param/filter!-- extension mapping for adding script/, link/, and other resource tags to JSF-pages--filter-mapping filter-nameMyFacesExtensionsFilter/filter-name
 !-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -- servlet-nameFaces Servlet/servlet-name/filter-mapping!-- extension mapping for serving page-independent resources (_javascript_, stylesheets, images, etc.)--
filter-mapping filter-nameMyFacesExtensionsFilter/filter-name url-pattern/faces/myFacesExtensionResource/*/url-pattern/filter-mapping servlet
 servlet-nameFacesServlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet
 servlet-mapping servlet-nameFacesServlet/servlet-name url-pattern*.jsf/url-pattern /servlet-mapping session-config session-timeout30/session-timeout
 /session-config welcome-file-list welcome-filetest.jsf/welcome-file /welcome-file-list/web-appAnd now I get an 404 page missing error when i point my browser to:
http://localhost:6060/testapl/index.jsfI have also tried:http://localhost:6060/testapl/index.jsp
http://localhost:6060/testapl/index.faceshttp://localhost:6060/testapl/faces/index.jsf
http://localhost:6060/testapl/faces/index.jspWith no luck.Feels like I'm missing something important. But what?ThanksFredrikFrån: Chandra Sekhar [mailto:
[EMAIL PROTECTED]]Skickat: den 5 augusti 2006 08:10Till: 

Re: Compare two password fields with a validator

2006-08-10 Thread Mike Kienenberger

validateCompareTo is a better choice than validateEqual.

http://myfaces.apache.org/sandbox/validateCompareTo.html

On 8/10/06, Robert Locklear [EMAIL PROTECTED] wrote:

http://myfaces.apache.org/tomahawk/validateEqual.html

Thanks,
Robert
-Original Message-
From: Tom Serru [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 10, 2006 10:32 AM
To: users@myfaces.apache.org
Subject: Compare two password fields with a validator


Hi,

Is there a way to create a validator to compare two fields (like a
password
and a password check field) ? I would like to have something like this
as
result:

...
h:inputSecret id=password
f:validator validatorId=CompareFields
otherField=passwordCheck/
/h:inputSecret
...
h:inputSecret id=passwordCheck
...

Thx...
--
View this message in context:
http://www.nabble.com/Compare-two-password-fields-with-a-validator-tf208
3442.html#a5740422
Sent from the MyFaces - Users forum at Nabble.com.




Re: Compare two password fields with a validator

2006-08-10 Thread Mike Kienenberger

You will also get the better results by putting the validator on the
second field on the page rather than on the first field on the page.
This is especially true for validateEqual, but less important for
validateCompareTo.

On 8/10/06, Mike Kienenberger [EMAIL PROTECTED] wrote:

validateCompareTo is a better choice than validateEqual.

http://myfaces.apache.org/sandbox/validateCompareTo.html

On 8/10/06, Robert Locklear [EMAIL PROTECTED] wrote:
 http://myfaces.apache.org/tomahawk/validateEqual.html

 Thanks,
 Robert
 -Original Message-
 From: Tom Serru [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 10, 2006 10:32 AM
 To: users@myfaces.apache.org
 Subject: Compare two password fields with a validator


 Hi,

 Is there a way to create a validator to compare two fields (like a
 password
 and a password check field) ? I would like to have something like this
 as
 result:

 ...
 h:inputSecret id=password
 f:validator validatorId=CompareFields
 otherField=passwordCheck/
 /h:inputSecret
 ...
 h:inputSecret id=passwordCheck
 ...

 Thx...
 --
 View this message in context:
 http://www.nabble.com/Compare-two-password-fields-with-a-validator-tf208
 3442.html#a5740422
 Sent from the MyFaces - Users forum at Nabble.com.





Re: a way to pass parameters in el expressions

2006-08-10 Thread Mike Kienenberger

Hey Lance,

This would be a great wiki topic so it doesn't get lost.

It's probably worth noting that if you're using facelets, you can
simply create a real changeToUpperCase() user-defined el function.

On 8/10/06, L Frohman [EMAIL PROTECTED] wrote:

I am sharing this for anyone who may find it useful.

To pass a parameter to a method inside an el expression, extend the DummyMap
class (below) and implement the get(Object obj) method to pass obj as a
parameter
to that method.

As a trivial example, to pass a parameter to the changeToUpperCase() method,
the get() method takes the String, testBean.widget here, as a parameter
and calls changeToUpperCase() with that parameter.
This will result in the page showing WIDGET.


--
public class Uppercaser extends DummyMap implements Map {
public String changeToUpperCase(String stg) {
return stg.toUpperCase();
}

public Object get(Object obj) {
return changeToUpperCase((String)obj);
}
}
--
public class TestBean implements Serializable {
private static final long serialVersionUID = 1L;
private Uppercaser uppercaser = new Uppercaser();
public Uppercaser getUppercaser() {
return uppercaser;
}
public String getWidget() {
return widget;
}
}
--
%@ taglib uri=http://java.sun.com/jsf/html; prefix=h%
%@ taglib uri=http://java.sun.com/jsf/core; prefix=f%

f:view
html
body
h:form
h:outputText
value=#{testBean.uppercaser[testBean.widget]} /
/h:form
/body
/html
/f:view
--


the abstract class:
--
// abstract class used by java server faces to pass parameter to a method as
map key
public abstract class DummyMap implements Map {
 public Collection values() {return null;}
 public Object put(Object key, Object value) {return null;}
 public Set keySet() {return null;}
 public boolean isEmpty() {return false;}
 public int size() {return 0;}
 public void putAll(Map t) {}
 public void clear() {}
 public boolean containsValue(Object value) {return false;}
 public Object remove(Object key) {return null; }
 public boolean containsKey(Object key) {return false;}
 public Set entrySet() {return null;}

 // subclasses should override this method call their method with obj as the
parameter
 public abstract Object get(Object obj);
}
--





Re: checkboxes in datatable

2006-08-10 Thread nimisha sharma
GOT MY MISTAKE!! thanks again... 
On 8/9/06, nimisha sharma [EMAIL PROTECTED] wrote:


I think i am doing the right thing with this.. i went to jenia.org and followed the instructions.. as i told you that i was not even getting the checkboxes, now i am getting them.. but when i click on the commandButton, i dont get the selected rows in the Collection/ List (i tried both one at a time). I am pasting my jsp and my bean code as under.. and i have the 2 jar files in the classpath : commons and dataTools provided by jenia. I could just not figure out where i am going wrong. Could you plz have a look at the code.. 


h:form 

 h:dataTable value=#{MaintenanceBean.perfFeeMaintModel.perfFee
 } 
 var=accountList 
 id=perfFeeMaint 
 rows=4
 t:column
 f:facet name=
 header
 h:outputText value=
 Number/h:outputText 
 /f:facet

 t:outputText value=#{accountList.id
 }/t:outputText


 /t:column
t:column
 f:facet name=
 header
 h:outputText value=
 Account/h:outputText 
 /f:facet
 t:outputText value=#{accountList.account
 }/t:outputText
 /t:column
 t:column
 f:facet name=
 header
 h:outputText value=
 Performance Fee/h:outputText 
 /f:facet
 jdt:multipleRowsSelector


selectionList=#MaintenanceBean.perfFeeMaintModel.selectionList} 
/
 /t:column 
/h:dataTable
h:panelGrid columns=22 
cellpadding=0 cellspacing=
 0 border=0 width=
 80 
t:dataScroller id=perfFeeScroller 

 for=perfFeeMaint
 pageCountVar=pageCount
 pageIndexVar=pageIndex
 paginator=true
 paginatorMaxPages=9
 paginatorTableClass=paginator
 paginatorActiveColumnStyle=font-weight:bold;
 
f:facet name=first 

h:graphicImage value=/images/FirstPage.gif 
style=margin-top:4pt;/
/f:facet
f:facet name=last
 
h:graphicImage value=/images/LastPage.gif 
style=margin-top:4pt;/
/f:facet
f:facet name=previous 

h:graphicImage value=/images/PreviousItem.gif 
style=margin-top:4pt;/
/f:facet
f:facet name=next
 
h:graphicImage value=/images/NextItem.gif 
style=margin-top:4pt;/
/f:facet
/t:dataScroller
/h:panelGrid
/h:form
h:form id=saveForm
 
h:panelGroup
h:commandButton id=savePerf 
value=Save action=#MaintenanceBean.perfFeeMaintModel.save
 }/h:commandButton
/h:panelGroup
/h:form

Bean code:

List perfFee = new ArrayList(); 
private Collection selectedList;
public Collection getSelectedList() {
return selectedList;
}
public void setSelectedList(Collection selectedList) {
this.selectedList = selectedList;
}
public List getPerfFee() {
perfFee.add(new PerformanceFeeData(1, 001 
, true));
perfFee.add(new PerformanceFeeData(2, 002 
, true));
perfFee.add(new PerformanceFeeData(3, 003 
, false));
perfFee.add(new PerformanceFeeData(4, 004 
, true));
perfFee.add(new PerformanceFeeData(5, 005 
, true));
perfFee.add(new PerformanceFeeData(6, 006 
, true));
perfFee.add(new PerformanceFeeData(7, 007 
, false));
perfFee.add(new PerformanceFeeData(8, 008 
, true));
perfFee.add(new PerformanceFeeData(9, 009 
, true));
perfFee.add(new PerformanceFeeData(10, 010 
,true));
return perfFee;
}
public String save(){
//setSelectedRow(Integer.parseInt((String) FacesContext.getCurrentInstance
).getExternalContext().getRequestParameterMap().get(selectedRow)));
//setSelectedPerf(Boolean.parseBoolean((String) FacesContext.getCurrentInstance
).getExternalContext().getRequestParameterMap().get(selectedPerf)));
//System.out.println(selected row:  + selectedRow +  selected perf :  + selectedPerf);
if(selectedList != null
 ){
System.out.println(size  + 
selectedList.size());
}
return success;
}

Here, the selectedList.size() gives me zero even if i select some checkboxes...

I would really appreciate your help.. have been trying this for a long time now.. 

Thanks again for taking out time to guide me..


Regards,
Nimisha.

On 8/9/06, Andrew Robinson [EMAIL PROTECTED]
 wrote: 
Jenia's data multipleRowsSelector builds a list of the objects thatyou are iterating over. So if your data table's value points to a list 
of MyObject then the multipleRowsSelector will create list ofMyObject instances for each row that had the checkbox selected.public class MyItem { ... }public class MyBean{private ListMyItem selectedItems; 
private ListMyItem allItems;public ListMyItem getSelectedItems() { return selectedItems; }public void setSelectedItems(ListMyItem selectedItems){ this.selectedItems = selectedItems; } 
public ListMyItem getAllItems() { return allItems; }public String load(){ // load all items here}public String onSubmit(){ // put your code here for (MyItem item : selectedItems) 
 ; // do something with it}}t:dataTablevalue=#{myBean.allItems}var=_itemt:column jdt:multipleRowsSelector selectionList=#{ 
myBean.selectedItems} //t:columnt:column f:facet name=header t:outputText value=Something / /f:facet t:outputText value=#{_item.something} / 
/t:column/t:dataTablet:commandLink action="">value=Submit /As I mentioned, you don't want to work with IDs of the checkboxes.-Andrew 
On 8/9/06, nimisha sharma [EMAIL PROTECTED] wrote: I also saw your post on
 

Re: many components to one (or more) validation?

2006-08-10 Thread Mike Kienenberger

On 8/10/06, Conway. Fintan (IT Solutions) [EMAIL PROTECTED] wrote:

If you bind each component in the group to a backing bean, then you
attach a custom converter to the last control of the group that appears
on the page (e.g. input field).


Fintan means validator and not converter.  You can see that this
is implied from the latter part of his message.

It's generally more maintainable to use the hidden text field as the
last field with a validator method since this leaves both of your
previous components in the same state (local value) and you don't have
to work with a submitted value and a local value at the same time.

However, you'll end up doing most of the work required to create a
validator even if you go this route.If you start with
validateCompareTo and simply change the validating condition, you'll
probably save time and have a reusable component afterward.




On 8/10/06, Conway. Fintan (IT Solutions) [EMAIL PROTECTED] wrote:

Hi Joe,

If you bind each component in the group to a backing bean, then you
attach a custom converter to the last control of the group that appears
on the page (e.g. input field).


public class BackingBean {
private SelectOneRadio radio;
private UIInput radioInput;
...
public void validateRadioText(FacesContext context, UIComponent
component, Object value) {
   Boolean buttonClicked = ((Boolean)
radio.getLocalValue()).booleanValue();
   String radioText = (String)value;  // 1

   if (buttonClicked) {
  if(!validText(radioText)) {
 FacesMessage message = ...;
 throw new ValidatorException(message);
  }
   }
}

Private validText(String textToValidate) {
   // validate the text here
}
...
}

NB - The last component will not have its local value set yet (see //1)

In the JSF page set the validator of the last component to this
validator method
t:inputText value=#{...} binding=#{bb.radioInput}
validator=#{bb.validateRadioText}

Where bb is set as a managed Backing Bean in faces-config.

Alternatively you could use a hidden field which is the last field on
the page :
h:inputHidden validator=#{bb.validateRadioText} value=needed/

In this case you get the value for radioText (see //1), similarly to how
it was gotten for buttonClicked, as the local value has been set.

Otherwise you can define your own component similarly to above, if you
will need this functionality in more than one page.

Regards,

Fintan


-Original Message-
From: Joe ersinghaus [mailto:[EMAIL PROTECTED]
Sent: 10 August 2006 00:35
To: MyFaces Discussion
Subject: many components to one (or more) validation?


Hello,

Is it possible to have more than one component validated as a group? For

example:  let's say I've have a radio button that when activated, text
must be entered/validated in that radio button's associated input field?

In other words, only when the radio button is selected, should the input

filed be validated.


Thanks,
Joe


* ** *** ** * ** *** ** * ** *** ** *
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.
Any views or opinions presented are solely those of the author, and do not 
necessarily  represent those of ESB.
If you have received this email in error please notify the sender.

Although ESB scans e-mail and attachments for viruses, it does not guarantee
that either are virus-free and accepts no liability for any damage sustained
as a result of viruses.

* ** *** ** * ** *** ** * ** *** ** *




Re: SUNs studio enterprise 8 and web.xml config problem

2006-08-10 Thread Mike Kienenberger

On 8/10/06, Sköldheimer Fredrik [EMAIL PROTECTED] wrote:

!-- extension mapping for adding script/, link/, and other resource tags to 
JSF-pages  --
filter-mapping
filter-nameMyFacesExtensionsFilter/filter-name
!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet 
entry --
servlet-nameFaces Servlet/servlet-name
/filter-mapping



servlet-mapping
servlet-nameFacesServlet/servlet-name
url-pattern*.jsf/url-pattern
/servlet-mapping



Feels like I'm missing something important. But what?


To quote the comment above -- servlet-name must match the name of
your javax.faces.webapp.FacesServlet entry

You have Faces Servlet with a space for the filter and
FacesServlet without a space for the servlet.


Re: 2 screen mode

2006-08-10 Thread Mike Kienenberger

On 8/10/06, Michael Heinen [EMAIL PROTECTED] wrote:

I just want to know whether it is generally possible to work with 2 screens
simultaneously in a JSF application.


For JSF 1.2, this is generally true (although I don't know the details).
For JSF 1.1, this is generally not true.



The 2 screen mode should be optional depending on user preferences.
State saving mode should be server side.


The only way JSF 1.1 will work is with client-side state saving.


Can I handle this with JSF or are there any special pitfalls?


For 1.1, you need to use client-side state saving and avoid having any
session-scoped data.


Re: tree expand/collpase problem

2006-08-10 Thread Mike Kienenberger

On 8/10/06, Seshireddy G [EMAIL PROTECTED] wrote:

Can any one give some idea for doing EXPANDALL and COLLAPSEALL
functionalities using  tree components..

P.S: Its not possible to change my complete functionlaity to tree2 for
EXPANDALL / COLLAPSEALL .
so i need to do with tree component only.


Just as a FYI, t:tree is no longer actively supported.   You may have
to implement this functionality yourself.


Re: NavigationHandler + Security

2006-08-10 Thread Andrew Robinson

Just check the security in a phase listener before render. To answer
your question -- you can't (there is no API in the navigation handler
to get any information out).

On 8/9/06, Ingo Düppe [EMAIL PROTECTED] wrote:

Hi,

I like to check within the navigation handler some security constraints
like if the user is allowed to access a specific viewId.
Therefore I need to know the toViewId of a specific outcome.
But how can I get a toViewId from the facescontext if I only have the
current viewId and the outcome.

Regards
Ingo



How to submit multiple forms

2006-08-10 Thread Mak Nern Fatt Melvin
Hi,

Iwant to save the data inboth thetwo forms when i clicked the save buttonin one ofthe forms. I have several forms in my documents as illustrated below:

f:view
h:form id="form1"

h:inputText id="name" value="#{backingBean.var1}"/

/h:form


h:form id="form2"

h:inputText id="address" value="#{backingBean.var2}"/

h:commandButton value="SAVE" action=""/

/h:form
/f:view

When i clicked the save button, only the address component value in "form2"is saved while the name component in "form1"is not saved. How can I get both the forms to be submitted upon clicking the save button? I tried submitting form1 using the onclick property of the button as belowbut it didnt work:


h:commandButton value="SAVE" action=""  /

I have been stucked with thisproblemfor the past week so can anyone please give me some idea on how i could get both the forms to be submitted? Thanks in advance!





Re: How to submit multiple forms

2006-08-10 Thread Mike Kienenberger

On 8/10/06, Mak Nern Fatt Melvin [EMAIL PROTECTED] wrote:

I want to save the data in both the two forms when i clicked the save button
in one of the forms. I  have several forms in my documents as illustrated
below:

f:view
h:form id=form1

h:inputText id=name value=#{backingBean.var1}/

/h:form


h:form id=form2

h:inputText id=address value=#{backingBean.var2}/

h:commandButton value=SAVE action=#{backingBean.save}/

/h:form
/f:view

When i clicked the save button, only the address component value in form2
is saved while the name component in form1 is not saved. How can I get
both the forms to be submitted upon clicking the save button? I tried
submitting form1 using the onclick property of the button as below but it
didnt work:

h:commandButton value=SAVE action=#{backingBean.save}
onclick=document.forms['form1'].submit() /



It's considered best practice in JSF to have a single form for each
page (I typically use  bodyh:form  /h:formbody for all of
my pages.   Is there a reason why you can't do this?


Re: How to submit multiple forms

2006-08-10 Thread Mak Nern Fatt Melvin
Hi,

I cannot use a single form for my document because I have yet another form nested in-between the two forms. Please see the illustration below:

f:view
h:form id="parent_form1"

h:inputText id="name" value="#{backingBean.var1}"/

/h:form



h:form id="child_form"

h:inputText id="child_component" value="#{childBean.var1}"/

h:commandButton value="ADD" action=""/

/h:form



h:form id="parent_form2"

h:inputText id="address" value="#{backingBean.var2}"/

h:commandButton value="SAVE" action=""/

/h:form
/f:view

The child form is independentof the two parent forms and is the child section has to be nested in-between the parent forms due to user-requirement. The save button has to save all the parent components. You have any more idea on this?



From: "Mike Kienenberger" [EMAIL PROTECTED]Reply-To: "MyFaces Discussion" users@myfaces.apache.orgTo: "MyFaces Discussion" users@myfaces.apache.orgSubject: Re: How to submit multiple formsDate: Thu, 10 Aug 2006 10:42:46 -0400On 8/10/06, Mak Nern Fatt Melvin [EMAIL PROTECTED] wrote:I want to save the data in both the two forms when i clicked the save buttonin one of the forms. I have several forms in my documents as illustratedbelow:f:viewh:form id="form1"h:inputText id="name" value="#{backingBean.var1}"//h:formh:form id="form2"h:inputText id="address" 
value="#{backingBean.var2}"/h:commandButton value="SAVE" action=""//h:form/f:viewWhen i clicked the save button, only the address component value in "form2"is saved while the name component in "form1" is not saved. How can I getboth the forms to be submitted upon clicking the save button? I triedsubmitting form1 using the onclick property of the button as below but itdidnt work:h:commandButton value="SAVE" action="" /It's considered best practice in JSF to have a single form for eachpage (I typically use bodyh:form 
. /h:formbody for all ofmy pages. Is there a reason why you can't do this?



Re: How to submit multiple forms

2006-08-10 Thread Mike Kienenberger

On 8/10/06, Mak Nern Fatt Melvin [EMAIL PROTECTED] wrote:

I cannot use a single form for my document because I have yet another form
nested in-between the two forms. Please see the illustration below:


There's no way you can submit two forms at the same time using the
http protocol.
The only thing you can do is copy all of the form data from the
non-submitted form into hidden fields on your submitted form using
javascript.


The child form is independent of the two parent forms and is the child
section has to be nested in-between the parent forms due to
user-requirement.  The save button has to save all the parent components.
You have any more idea on this?


The use of html forms is a technicial decision and should not affect
any user requirements.  This is particularly true in JSF where an
h:form doesn't work the same way as a traditional html form -- it
submits the previous values of all other forms on the page using
hidden fields (but these are not the updated values).  Unless the
end-user is using view source there's no way they're going to know
how the forms are laid out underneath, and I really doubt the
end-users care how you structure your html form elements.

The only use case I've seen for having multiple forms is to do
selective validation, and even then, there are other ways to get
around the issue.

If you explain why you think you cannot have your child section in the
same form as the rest of the components, maybe we can help you come up
with a an alternate solution as trying to submit two forms at the same
time is going to be a very difficult problem to solve.


Re: [OT] Book

2006-08-10 Thread Matthias Wessendorf

On 8/10/06, Conway. Fintan (IT Solutions) [EMAIL PROTECTED] wrote:

Should we wait for the next edition when Tomahawk has upgraded to JSF
1.2?


:) No. Tomahawk JSF 1.2 ?
When will that be? 2008 ? :)



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: 09 August 2006 22:06
To: MyFaces Discussion
Subject: [OT] Book


look!
what I found JavaServer Faces Component Catalog: From Tomahawk to
AJAX. I nice title, I think I order it :)


[1] http://www.cashncarrion.co.uk/products/17391/340/
--
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


* ** *** ** * ** *** ** * ** *** ** *
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.
Any views or opinions presented are solely those of the author, and do not 
necessarily  represent those of ESB.
If you have received this email in error please notify the sender.

Although ESB scans e-mail and attachments for viruses, it does not guarantee
that either are virus-free and accepts no liability for any damage sustained
as a result of viruses.

* ** *** ** * ** *** ** * ** *** ** *





--
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


Re: [OT] Book

2006-08-10 Thread Matthias Wessendorf

to be serious. It's great to have book which contains tomahawk (and other stuff)
I ordered it already :)

On 8/10/06, Matthias Wessendorf [EMAIL PROTECTED] wrote:

On 8/10/06, Conway. Fintan (IT Solutions) [EMAIL PROTECTED] wrote:
 Should we wait for the next edition when Tomahawk has upgraded to JSF
 1.2?

:) No. Tomahawk JSF 1.2 ?
When will that be? 2008 ? :)


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
 Matthias Wessendorf
 Sent: 09 August 2006 22:06
 To: MyFaces Discussion
 Subject: [OT] Book


 look!
 what I found JavaServer Faces Component Catalog: From Tomahawk to
 AJAX. I nice title, I think I order it :)


 [1] http://www.cashncarrion.co.uk/products/17391/340/
 --
 Matthias Wessendorf

 further stuff:
 blog: http://jroller.com/page/mwessendorf
 mail: mwessendorf-at-gmail-dot-com


 * ** *** ** * ** *** ** * ** *** ** *
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed.
 Any views or opinions presented are solely those of the author, and do not 
necessarily  represent those of ESB.
 If you have received this email in error please notify the sender.

 Although ESB scans e-mail and attachments for viruses, it does not guarantee
 that either are virus-free and accepts no liability for any damage sustained
 as a result of viruses.

 * ** *** ** * ** *** ** * ** *** ** *




--
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com




--
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


Re: How to submit multiple forms

2006-08-10 Thread Mike Kienenberger

On 8/10/06, Mak Nern Fatt Melvin [EMAIL PROTECTED] wrote:

Yes you are right Mike. I need to put the child section in another form due
to selective validation. I do not want the parent components to be validated
or reloaded when the child section is been submitted. You talked of a
workaround, so is that a way that i can use a single form but attain
selective validation n reloading of child and parent data respectively?


Yes, but it's a tricky subject :-)

If this is your only case of selective validation, you can mark both
the child add button and the child input field as immediate=true
and they will validate independently of the other elements.

If it's more complicated than that, the most common way to solve the
problem is to use a subform component.   There's one available in the
MyFaces Tomahawk sandbox and I think there's also one available as
part of Oracle ADFFaces (also available as MyFaces Trinidad which is a
source code dump of ADFFaces undergoing incubation at Apache).

If you're not already using ADFFaces, I'd recommend using the sandbox
one instead.

http://myfaces.apache.org/sandbox/subForm.html


inputSuggestAjax and onchange event

2006-08-10 Thread Francesco Consumi

Hi all,

I would need to track this event for this component, but I see in HTML 
code that it ignores this.

how can I do ?

I'm using sandbox-1.1.5-snapshot, and myfaces 1.1.4


RE: 2 screen mode

2006-08-10 Thread Michael Heinen
Thanks Mike.

Yes, I remember that jsf 1.2 provides a windowId.
Do you have an idea when a myFaces implementation (a release) of the 1.2
spec will be available?

Client Side state saving is a big performance downside and not useable
for me.

Another question to jsf 1.1:
Would I face problems if both screens use their own backing beans and
the backing beans are able to update each other? The second page should
just fetch data for detail display and should be refreshed from the
master window via javaScript. 

What would you advise me to do?
Switch to Sun RI 1.2 or try to build a prototype with MyFaces 1.1.X and
server side state saving.

Thanks for any help and comments
Michael


-Original Message-
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Donnerstag, 10. August 2006 16:20
To: MyFaces Discussion
Subject: Re: 2 screen mode

On 8/10/06, Michael Heinen [EMAIL PROTECTED] wrote:
 I just want to know whether it is generally possible to work with 2
screens
 simultaneously in a JSF application.

For JSF 1.2, this is generally true (although I don't know the details).
For JSF 1.1, this is generally not true.


 The 2 screen mode should be optional depending on user preferences.
 State saving mode should be server side.

The only way JSF 1.1 will work is with client-side state saving.

 Can I handle this with JSF or are there any special pitfalls?

For 1.1, you need to use client-side state saving and avoid having any
session-scoped data.






Re: 2 screen mode

2006-08-10 Thread Mike Kienenberger

On 8/10/06, Michael Heinen [EMAIL PROTECTED] wrote:

Do you have an idea when a myFaces implementation (a release) of the 1.2
spec will be available?


When enough volunteers submit patches to close all of the JSR 252 open
issues :-)

http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=truemode=hidepid=10600sorter/order=DESCsorter/field=priorityresolution=-1component=12310871




Another question to jsf 1.1:
Would I face problems if both screens use their own backing beans and
the backing beans are able to update each other? The second page should
just fetch data for detail display and should be refreshed from the
master window via javaScript.


Dunno.   It's mostly a matter of trying different things and seeing
how they work.


What would you advise me to do?
Switch to Sun RI 1.2 or try to build a prototype with MyFaces 1.1.X and
server side state saving.


I don't have enough expertise in the area to give advice.  You might
try asking on the Trinidad/ADFFaces mailing list as they have
addressed the multiple window issue somewhat, even in a JSF 1.1
environment.


Re: NavigationHandler + Security

2006-08-10 Thread Ingo Düppe

Andrew Robinson schrieb:

Just check the security in a phase listener before render. To answer
your question -- you can't (there is no API in the navigation handler
to get any information out).
I just feared it that is not convert  by the API. But thanks for 
pointing me to the phase listener again.
I had already thought about it but didn't saw that within the render 
response phase I already have the new viewId.


Thanks
Ingo


Problem with myfaces/facelets template.xhtml

2006-08-10 Thread Gus

Hi everyone,

I just begin to learn Facelets and Myfaces. I created a template, but the
template did display as expected. The sidebar and content should be
displayed in two columns as left and right, but it always display in one
columns as up and down. I really do not have any idea how to fix it. Any
help will be apprieciated. Thank you in advance.

Gus
= Template.xhtml ==

t:document xmlns=http://www.w3.org/1999/xhtml; 
xmlns:ui=http://java.sun.com/jsf/facelets;
xmlns:h=http://java.sun.com/jsf/html;
xmlns:f=http://java.sun.com/jsf/core;
xmlns:t=http://myfaces.apache.org/tomahawk;
xmlns:http=http://www.disy.de/commons/facelets/tag/http;
f:view
t:documentHead
   
titleGlobal Documents/title
t:stylesheet path=styles.css/
   
!-- include file=/template/_jscript.js --
!--@ include file=/template/AjaxRequest.js  --   
/script
/t:documentHead
t:documentBody
h:panelGrid columns=1 styleClass=mainBody  rowClasses=row
   
cellspacing=0 cellpadding=0 border=1
!-- header insert --
f:facet name=header
h:form id=menuForm
ui:include src=header.xhtml/
/h:form   
/f:facet
 
!-- body insert  --
h:panelGrid columns=2 border=0
styleClass=contentBody
columnClasses=sidemenu, content
cellspacing=1 cellpadding=0

!-- submenu of side bar insert  --
h:form id=sidemenuForm
ui:insert name=sidebar/
   /h:form
  
!-- content insert  --
h:form id=contentForm enctype=multipart/form-data
ui:insert name=content/
/h:form
/h:panelGrid

!--  footer insert  --
f:facet name=footer
ui:include src=footer.xhtml/ 
/f:facet
/h:panelGrid
/t:documentBody
/f:view
/t:document
-- 
View this message in context: 
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5749229
Sent from the MyFaces - Users forum at Nabble.com.



RE: Problem with myfaces/facelets template.xhtml

2006-08-10 Thread David Friedman
Gus,

There is a little thing with Facelets that some components are compile time
and some are render time.  I think you are mixing the two.  You might try
putting each form inside h:panelGroup so ui:include can be sure where to
place itself.  Also, did you get your columns created in the final/outputted
html or is it skipping that, which might support my suggestion.

Regards,
David

-Original Message-
From: Gus [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 10, 2006 1:50 PM
To: users@myfaces.apache.org
Subject: Problem with myfaces/facelets template.xhtml



Hi everyone,

I just begin to learn Facelets and Myfaces. I created a template, but the
template did display as expected. The sidebar and content should be
displayed in two columns as left and right, but it always display in one
columns as up and down. I really do not have any idea how to fix it. Any
help will be apprieciated. Thank you in advance.

Gus
= Template.xhtml ==

t:document xmlns=http://www.w3.org/1999/xhtml;
xmlns:ui=http://java.sun.com/jsf/facelets;
xmlns:h=http://java.sun.com/jsf/html;
xmlns:f=http://java.sun.com/jsf/core;
xmlns:t=http://myfaces.apache.org/tomahawk;
xmlns:http=http://www.disy.de/commons/facelets/tag/http;
f:view
t:documentHead

titleGlobal Documents/title
t:stylesheet path=styles.css/

!-- include file=/template/_jscript.js --
!--@ include file=/template/AjaxRequest.js  --
/script
/t:documentHead
t:documentBody
h:panelGrid columns=1 styleClass=mainBody  rowClasses=row
cellspacing=0 cellpadding=0 border=1
!-- header insert --
f:facet name=header
h:form id=menuForm
ui:include src=header.xhtml/
/h:form
/f:facet

!-- body insert  --
h:panelGrid columns=2 border=0
styleClass=contentBody
columnClasses=sidemenu, content
cellspacing=1 cellpadding=0

!-- submenu of side bar insert  --
h:form id=sidemenuForm
ui:insert name=sidebar/
   /h:form

!-- content insert  --
h:form id=contentForm enctype=multipart/form-data
ui:insert name=content/
/h:form
/h:panelGrid

!--  footer insert  --
f:facet name=footer
ui:include src=footer.xhtml/
/f:facet
/h:panelGrid
/t:documentBody
/f:view
/t:document
--
View this message in context:
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
.html#a5749229
Sent from the MyFaces - Users forum at Nabble.com.



JSF Life Cycle / JSF Rendering question / Spring

2006-08-10 Thread Wolf Benz

Hi,

I have this question:
I am intercepting a JSF Bean 's action method (to apply method-based  
security) with Spring.


In it I do this (test code, hance the hard coding of a few vars) in  
Spring's invoke() method of the interceptor:


...
getFacesContext().addMessage(usersForm:errors, new FacesMessage 
(Security Error!));	// add msg to comp with clint ID errors in  
form usersForm

Iterator it3 = getFacesContext().getMessages(usersForm:errors);
while(it3.hasNext()){ logger.info(This is a msg of errors:  + 
((FacesMessage)it3.next()).getSummary());}


UIMessages errComp = (UIMessages)rootview.findComponent 
(usersForm:errors);

if(errComp == null)logger.info(errComp is null!);
errComp.decode(getFacesContext());  
// apply values to this comp
getFacesContext().getViewRoot().processUpdates(getFacesContext 
());		// force recursive (?) master refresh

...
return null; (to force JSF to stay on teh same page - this works  
fine. (if I call return inv.proceed(); it just continues of course))

Observations:
- This is a msg of errors:  actually prints out the error msg  
again, in my Eclipse console, so the error msg WAS effectively added  
to the component.

- errComp is null is never printed.
- As the msg wasn't shown in the page, I added the 2nd paragraph,  
hoping to force an updated rendering this way.


-- What is strange: the actual error message, is NEVER shown.

 In the page ,I have:
...
 t:messages id=errors globalOnly=true styleClass=error /
 /h:form
...

Any ideas as to what I'm doing wrong/how to force this component  
being rendered after all?


Thx guys,
Wolf


RE: Problem with myfaces/facelets template.xhtml

2006-08-10 Thread Gus

Hi David,

Thank you for your very quick reply. I got a little understand. Yes, the two
ui:include(header and footer) go to the right way, but the ui:insert
(sidebar and content) are not rendered correctly in the h:panelGrid
columns=2. Could you please give me some advice modifying it? Thanks again
for your help.

Gus


David Friedman-2 wrote:
 
 Gus,
 
 There is a little thing with Facelets that some components are compile
 time
 and some are render time.  I think you are mixing the two.  You might try
 putting each form inside h:panelGroup so ui:include can be sure where to
 place itself.  Also, did you get your columns created in the
 final/outputted
 html or is it skipping that, which might support my suggestion.
 
 Regards,
 David
 
 -Original Message-
 From: Gus [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 10, 2006 1:50 PM
 To: users@myfaces.apache.org
 Subject: Problem with myfaces/facelets template.xhtml
 
 
 
 Hi everyone,
 
 I just begin to learn Facelets and Myfaces. I created a template, but the
 template did display as expected. The sidebar and content should be
 displayed in two columns as left and right, but it always display in one
 columns as up and down. I really do not have any idea how to fix it. Any
 help will be apprieciated. Thank you in advance.
 
 Gus
 = Template.xhtml ==
 
 t:document xmlns=http://www.w3.org/1999/xhtml;
 xmlns:ui=http://java.sun.com/jsf/facelets;
 xmlns:h=http://java.sun.com/jsf/html;
 xmlns:f=http://java.sun.com/jsf/core;
 xmlns:t=http://myfaces.apache.org/tomahawk;
 xmlns:http=http://www.disy.de/commons/facelets/tag/http;
 f:view
 t:documentHead
 
 titleGlobal Documents/title
 t:stylesheet path=styles.css/
 
 !-- include file=/template/_jscript.js --
 !--@ include file=/template/AjaxRequest.js  --
 /script
 /t:documentHead
 t:documentBody
 h:panelGrid columns=1 styleClass=mainBody 
 rowClasses=row
 cellspacing=0 cellpadding=0 border=1
 !-- header insert --
 f:facet name=header
 h:form id=menuForm
 ui:include src=header.xhtml/
 /h:form
 /f:facet
 
 !-- body insert  --
 h:panelGrid columns=2 border=0
 styleClass=contentBody
 columnClasses=sidemenu, content
 cellspacing=1 cellpadding=0
 
 !-- submenu of side bar insert  --
 h:form id=sidemenuForm
 ui:insert name=sidebar/
/h:form
 
 !-- content insert  --
 h:form id=contentForm
 enctype=multipart/form-data
 ui:insert name=content/
 /h:form
 /h:panelGrid
 
 !--  footer insert  --
 f:facet name=footer
 ui:include src=footer.xhtml/
 /f:facet
 /h:panelGrid
 /t:documentBody
 /f:view
 /t:document
 --
 View this message in context:
 http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
 .html#a5749229
 Sent from the MyFaces - Users forum at Nabble.com.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5749920
Sent from the MyFaces - Users forum at Nabble.com.



Re: Wrap actionListener methods

2006-08-10 Thread Mike Kienenberger

On 7/19/06, Hubert Rabago [EMAIL PROTECTED] wrote:

Is there a way to wrap all calls to methods called by h:something
actionListener=/ attributes?  Something like
ActionListener.processAction(ActionEvent) does for h:something
action=/ methods?


Maybe, but we might have an easier time telling you how to solve your
particular problem rather than telling how you to accomplish a
specific technical task in this case.

I'd think ActionListener.processAction would work for both if it
worked for one, but I haven't actually browsed through the code.


Re: JSF Life Cycle / JSF Rendering question / Spring

2006-08-10 Thread Wolf Benz

In the meanwhile, I'v tried someting else, without success though:

Instead of woring with h:messages (which is buguous, cf earlier  
post), I worked with a regular label inside the form:

...
h:outputLabel styleClass=error value= id=globalErrorMsg/
h:message for=globalErrorMsg styleClass=error showSummary=true /
...
and coded: (in the same interceptor)

FacesEvent event = new ValueChangeEvent(errComp, oldValue,  
newValue);

event.setPhaseId(javax.faces.event.PhaseId.ANY_PHASE);
errComp.decode(getFacesContext());  // apply values to this comp
getFacesContext().getViewRoot().processUpdates(getFacesContext());

With this I had hoped (ANY_PHASE -- at least also the render  
respons phase) the outputLabel component would show newValue

But it didn't!
Someone to give me a hint?
Grr.

Wolf  (hence the gr ;-)

_


On 10 Aug 2006, at 20:24, Wolf Benz wrote:

Hi,

I have this question:
I am intercepting a JSF Bean 's action method (to apply method-based  
security) with Spring.


In it I do this (test code, hance the hard coding of a few vars) in  
Spring's invoke() method of the interceptor:


...
getFacesContext().addMessage(usersForm:errors, new FacesMessage 
(Security Error!));	// add msg to comp with clint ID errors in  
form usersForm

Iterator it3 = getFacesContext().getMessages(usersForm:errors);
while(it3.hasNext()){ logger.info(This is a msg of errors:  + 
((FacesMessage)it3.next()).getSummary());}


UIMessages errComp = (UIMessages)rootview.findComponent 
(usersForm:errors);

if(errComp == null)logger.info(errComp is null!);
errComp.decode(getFacesContext());  
// apply values to this comp
getFacesContext().getViewRoot().processUpdates(getFacesContext 
());		// force recursive (?) master refresh

...
return null; (to force JSF to stay on teh same page - this works  
fine. (if I call return inv.proceed(); it just continues of course))

Observations:
- This is a msg of errors:  actually prints out the error msg  
again, in my Eclipse console, so the error msg WAS effectively added  
to the component.

- errComp is null is never printed.
- As the msg wasn't shown in the page, I added the 2nd paragraph,  
hoping to force an updated rendering this way.


-- What is strange: the actual error message, is NEVER shown.

 In the page ,I have:
...
 t:messages id=errors globalOnly=true styleClass=error /
 /h:form
...

Any ideas as to what I'm doing wrong/how to force this component  
being rendered after all?


Thx guys,
Wolf



Issue with referencing a ManagedBean

2006-08-10 Thread Faisal Mahmoud
 Below is my managed bean. In the constructor, I get a reference to the managed property from Spring just to verify that it is available. I placed breakpoints in the code at the getSiteList() method, and my breakpoint is never hit prior to the error occuring.
//package com.warnerbros.mam.saw.jsf.page;import java.util.LinkedList;import java.util.List;import java.util.Map;import javax.faces.context.ExternalContext;import javax.faces.context.FacesContext
; import javax.servlet.ServletContext; import javax.servlet.http.HttpSession;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.springframework.context.ApplicationContext
;import org.springframework.web.context.support.WebApplicationContextUtils;import com.warnerbros.mam.saw.jsf.delegates.FtpSiteDelegate;import com.warnerbros.mam.saw.jsf.exc.BaseViewException;import com.warnerbros.mam.saw.model.user.SawUser
;/*** @author xfmahmou**/public class FtpSitesPage{/** * Default no-args constructor */public FtpSitesPage(){/**// Test code to verify that the FtpSiteDelegate bean is being created by Spring
 FacesContext facesContext = FacesContext.getCurrentInstance(); ServletContext servletContext = (ServletContext) facesContext.getExternalContext().getContext(); ApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext
(servletContext); Map beans = applicationContext.getBeansOfType(FtpSiteDelegate.class); FtpSiteDelegate f = (FtpSiteDelegate) beans.get(ftpSiteDelegate); */ }//PROPERTY: ftpSiteDelegate
public FtpSiteDelegate getFtpSiteDelegate() { return ftpSiteDelegate; } public void setFtpSiteDelegate(FtpSiteDelegate ftpSiteDelegate) { this.ftpSiteDelegate = ftpSiteDelegate; }//PROPERTY: siteListpublic List getSiteList()
{ // Retrieve SawUser from HttpSession FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext == null) { throw new NullPointerException(Retrieved NULL reference to FacesContext instance.); }
 logger.debug(Retrieved reference to FacesContext instance.); HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false); if (session == null) { throw new NullPointerException(Retrieved NULL reference to HttpSession instance.); }
 logger.debug(Retrieved reference to HttpSession instance.); SawUser sawUser = (SawUser) session.getAttribute(SawUser); if (sawUser == null) { throw new NullPointerException(Retrieved a NULL reference to the SawUser object retrieved from the HttpSession); }
 logger.debug(Retrieved a SawUser object from the HttpSession with userId =  + sawUser.getUserId());  List sites = null; try { sites = this.ftpSiteDelegate.getFtpSitesBySawUser(sawUser);
 } catch (BaseViewException e) { logger.error(e); //TODO: FacesMessage here sites = new LinkedList(); } if (sites == null) { // TODO: FacesMessage here NullPointerException e = new NullPointerException(Retrieved a NULL reference to a List of FtpSite objects.);
 logger.error(e); sites = new LinkedList(); } logger.debug(Returning a List of FtpSites objects for SawUser, userId =  + sawUser.getUserId()); return sites;}// View Associations
private FtpSiteDelegate ftpSiteDelegate; // Private constant membersprivate final Log logger = LogFactory.getLog(this.getClass());} -Original Message-From: octoberdan [mailto:
[EMAIL PROTECTED]]Sent: Tuesday, August 08, 2006 2:27 PMTo: users@myfaces.apache.orgSubject: Re: Issue with referencing a ManagedBeanDo you mind posting your managedbean?
--View this message in context: http://www.nabble.com/Issue-with-referencing-a-ManagedBean-tf2074677.html#a5715417
Sent from the MyFaces - Users forum at Nabble.com.


RE: Problem with myfaces/facelets template.xhtml

2006-08-10 Thread David Friedman
What was your final html ?  Did it list them as two different columns (i.e
td tags) or did it put them together?  If it put them both inside one td
tag, I recommend you try putting each h:form section inside the h:panelGroup
tag or perhaps inside another container tag which works within
h:panelGrid.

Regards,
David

-Original Message-
From: Gus [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 10, 2006 2:34 PM
To: users@myfaces.apache.org
Subject: RE: Problem with myfaces/facelets template.xhtml



Hi David,

Thank you for your very quick reply. I got a little understand. Yes, the two
ui:include(header and footer) go to the right way, but the ui:insert
(sidebar and content) are not rendered correctly in the h:panelGrid
columns=2. Could you please give me some advice modifying it? Thanks again
for your help.

Gus


David Friedman-2 wrote:

 Gus,

 There is a little thing with Facelets that some components are compile
 time
 and some are render time.  I think you are mixing the two.  You might try
 putting each form inside h:panelGroup so ui:include can be sure where to
 place itself.  Also, did you get your columns created in the
 final/outputted
 html or is it skipping that, which might support my suggestion.

 Regards,
 David

 -Original Message-
 From: Gus [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 10, 2006 1:50 PM
 To: users@myfaces.apache.org
 Subject: Problem with myfaces/facelets template.xhtml



 Hi everyone,

 I just begin to learn Facelets and Myfaces. I created a template, but the
 template did display as expected. The sidebar and content should be
 displayed in two columns as left and right, but it always display in one
 columns as up and down. I really do not have any idea how to fix it. Any
 help will be apprieciated. Thank you in advance.

 Gus
 = Template.xhtml ==

 t:document xmlns=http://www.w3.org/1999/xhtml;
 xmlns:ui=http://java.sun.com/jsf/facelets;
 xmlns:h=http://java.sun.com/jsf/html;
 xmlns:f=http://java.sun.com/jsf/core;
 xmlns:t=http://myfaces.apache.org/tomahawk;
 xmlns:http=http://www.disy.de/commons/facelets/tag/http;
 f:view
 t:documentHead

 titleGlobal Documents/title
 t:stylesheet path=styles.css/

 !-- include file=/template/_jscript.js --
 !--@ include file=/template/AjaxRequest.js  --
 /script
 /t:documentHead
 t:documentBody
 h:panelGrid columns=1 styleClass=mainBody
 rowClasses=row
 cellspacing=0 cellpadding=0 border=1
 !-- header insert --
 f:facet name=header
 h:form id=menuForm
 ui:include src=header.xhtml/
 /h:form
 /f:facet

 !-- body insert  --
 h:panelGrid columns=2 border=0
 styleClass=contentBody
 columnClasses=sidemenu, content
 cellspacing=1 cellpadding=0

 !-- submenu of side bar insert  --
 h:form id=sidemenuForm
 ui:insert name=sidebar/
/h:form

 !-- content insert  --
 h:form id=contentForm
 enctype=multipart/form-data
 ui:insert name=content/
 /h:form
 /h:panelGrid

 !--  footer insert  --
 f:facet name=footer
 ui:include src=footer.xhtml/
 /f:facet
 /h:panelGrid
 /t:documentBody
 /f:view
 /t:document
 --
 View this message in context:

http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
 .html#a5749229
 Sent from the MyFaces - Users forum at Nabble.com.




--
View this message in context:
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
.html#a5749920
Sent from the MyFaces - Users forum at Nabble.com.



RE: Problem with myfaces/facelets template.xhtml

2006-08-10 Thread Gus

Hi David,
The template I want is 
table
trtd colspan=2header/td/tr
trtdsidemenu/td  tdcontent/td/tr
trtd colspan=2footer/tdtr
/table
in jsf:
h:panelGrid columns=2
f:facet name=header
   header
/f:facet
h:panelGridsidebar/h:panelGrid
h:panelGridcontent/h:panelGrid
f:facet name=footer
   footer
/f:facet
I ever used the template in myface/tiles, and it displayed fine. However,
when I transfer the codes to facelets, it did not display well. I do not
know why. Thank you for help.

Best regards,

Gus


David Friedman-2 wrote:
 
 What was your final html ?  Did it list them as two different columns (i.e
 td tags) or did it put them together?  If it put them both inside one
 td
 tag, I recommend you try putting each h:form section inside the
 h:panelGroup
 tag or perhaps inside another container tag which works within
 h:panelGrid.
 
 Regards,
 David
 
 -Original Message-
 From: Gus [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 10, 2006 2:34 PM
 To: users@myfaces.apache.org
 Subject: RE: Problem with myfaces/facelets template.xhtml
 
 
 
 Hi David,
 
 Thank you for your very quick reply. I got a little understand. Yes, the
 two
 ui:include(header and footer) go to the right way, but the ui:insert
 (sidebar and content) are not rendered correctly in the h:panelGrid
 columns=2. Could you please give me some advice modifying it? Thanks
 again
 for your help.
 
 Gus
 
 
 David Friedman-2 wrote:

 Gus,

 There is a little thing with Facelets that some components are compile
 time
 and some are render time.  I think you are mixing the two.  You might try
 putting each form inside h:panelGroup so ui:include can be sure where to
 place itself.  Also, did you get your columns created in the
 final/outputted
 html or is it skipping that, which might support my suggestion.

 Regards,
 David

 -Original Message-
 From: Gus [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 10, 2006 1:50 PM
 To: users@myfaces.apache.org
 Subject: Problem with myfaces/facelets template.xhtml



 Hi everyone,

 I just begin to learn Facelets and Myfaces. I created a template, but the
 template did display as expected. The sidebar and content should be
 displayed in two columns as left and right, but it always display in one
 columns as up and down. I really do not have any idea how to fix it. Any
 help will be apprieciated. Thank you in advance.

 Gus
 = Template.xhtml ==

 t:document xmlns=http://www.w3.org/1999/xhtml;
 xmlns:ui=http://java.sun.com/jsf/facelets;
 xmlns:h=http://java.sun.com/jsf/html;
 xmlns:f=http://java.sun.com/jsf/core;
 xmlns:t=http://myfaces.apache.org/tomahawk;
 xmlns:http=http://www.disy.de/commons/facelets/tag/http;
 f:view
 t:documentHead

 titleGlobal Documents/title
 t:stylesheet path=styles.css/

 !-- include file=/template/_jscript.js --
 !--@ include file=/template/AjaxRequest.js  --
 /script
 /t:documentHead
 t:documentBody
 h:panelGrid columns=1 styleClass=mainBody
 rowClasses=row
 cellspacing=0 cellpadding=0 border=1
 !-- header insert --
 f:facet name=header
 h:form id=menuForm
 ui:include src=header.xhtml/
 /h:form
 /f:facet

 !-- body insert  --
 h:panelGrid columns=2 border=0
 styleClass=contentBody
 columnClasses=sidemenu, content
 cellspacing=1 cellpadding=0

 !-- submenu of side bar insert  --
 h:form id=sidemenuForm
 ui:insert name=sidebar/
/h:form

 !-- content insert  --
 h:form id=contentForm
 enctype=multipart/form-data
 ui:insert name=content/
 /h:form
 /h:panelGrid

 !--  footer insert  --
 f:facet name=footer
 ui:include src=footer.xhtml/
 /f:facet
 /h:panelGrid
 /t:documentBody
 /f:view
 /t:document
 --
 View this message in context:

 http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
 .html#a5749229
 Sent from the MyFaces - Users forum at Nabble.com.



 
 --
 View this message in context:
 http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
 .html#a5749920
 Sent from the MyFaces - Users forum at Nabble.com.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5752389
Sent from the MyFaces - Users forum at Nabble.com.



Datatable preserveRowStates and remove row problem

2006-08-10 Thread Surapuraju, Vamsi
 
Hi,
  I tried to remove a row from data table which has preserveRowStates
set to true and I noticed deleted row data is being shown an the next
row. Does anyone know How I can keep the modified data on the table with
out using preserveRowStates. I want to be able to remove the row from
data table and keep modified data. 

Thank You very Much

Vamsi Surapuraju




**
This email and any files transmitted with it are the property of Quadrivius, 
its subsidiaries, affiliates, or related companies, are 
confidential, and are intended solely for the use of the individual or entity 
to whom this email is addressed. Please notify the 
sender by return email if you are not the intended recipient. If you are not 
the intended recipient, you may not copy, retain, print,
disclose, or distribute this message or its contents to any other individual or 
entity. Quadrivius, its subsidiaries, affiliates or 
related companies, reserves the right to monitor and review the content of all 
messages sent to or from this email address.
**




RE: Issue with referencing a ManagedBean

2006-08-10 Thread David Friedman



Faisal,

I see 
at least two possible problems with your below code:

1) You 
are not checking the correct log files so you are missing the logged messages 
explaining where your code is going wrong. You keep resetting your 
"sites" item to a 
"new LinkedList()" before returning it. In your code example you reset 
"sites" in two distinct places to a blank LinkedList which could explain your 
out of bounds index message:


Caused by: java.lang.StringIndexOutOfBoundsException : String 
index out of range: -1

2) You 
are passing your exceptions up the code tree when an exception is throw other 
than the ONE Exception you look for in your catch statement: 
BaseViewException. Try changing that to a simple and generic "Exception" 
class so you catch and log ALL TYPES of exceptions without risking them 
being thrown up the chain and bypassing the rest of the code in your 
method.

Additionally, I have some constructive criticism 
for you: 

Resending posts is considered rude, especially 3 times as you seem to 
have. If you are unsure about a post getting through you should check a 
list archive site such as nabble.com. If no one answers your 
post
it 
often has one of 3 reasons:

1. The person or persons helping you do not yet 
have time to review your post.
2. 
Your problem is completely unrelated to other people's work that no one is 
interested in your issue.
3. 
Your question could be so obvious no one wants to spend time answering it. 
(rarest)

Also, if you had taken the last 3 days to learn how to 
use a debugger (I use Eclipse 3.2 for with 
a Tomcat plugIn allowing for live webapp debugging) I'm sure you would have 
solved your problem a long time ago and been on to your next coding 
issue. Plus, the 2 suggestions I made are very common problem 
solving techniques. Since there are plenty of other in-code debugging 
techniques around, I recommend you skim the net (search engine) to find new ways 
to debug java webapps. And incase 
you were wondering, I am self-taught so I didn't learn any of these techniques 
in a class but through various books and some of the programming lists I 
subscribe to, like this one.

That being said, be sure to let us know if these two 
main suggestions helped.

Regards,
David


  -Original Message-From: Faisal Mahmoud 
  [mailto:[EMAIL PROTECTED]Sent: Thursday, August 10, 2006 
  4:03 PMTo: MyFaces DiscussionSubject: Issue with 
  referencing a ManagedBeanBelow is my managed bean. In the 
  constructor, I get a reference to the managed property from Spring just to 
  verify that it is available. I placed breakpoints in the code at the 
  getSiteList() method, and my breakpoint is never hit prior to the error 
  occuring.public List getSiteList() { // David Friedman] Cut Codenot important 
  to this reply. List sites = null; 
  try { sites = 
  this.ftpSiteDelegate.getFtpSitesBySawUser(sawUser);  } 
  catch (BaseViewException e) { 
  logger.error(e);/./ Did the above error 
  log? Here you reset your sites to a blank, which would causeerror 
  -1 index etc. //TODO: FacesMessage 
  here sites = new LinkedList(); } if (sites 
  == null) { // TODO: FacesMessage 
  here NullPointerException e = new 
  NullPointerException("Retrieved a NULL reference to a List of FtpSite 
  objects.");  logger.error(e);//Did the above error log?Here you 
  reset your sites to a blank, which would cause the error-1 index 
  etc sites = new LinkedList(); 
  } logger.debug("Returning a List of FtpSites objects for SawUser, 
  userId = " + sawUser.getUserId()); return 
sites;}


RE: Problem with myfaces/facelets template.xhtml

2006-08-10 Thread David Friedman
Right, but what did you get over in your browser?  Knowing what came out in
the wrong places in the browser helps you figure out what parts of the
.xhtml page are acting incorrectly.  THEN we can act/work on those items.

Regards,
David

-Original Message-
From: Gus [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 10, 2006 4:54 PM
To: users@myfaces.apache.org
Subject: RE: Problem with myfaces/facelets template.xhtml



Hi David,
The template I want is
table
trtd colspan=2header/td/tr
trtdsidemenu/td  tdcontent/td/tr
trtd colspan=2footer/tdtr
/table
in jsf:
h:panelGrid columns=2
f:facet name=header
   header
/f:facet
h:panelGridsidebar/h:panelGrid
h:panelGridcontent/h:panelGrid
f:facet name=footer
   footer
/f:facet
I ever used the template in myface/tiles, and it displayed fine. However,
when I transfer the codes to facelets, it did not display well. I do not
know why. Thank you for help.

Best regards,

Gus



RE: Problem with myfaces/facelets template.xhtml

2006-08-10 Thread Tom Innes
I had similar problems.  What I have discovered is that if you place the
column in a h:panelGroup the issues will go away.  I have noticed that
comments and jstl will cause the html to rendered incorrectly.


For Instance

h:panelGroup
 !-- submenu of side bar insert  --
 h:form id=sidemenuForm
   ui:insert name=sidebar/
  /h:form
\h:panelGroup
 
  

Make sure any comments or jstl are inside the h:panelGroup  

Hope this helps,

Tom

-Original Message-
From: Gus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 10, 2006 2:34 PM
To: users@myfaces.apache.org
Subject: RE: Problem with myfaces/facelets template.xhtml


Hi David,

Thank you for your very quick reply. I got a little understand. Yes, the two
ui:include(header and footer) go to the right way, but the ui:insert
(sidebar and content) are not rendered correctly in the h:panelGrid
columns=2. Could you please give me some advice modifying it? Thanks again
for your help.

Gus


David Friedman-2 wrote:
 
 Gus,
 
 There is a little thing with Facelets that some components are compile
 time
 and some are render time.  I think you are mixing the two.  You might try
 putting each form inside h:panelGroup so ui:include can be sure where to
 place itself.  Also, did you get your columns created in the
 final/outputted
 html or is it skipping that, which might support my suggestion.
 
 Regards,
 David
 
 -Original Message-
 From: Gus [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 10, 2006 1:50 PM
 To: users@myfaces.apache.org
 Subject: Problem with myfaces/facelets template.xhtml
 
 
 
 Hi everyone,
 
 I just begin to learn Facelets and Myfaces. I created a template, but the
 template did display as expected. The sidebar and content should be
 displayed in two columns as left and right, but it always display in one
 columns as up and down. I really do not have any idea how to fix it. Any
 help will be apprieciated. Thank you in advance.
 
 Gus
 = Template.xhtml ==
 
 t:document xmlns=http://www.w3.org/1999/xhtml;
 xmlns:ui=http://java.sun.com/jsf/facelets;
 xmlns:h=http://java.sun.com/jsf/html;
 xmlns:f=http://java.sun.com/jsf/core;
 xmlns:t=http://myfaces.apache.org/tomahawk;
 xmlns:http=http://www.disy.de/commons/facelets/tag/http;
 f:view
 t:documentHead
 
 titleGlobal Documents/title
 t:stylesheet path=styles.css/
 
 !-- include file=/template/_jscript.js --
 !--@ include file=/template/AjaxRequest.js  --
 /script
 /t:documentHead
 t:documentBody
 h:panelGrid columns=1 styleClass=mainBody 
 rowClasses=row
 cellspacing=0 cellpadding=0 border=1
 !-- header insert --
 f:facet name=header
 h:form id=menuForm
 ui:include src=header.xhtml/
 /h:form
 /f:facet
 
 !-- body insert  --
 h:panelGrid columns=2 border=0
 styleClass=contentBody
 columnClasses=sidemenu, content
 cellspacing=1 cellpadding=0
 
 !-- submenu of side bar insert  --
 h:form id=sidemenuForm
 ui:insert name=sidebar/
/h:form
 
 !-- content insert  --
 h:form id=contentForm
 enctype=multipart/form-data
 ui:insert name=content/
 /h:form
 /h:panelGrid
 
 !--  footer insert  --
 f:facet name=footer
 ui:include src=footer.xhtml/
 /f:facet
 /h:panelGrid
 /t:documentBody
 /f:view
 /t:document
 --
 View this message in context:

http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
 .html#a5749229
 Sent from the MyFaces - Users forum at Nabble.com.
 
 
 

-- 
View this message in context:
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
.html#a5749920
Sent from the MyFaces - Users forum at Nabble.com.




Re: many components to one (or more) validation?

2006-08-10 Thread Mike Kienenberger

On 8/9/06, Joe ersinghaus [EMAIL PROTECTED] wrote:

Is it possible to have more than one component validated as a group? For
example:  let's say I've have a radio button that when activated, text
must be entered/validated in that radio button's associated input field?

In other words, only when the radio button is selected, should the input
filed be validated.


It's occurring to me that I need something somewhat similar.  I need
to verify that if a starting date is specified, a second ending date
is also specified.  Up to this point, I've been doing the validation
like this in my action method and binding the components to my backing
bean.

However, it'd really be more convenient to handle this as a real validator.

So let's brainstorm how this would work, and I'll throw together
something from a clone of my compareToValidator.

Maybe something like validateRequiredIf for=other component
operator=an operator value=a value binding

So for my dates, I'd use

 inputCalendar id=startingDate
 validateRequiredIf for=endingDate operator=ne value=null
 /inputCalendar

 inputCalendar id=endingDate
 validateRequiredIf for=startingDate operator=ne value=null
 /inputCalendar

I have to put it on both.   If I put it only on endingDate, then if
endingDate was null, the validateRelationship would not be executed.


So how would this work for your situation?  The validator has to be on
a non-null input component.

 radiobutton id=radioComponent
 validateRequiredIf for=associatedInput operator=ne value=null
 /radiobutton
 inputText id=associatedInput
 /inputText

Seems ackward.   Maybe it needs a better name.   Maybe we could just
drop the operator/value attributes (it'd be true for our two use
cases).


Re: selectBooleanCheckbox not checked after valuechange, why?

2006-08-10 Thread Johnny Gonzalez
Hello Gerald,Sorry for taking to long to answer,...the part of the JSP I have is this:t:tree2 id="serverTree" value="#{EntradasBean.modeloArbol}" var="node" varNodeToggler="t" clientSideToggle="true"   f:facet name="opcion"   h:panelGrouph:selectBooleanCheckbox title="#{node.description}"
 value="#{node.checked}" valueChangeListener="#{EntradasBean.checkBoxSelected}"  immediate="true"/ h:outputText value="#{node.description}" style="FONT: xx-small Verdana, Arial, Helvetica, sans-serif;" styleClass="nodeFolder"/   /h:panelGroup  /f:facet 
  f:facet name="menu"   h:panelGroup   h:selectBooleanCheckbox title="#{node.description}" value="true" valueChangeListener="#{EntradasBean.checkBoxSelected}"  immediate="true"/h:outputText value="*" rendered="#{t.nodeSelected}" /  
  h:outputText value="#{node.description}" styleClass="nodeFolder" style="FONT: xx-small Verdana, Arial, Helvetica, sans-serif;" /   /h:panelGroup  /f:facet  f:facet name="raiz"  
 h:panelGrouph:selectBooleanCheckbox title="#{node.description}" value="true" valueChangeListener="#{EntradasBean.checkBoxSelected}"  immediate="true"/h:outputText value="#{node.description}" styleClass="nodeFolder" style="FONT: xx-small Verdana, Arial, Helvetica, sans-serif;" /   /h:panelGroup  /f:facet 
   /t:tree2  and in the backing bean I have:this is the valueChangeEvent method:public void checkBoxSelected(ValueChangeEvent event){   FacesContext contexto = FacesContext.getCurrentInstance();   // Obtengo la sesion en que estamos   HttpSession sesion = ( HttpSession ) contexto.getExternalContext().getSession( false );   // Objeto para manejar el radio button   HtmlSelectBooleanCheckbox select = ( HtmlSelectBooleanCheckbox ) event.getComponent(); 
  String valor = new String();   if(select.getValue().equals(true)){valor = ( String ) select.getTitle();System.out.println("ValueChange: "+valor);this.checkBoxSelected.add(valor);   }   select.setValue(new Boolean(true)); for(String s: this.checkBoxSelected){System.out.println(this.checkBoxSelected.size());System.out.println(s);
   }}What do you think about it?thanks a lot,JohnnyGerald Müllan [EMAIL PROTECTED] escribió: Hi,have you set the value attribute of the h:selectBooleanCheckbox component?What do you do in the backend method?Would be helpful if you could support with some code fragments.cheers,GeraldOn 8/9/06, Johnny Gonzalez <[EMAIL PROTECTED]> wrote: Hello everybody, I have built a tree with selectBooleanCheckbox, I wrote a valuechange event to store if every of the h:selectBooleanCheckbox, were selected, but after the method is executed the page is
 repainted and the h:selectBooleanCheckbox that I selected appears unchecked, why this strange behaviour? TIA, Johnny   LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com-- Gerald MüllanSchelleingasse 2/111040 Vienna, Austria0043 699 11772506[EMAIL PROTECTED] 
		LLama Gratis a cualquier PC del Mundo.Llamadas a fijos y móviles desde 1 céntimo por minuto.http://es.voice.yahoo.com

RE: Problem with myfaces/facelets template.xhtml

2006-08-10 Thread Gus

David,

The sidebar and content should be in two columns(left and right), but they
were displayed in one column (top and down). I did not review the rendered
html code. I will send it you later. Thank you.
Best wishes!
Gus.


David Friedman-2 wrote:
 
 Right, but what did you get over in your browser?  Knowing what came out
 in
 the wrong places in the browser helps you figure out what parts of the
 .xhtml page are acting incorrectly.  THEN we can act/work on those items.
 
 Regards,
 David
 
 -Original Message-
 From: Gus [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 10, 2006 4:54 PM
 To: users@myfaces.apache.org
 Subject: RE: Problem with myfaces/facelets template.xhtml
 
 
 
 Hi David,
 The template I want is
 table
 trtd colspan=2header/td/tr
 trtdsidemenu/td  tdcontent/td/tr
 trtd colspan=2footer/tdtr
 /table
 in jsf:
 h:panelGrid columns=2
 f:facet name=header
header
 /f:facet
 h:panelGridsidebar/h:panelGrid
 h:panelGridcontent/h:panelGrid
 f:facet name=footer
footer
 /f:facet
 I ever used the template in myface/tiles, and it displayed fine. However,
 when I transfer the codes to facelets, it did not display well. I do not
 know why. Thank you for help.
 
 Best regards,
 
 Gus
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5753030
Sent from the MyFaces - Users forum at Nabble.com.



RE: JSF Life Cycle / JSF Rendering question / Spring

2006-08-10 Thread Dhananjay Prasanna

Hi Wolf,

From a quick glance you have globalOnly=true in your h:messages and it
looks like you're adding a message with a handle userForm:errors
(non-global). Try setting globalOnly to false or creating a faces
message with a null handle (to make the message global).

For the second problem of using outputLabel with h:message , I don't see
any code adding a faces message for component id=globalErrorMsg so
likely as not it will not show anything. But I don't think Ive
understood what you're trying to do here so this may not be an
appropriate answer...

Dhanji.


PS: shouldn't it be *growl* =)

-Original Message-
From: Wolf Benz [mailto:[EMAIL PROTECTED]
Sent: Friday, 11 August 2006 5:53 AM
To: MyFaces Discussion
Subject: Re: JSF Life Cycle / JSF Rendering question / Spring

In the meanwhile, I'v tried someting else, without success though:

Instead of woring with h:messages (which is buguous, cf earlier 
post), I worked with a regular label inside the form:
...
h:outputLabel styleClass=error value= id=globalErrorMsg/
h:message for=globalErrorMsg styleClass=error showSummary=true /
...
and coded: (in the same interceptor)

FacesEvent event = new ValueChangeEvent(errComp, oldValue, 
newValue);
event.setPhaseId(javax.faces.event.PhaseId.ANY_PHASE);
errComp.decode(getFacesContext());  // apply values to this comp
getFacesContext().getViewRoot().processUpdates(getFacesContext());

With this I had hoped (ANY_PHASE -- at least also the render 
respons phase) the outputLabel component would show newValue
But it didn't!
Someone to give me a hint?
Grr.

Wolf  (hence the gr ;-)

_


On 10 Aug 2006, at 20:24, Wolf Benz wrote:

Hi,

I have this question:
I am intercepting a JSF Bean 's action method (to apply method-based 
security) with Spring.

In it I do this (test code, hance the hard coding of a few vars) in 
Spring's invoke() method of the interceptor:

...
getFacesContext().addMessage(usersForm:errors, new FacesMessage
(Security Error!));   // add msg to comp with clint ID errors in 
form usersForm
Iterator it3 = getFacesContext().getMessages(usersForm:errors);
while(it3.hasNext()){ logger.info(This is a msg of errors:  +
((FacesMessage)it3.next()).getSummary());}

UIMessages errComp = (UIMessages)rootview.findComponent
(usersForm:errors);
if(errComp == null)logger.info(errComp is null!);
errComp.decode(getFacesContext());
// apply values to this comp
getFacesContext().getViewRoot().processUpdates(getFacesContext
());// force recursive (?) master refresh
...
return null; (to force JSF to stay on teh same page - this works 
fine. (if I call return inv.proceed(); it just continues of course))
Observations:
- This is a msg of errors:  actually prints out the error msg 
again, in my Eclipse console, so the error msg WAS effectively added 
to the component.
- errComp is null is never printed.
- As the msg wasn't shown in the page, I added the 2nd paragraph, 
hoping to force an updated rendering this way.

-- What is strange: the actual error message, is NEVER shown.

 In the page ,I have:
...
  t:messages id=errors globalOnly=true styleClass=error /
  /h:form
...

Any ideas as to what I'm doing wrong/how to force this component 
being rendered after all?

Thx guys,
Wolf


This correspondence is for the named persons only.
It may contain confidential or privileged information or both.
No confidentiality or privilege is waived or lost by any mis transmission.
If you receive this correspondence in error please delete it from your system 
immediately and notify the sender.
You must not disclose, copy or relay on any part of this correspondence, if you 
are not the intended recipient.
Any opinions expressed in this message are those of the individual sender 
except where the sender expressly,
and with the authority, states them to be the opinions of the Department of 
Emergency Services, Queensland.


RE: Problem with myfaces/facelets template.xhtml

2006-08-10 Thread Gus

Hi David,

It seems I found the problem. After I moved the several comments in the
template.html, it displays correctly. Modified codes is as follows:
h:panelGrid columns=1 styleClass=mainBody  rowClasses=row

cellspacing=0 cellpadding=0 border=1
f:facet name=header
ui:include src=header.xhtml/
/f:facet

h:panelGrid columns=2 border=0
styleClass=contentBody 
columnClasses=sidemenu, content
cellspacing=1 cellpadding=0

ui:insert name=sidebar/
   
ui:insert name=content/
   
/h:panelGrid 

f:facet name=footer
ui:include src=footer.xhtml/  
/f:facet
/h:panelGrid

Thank you so much for your help.
Best regards,

Gus



David Friedman-2 wrote:
 
 Right, but what did you get over in your browser?  Knowing what came out
 in
 the wrong places in the browser helps you figure out what parts of the
 .xhtml page are acting incorrectly.  THEN we can act/work on those items.
 
 Regards,
 David
 
 -Original Message-
 From: Gus [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 10, 2006 4:54 PM
 To: users@myfaces.apache.org
 Subject: RE: Problem with myfaces/facelets template.xhtml
 
 
 
 Hi David,
 The template I want is
 table
 trtd colspan=2header/td/tr
 trtdsidemenu/td  tdcontent/td/tr
 trtd colspan=2footer/tdtr
 /table
 in jsf:
 h:panelGrid columns=2
 f:facet name=header
header
 /f:facet
 h:panelGridsidebar/h:panelGrid
 h:panelGridcontent/h:panelGrid
 f:facet name=footer
footer
 /f:facet
 I ever used the template in myface/tiles, and it displayed fine. However,
 when I transfer the codes to facelets, it did not display well. I do not
 know why. Thank you for help.
 
 Best regards,
 
 Gus
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5754667
Sent from the MyFaces - Users forum at Nabble.com.



Nowrap on tree2

2006-08-10 Thread Gus

Hi everyone,

It is my first time to use tree2. It is very nice and very friendly, but I
don't know how to set nowrap to tree node (img+nodename+(count)=one line).
From the partial rendered codes: 
tdimg id=contentForm:clientTree:0:0:0:0:t2c
src=/context/images/yellow-folder-closed.png border=0span
class=nodeFolderNode Name/span span class=childCount(2)/span/td
it seems I need to add style=white space:nowrap; in the td tag, like td
style=white space:nowrap;, but I don't know how to add into t:tree2 tag.
Could you somebody give me a help? Thank you very much in advance.
Best regards,
Gus
-- 
View this message in context: 
http://www.nabble.com/Nowrap-on-tree2-tf2088607.html#a5756627
Sent from the MyFaces - Users forum at Nabble.com.