clay - custom converter example

2006-11-08 Thread Torsten Krah
Does anyone using clay with custom converters?
I have a label which should get a converter. Tried it this way in clay
config:

...
element renderId=2 jsfid=baseLabel
attributes
set name=value value=#{user.language} /
/attributes
element renderId=1 jsfid=f:converter
attributes
set name=converterId 
value=language /
/attributes
/element
/element

registered the converter in faces-config.xml.

Exception looks like this:

 ERROR http-8080-Processor25
org.apache.myfaces.application.ApplicationImpl - Undefined component
type override
 ERROR http-8080-Processor25
org.apache.shale.clay.component.chain.CreateComponentCommand - Cannot
create Component renderId=1 jsfid=f:converter
componentType=override extends=f:converter allowBody=null
facetName=null
 javax.faces.FacesException: Undefined component type override


Any hints how to use custom converters and clay?

Torsten


smime.p7s
Description: S/MIME cryptographic signature


[newbie] How to use Tobago with shale?

2006-11-08 Thread Philb

hi,

I'm trying to use Apache Tobago with Shale. The problem is that my tobago
renderkit gets replaced when I access the page: [RenderKitFactoryImpl]
RenderKit with renderKitId 'tobago' was replaced.
Am I doing something wrong? I used the shale-blank example end extended that
with tobago configuration and a page with tobago components.

my web xml: listeners and servlet mapping:
  listener
listener-class
  org.apache.commons.chain.web.ChainListener
/listener-class
  /listener
  
listener
 
listener-classorg.apache.myfaces.webapp.StartupServletContextListener/listener-class
/listener

listener
   
listener-classorg.apache.myfaces.tobago.webapp.TobagoServletContextListener/listener-class
/listener

  !-- JavaServer Faces Servlet Configuration --
  servlet
servlet-namefaces/servlet-name
servlet-classjavax.faces.webapp.FacesServlet/servlet-class
load-on-startup3/load-on-startup
  /servlet
  
  servlet
servlet-nameResourceServlet/servlet-name
   
servlet-classorg.apache.myfaces.tobago.servlet.ResourceServlet/servlet-class
  /servlet
  
  !-- JavaServer Faces Servlet Mapping --
  servlet-mapping
servlet-namefaces/servlet-name
url-pattern/faces/*/url-pattern
  /servlet-mapping
  
  servlet-mapping
servlet-nameResourceServlet/servlet-name
url-pattern/org/apache/myfaces/tobago/renderkit/*/url-pattern
  /servlet-mapping
-- 
View this message in context: 
http://www.nabble.com/-newbie--How-to-use-Tobago-with-shale--tf2593954.html#a7234723
Sent from the Shale - User mailing list archive at Nabble.com.



Re: Is it a postback or a fresh page load?

2006-11-08 Thread Craig McClanahan

On 11/8/06, Ramineni Viswanath [EMAIL PROTECTED] wrote:


While on a page, I call the same page with a different
set of query parameters, it is being treated as a
postback.

For example my current url is

/mainmenu.faces?menuid=0

I have a HtmlOutputLink on this page with the value
set to /mainmenu.faces?menuid=26. When I click on this
link, isPostBack() is showing true. Is this the
correct and intended behaviour?



The mechanism used to declare a request being a postback is whether the
ViewController.restoreView() method provided by JSF determines that there
was an existing view that could be restored.  In turn, if you are using
server side state saving with current 1.1 implementations, this decision is
based solely on the view identifier, not on any related parameters.  Thus,
if you are using server side state saving, JSF will treat your two URLs as
being the same, and will restore the previous state (and, therefore, the
postback property will be set to true).

If you were to use client side state saving, on the other hand, the two URLs
would be considered distinct views (since the HtmlOutputLink ends up doing a
GET to the second URL), with no state to be restored, and therefore postback
would be false.

--Vish


Craig


Re: clay - custom converter example

2006-11-08 Thread Gary VanMatre

Does anyone using clay with custom converters?I have a label which should get a converter. Tried it this way in clayconfig:...element renderId="2" jsfid="baseLabel"			 attributes set name="value" value="#{user.language}" /			 /attributes			 element renderId="1" jsfid="f:converter"	 attributes		 set name="converterId" value="language" / /attributes			 /element/element
Try using the converter node under the element. The element and component includes converters, validators, actionListeners, valueChangeListeners use the nested element that points to a top-level definition.
!ELEMENT element (description*, attributes?, symbols?, converter?, validator*, actionListener*, valueChangeListener*, element*)
component jsfid="language" componentType="converter-id-in-faces-config"
element renderId="2" jsfid="baseLabel" attributes  set name="value" value="#{user.language}" //attributes converter jsfid="language" attributes
 /attributes /converter/element
Using the generic f:converter and the converterId doesn't work as you would expecteven if you use a conveter node. This example should work but doesn't:
 converter jsfid="f:converter" attributes
 set name="converterId" value="language" / /attributes /converter
I'll see if I can get that one fixed. Please create a JIRA ticket.

Gary
---BeginMessage---
Does anyone using clay with custom converters?
I have a label which should get a converter. Tried it this way in clay
config:

...
element renderId=2 jsfid=baseLabel
attributes
set name=value value=#{user.language} /
/attributes
element renderId=1 jsfid=f:converter
attributes
set name=converterId 
value=language /
/attributes
/element
/element

registered the converter in faces-config.xml.

Exception looks like this:

 ERROR http-8080-Processor25
org.apache.myfaces.application.ApplicationImpl - Undefined component
type override
 ERROR http-8080-Processor25
org.apache.shale.clay.component.chain.CreateComponentCommand - Cannot
create Component renderId=1 jsfid=f:converter
componentType=override extends=f:converter allowBody=null
facetName=null
 javax.faces.FacesException: Undefined component type override


Any hints how to use custom converters and clay?

Torsten


smime.p7s
Description: S/MIME cryptographic signature
---End Message---


Re: Is it a postback or a fresh page load?

2006-11-08 Thread David Geary

2006/11/8, Craig McClanahan [EMAIL PROTECTED]:


On 11/8/06, Ramineni Viswanath [EMAIL PROTECTED] wrote:

 While on a page, I call the same page with a different
 set of query parameters, it is being treated as a
 postback.

 For example my current url is

 /mainmenu.faces?menuid=0

 I have a HtmlOutputLink on this page with the value
 set to /mainmenu.faces?menuid=26. When I click on this
 link, isPostBack() is showing true. Is this the
 correct and intended behaviour?


The mechanism used to declare a request being a postback is whether the
ViewController.restoreView() method provided by JSF determines that there
was an existing view that could be restored.  In turn, if you are using
server side state saving with current 1.1 implementations, this decision
is
based solely on the view identifier, not on any related parameters.  Thus,
if you are using server side state saving, JSF will treat your two URLs as
being the same, and will restore the previous state (and, therefore, the
postback property will be set to true).

If you were to use client side state saving, on the other hand, the two
URLs
would be considered distinct views (since the HtmlOutputLink ends up doing
a
GET to the second URL), with no state to be restored, and therefore
postback
would be false.



Holy cow, I didn't know that. Is that not a bug according the definition of
a postback? IMO, behaviour that differs depending upon state-saving mode is
bad news.


david

--Vish



Craig




Re: new to shale tiles

2006-11-08 Thread Jonathan Smith

added the space and the flush false now i get a

java.lang.IncompatibleClassChangeError

org.apache.shale.tiles.TilesViewHandler.dispatchToTile(TilesViewHandler.java:304)

org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:160)

org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)

org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:267)

what does this mean?



From: David Geary [EMAIL PROTECTED]
Reply-To: user@shale.apache.org
To: user@shale.apache.org
Subject: Re: new to shale tiles
Date: Wed, 8 Nov 2006 10:09:47 -0700

I believe you're missing a space between the two attributes. Also, you
should specify flush=false or you're bound to run into problems.


david

2006/11/8, Antonio Petrelli [EMAIL PROTECTED]:


Jonathan Smith ha scritto:
 ok when i do this

 tiles:insert definition=debug2flush=true/tiles:insert

 with this as the definition

 tiles-definitions




 definition name=debug2 path=debug2.jsp
 put name=header type=template
 value=/debug/debug-header.jsp /
 /definition

 definition name=header value=/debug/debug-header.jsp /

 /tiles-definitions


 I get this

 javax.servlet.ServletException: /debug2.jsp(4,0) Attribute definition
 invalid for tag insert according to TLD
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
 org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(
ShaleApplicationFilter.java:267)


 what am i doing wrong?

It's not your fault :-) Notice that Tiles 2 is under heavy development.
For example you have a snapshot where tiles:insert tag is still there,
while in the SVN repository, that tag is not there anymore, because it
is splitted in three.
http://struts.apache.org/struts-sandbox/tiles/faq.html#insert

Ciao
Antonio



_
Stay in touch with old friends and meet new ones with Windows Live Spaces 
http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us




Re: Is it a postback or a fresh page load?

2006-11-08 Thread Ramineni Viswanath
Basically, this forces the need to decide upon the
STATE_SAVING_METHOD param value before you design your
application. 

--Vish

--- David Geary [EMAIL PROTECTED] wrote:

 2006/11/8, Craig McClanahan [EMAIL PROTECTED]:
 
  On 11/8/06, Ramineni Viswanath
 [EMAIL PROTECTED] wrote:
  
   While on a page, I call the same page with a
 different
   set of query parameters, it is being treated as
 a
   postback.
  
   For example my current url is
  
   /mainmenu.faces?menuid=0
  
   I have a HtmlOutputLink on this page with the
 value
   set to /mainmenu.faces?menuid=26. When I click
 on this
   link, isPostBack() is showing true. Is this
 the
   correct and intended behaviour?
 
 
  The mechanism used to declare a request being a
 postback is whether the
  ViewController.restoreView() method provided by
 JSF determines that there
  was an existing view that could be restored.  In
 turn, if you are using
  server side state saving with current 1.1
 implementations, this decision
  is
  based solely on the view identifier, not on any
 related parameters.  Thus,
  if you are using server side state saving, JSF
 will treat your two URLs as
  being the same, and will restore the previous
 state (and, therefore, the
  postback property will be set to true).
 
  If you were to use client side state saving, on
 the other hand, the two
  URLs
  would be considered distinct views (since the
 HtmlOutputLink ends up doing
  a
  GET to the second URL), with no state to be
 restored, and therefore
  postback
  would be false.
 
 
 Holy cow, I didn't know that. Is that not a bug
 according the definition of
 a postback? IMO, behaviour that differs depending
 upon state-saving mode is
 bad news.
 
 
 david
 
 --Vish
 
 
  Craig
 
 
 




 

Sponsored Link

For just $24.99/mo., Vonage offers unlimited local and long- distance calling. 
Sign up now. http://www.vonage.com/startsavingnow/


Re: new to shale tiles

2006-11-08 Thread David Geary

2006/11/8, Jonathan Smith [EMAIL PROTECTED]:


added the space and the flush false now i get a

java.lang.IncompatibleClassChangeError
org.apache.shale.tiles.TilesViewHandler.dispatchToTile(
TilesViewHandler.java:304)
org.apache.shale.tiles.TilesViewHandler.renderView(
TilesViewHandler.java:160)
org.apache.myfaces.lifecycle.LifecycleImpl.render(
LifecycleImpl.java:384)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter
(ShaleApplicationFilter.java:267)

what does this mean?



It means you're screwed. 8-)

That's essentially a linkage error (see the javadocs). I suspect you somehow
have incompatible JARs. It looks like you're trying to call the Tiles
ComponentContext, but that class is not what the compiler is expecting.

What version of Tiles are you using? You must use the standalone version of
Tiles with Shale.

david


From: David Geary [EMAIL PROTECTED]
Reply-To: user@shale.apache.org
To: user@shale.apache.org
Subject: Re: new to shale tiles
Date: Wed, 8 Nov 2006 10:09:47 -0700

I believe you're missing a space between the two attributes. Also, you
should specify flush=false or you're bound to run into problems.


david

2006/11/8, Antonio Petrelli [EMAIL PROTECTED]:

Jonathan Smith ha scritto:
  ok when i do this
 
  tiles:insert definition=debug2flush=true/tiles:insert
 
  with this as the definition
 
  tiles-definitions
 
 
 
 
  definition name=debug2 path=debug2.jsp
  put name=header type=template
  value=/debug/debug-header.jsp /
  /definition
 
  definition name=header value=/debug/debug-header.jsp /
 
  /tiles-definitions
 
 
  I get this
 
  javax.servlet.ServletException: /debug2.jsp(4,0) Attribute definition
  invalid for tag insert according to TLD
  javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
 
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(
ShaleApplicationFilter.java:267)
 
 
  what am i doing wrong?

It's not your fault :-) Notice that Tiles 2 is under heavy development.
For example you have a snapshot where tiles:insert tag is still there,
while in the SVN repository, that tag is not there anymore, because it
is splitted in three.
http://struts.apache.org/struts-sandbox/tiles/faq.html#insert

Ciao
Antonio


_
Stay in touch with old friends and meet new ones with Windows Live Spaces

http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us




Re: new to shale tiles

2006-11-08 Thread Greg Reddin


On Nov 8, 2006, at 11:34 AM, David Geary wrote:


2006/11/8, Jonathan Smith [EMAIL PROTECTED]:


added the space and the flush false now i get a

java.lang.IncompatibleClassChangeError
org.apache.shale.tiles.TilesViewHandler.dispatchToTile(
TilesViewHandler.java:304)
org.apache.shale.tiles.TilesViewHandler.renderView(
TilesViewHandler.java:160)
org.apache.myfaces.lifecycle.LifecycleImpl.render(
LifecycleImpl.java:384)
javax.faces.webapp.FacesServlet.service(FacesServlet.java: 
138)
 
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter

(ShaleApplicationFilter.java:267)

what does this mean?



It means you're screwed. 8-)

That's essentially a linkage error (see the javadocs). I suspect  
you somehow

have incompatible JARs. It looks like you're trying to call the Tiles
ComponentContext, but that class is not what the compiler is  
expecting.


What version of Tiles are you using? You must use the standalone  
version of

Tiles with Shale.


You're probably using a version of Standalone Tiles that is not  
compatible with the TilesViewHandler.  As Antonio said, Tiles is  
undergoing some major changes as we speak.  I think we've found some  
temporary stability in the snapshot version so if you update  
everything from the Shale-Tiles trunk you should be able to get it  
going.


Greg



Re: new to shale tiles

2006-11-08 Thread Jonathan Smith
i am using tiles-core 2.0 snapsot and i have the nightly builds of shale as 
well




From: Greg Reddin [EMAIL PROTECTED]
Reply-To: user@shale.apache.org
To: user@shale.apache.org
Subject: Re: new to shale tiles
Date: Wed, 8 Nov 2006 11:41:38 -0600


On Nov 8, 2006, at 11:34 AM, David Geary wrote:


2006/11/8, Jonathan Smith [EMAIL PROTECTED]:


added the space and the flush false now i get a

java.lang.IncompatibleClassChangeError
org.apache.shale.tiles.TilesViewHandler.dispatchToTile(
TilesViewHandler.java:304)
org.apache.shale.tiles.TilesViewHandler.renderView(
TilesViewHandler.java:160)
org.apache.myfaces.lifecycle.LifecycleImpl.render(
LifecycleImpl.java:384)
javax.faces.webapp.FacesServlet.service(FacesServlet.java: 138)
 
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter

(ShaleApplicationFilter.java:267)

what does this mean?



It means you're screwed. 8-)

That's essentially a linkage error (see the javadocs). I suspect  you 
somehow

have incompatible JARs. It looks like you're trying to call the Tiles
ComponentContext, but that class is not what the compiler is  expecting.

What version of Tiles are you using? You must use the standalone  version 
of

Tiles with Shale.


You're probably using a version of Standalone Tiles that is not  compatible 
with the TilesViewHandler.  As Antonio said, Tiles is  undergoing some 
major changes as we speak.  I think we've found some  temporary stability 
in the snapshot version so if you update  everything from the Shale-Tiles 
trunk you should be able to get it  going.


Greg



_
Try Search Survival Kits: Fix up your home and better handle your cash with 
Live Search! 
http://imagine-windowslive.com/search/kits/default.aspx?kit=improvelocale=en-USsource=hmtagline




Re: Is it a postback or a fresh page load?

2006-11-08 Thread Craig McClanahan

On 11/8/06, David Geary [EMAIL PROTECTED] wrote:


2006/11/8, Craig McClanahan [EMAIL PROTECTED]:

 On 11/8/06, Ramineni Viswanath [EMAIL PROTECTED] wrote:
 
  While on a page, I call the same page with a different
  set of query parameters, it is being treated as a
  postback.
 
  For example my current url is
 
  /mainmenu.faces?menuid=0
 
  I have a HtmlOutputLink on this page with the value
  set to /mainmenu.faces?menuid=26. When I click on this
  link, isPostBack() is showing true. Is this the
  correct and intended behaviour?


 The mechanism used to declare a request being a postback is whether the
 ViewController.restoreView() method provided by JSF determines that
there
 was an existing view that could be restored.  In turn, if you are using
 server side state saving with current 1.1 implementations, this decision
 is
 based solely on the view identifier, not on any related
parameters.  Thus,
 if you are using server side state saving, JSF will treat your two URLs
as
 being the same, and will restore the previous state (and, therefore, the
 postback property will be set to true).

 If you were to use client side state saving, on the other hand, the two
 URLs
 would be considered distinct views (since the HtmlOutputLink ends up
doing
 a
 GET to the second URL), with no state to be restored, and therefore
 postback
 would be false.


Holy cow, I didn't know that. Is that not a bug according the definition
of
a postback? IMO, behaviour that differs depending upon state-saving mode
is
bad news.



The key issue is the definition of a URL, which does *not* include query
parameters.  It's not just JSF that treats these things as the same; so does
HTTP.  Think about caches, security constraints, search engines ... all are
based on the assumption that two matching URLs are referencing the same
resource.

The right design architecture, if you want these two URLs to be treated as
different pages, is to make them different URLs.

david


Craig


--Vish



 Craig