Re: Shale dialog question

2007-06-28 Thread Craig McClanahan

On 6/28/07, Werner Punz [EMAIL PROTECTED] wrote:

Hi everybody, I am just digging through the shale dialog codebase.
Maybe I am missing something here, but I cannot see following usecase
covered.
A User is in a dialog and exits the dialog by altering the url...
Now what happens then?
I cannot see any codepart of where the dialog then is dropped
and an event is issued to its referencing dialogcontext listeners.



At least for the basic implementation (probably the SCXML one as
well), you're correct ... the identifier for the current dialog
context is saved and restored as part of the JSF component tree state,
which gets lost if you manually alter the URL in the browser (and
therefore cause a new component tree to be created).


Am I missing something here or is this a bug?


It's definitely a non-covered use case :-), so please do file an
issue.  Figuring out what to do about it will be kind of interesting
... for example, you can't just assume that a request (in the same
session) that doesn't include a JSF component tree (with the context
identifier) means that all existing dialog contexts should be
terminated ... that would have nasty consequences for things link
stylesheet and Javascript links.





Werner




Craig


f:validator and Undefined component type override

2007-06-28 Thread Ian.Priest
I've hit a problem trying to set up a validator on an input text field.
Here's the HTML...

 

div class=content

  xmlns:t=http://myfaces.apache.org/tomahawk; 

  xmlns:h=http://java.sun.com/jsf/html;

  xmlns:f=http://java.sun.com/jsf/core;

 

... 

h:inputText styleClass=x-large size=20 maxlength=20

  value=[EMAIL PROTECTED]
id=username

  validator=[EMAIL PROTECTED] 

  required=true 

 

f:validator validatorId=com.scn.Regex suppliedRegex=[A-Za-z0-9]*

errorMessage=#{messages['customer.username_invalid_chars']} /

/h:inputText

...

 

And here's the error message

 

2007-06-28 17:22:52,574 [http-8443-Processor23] ERROR
[org.apache.shale.clay.component.chain.CreateComponentCommand] Cannot
create Component renderId=997 jsfid=f:validator
componentType=override extends=f:validator allowBody=null
facetName=null

javax.faces.FacesException: Undefined component type override

...

 

It works fine as-is, defined in component form like this...

 

  component jsfid=widgetsValidatedInputText extends=inputText

attributes

  set name=validator
value=[EMAIL PROTECTED]@validateMethod} /

/attributes

  /component

  component jsfid=widgetsRegexValidated
extends=widgetsValidatedInputText

validator jsfid=validateRegex

  attributes

set name=suppliedRegex value=@regex /

set name=errorMessage value=@errorMessage
/

  /attributes

/validator

  /component

 

But unfortunately I have a requirement to strip out the component layer
and use the JSF tags direct so I can't leave it as-is. (And I also
realise it's slightly unusual to have two validators).

 

Cheers,

Ian.

 

 



Re: How to handle links outside a SCXML Dialog?

2007-06-28 Thread Rahul Akolkar

On 6/28/07, Paul Spencer [EMAIL PROTECTED] wrote:

I am having an issued when users click links that are not known to the
SCXML dialog.  When this occurs an exception from
ShaleApplicationFilter.doFilter() is thrown. The links are part of the
page's headers, footer, and navigation bar.  The expected behavior when
the user click one of the links, like Home, is the dialog will be
closed and the desired page will be displayed.

How do I support links that are outside the dialog without adding each
possible link to each dialog?


snip/

I suspect this will be relevant to both implementations. By design, it
helps to think of a dialog as a complete model. However, I think we
have talked about bits like headers, footers and navigation bars some
time ago, and one of the things that could be done is to wire each
outside link to an action that checks whether there is an active
DialogContext and stop()s it, if there is one.

See bottom of this page for some documentation on terminating dialogs:

http://shale.apache.org/shale-dialog/index.html (v1.1.0-SNAP)

-Rahul



Paul Spencer



Re: f:validator and Undefined component type override

2007-06-28 Thread Gary VanMatre
From: Ian.Priest [EMAIL PROTECTED] 

 I've hit a problem trying to set up a validator on an input text field. 
 Here's the HTML... 
 
 

div class=content
  xmlns:t=http://myfaces.apache.org/tomahawk; 
  xmlns:h=http://java.sun.com/jsf/html;
  xmlns:f=http://java.sun.com/jsf/core;

 
 
 ... 
 

 h:inputText styleClass=x-large size=20 maxlength=20
  value=[EMAIL PROTECTED]
  id=username
  validator=[EMAIL PROTECTED] 
  required=true 
 
   f:validator validatorId=com.scn.Regex suppliedRegex=[A-Za-z0-9]*
errorMessage=#{messages['customer.username_invalid_chars']} /
/h:inputText


 
 And here's the error message 
 


There are a couple issues here.  The first issue is that the mapping logic is 
only looking for a validator and not a f:validator.  This one is a bug.  
Please log a JIRA ticket if you get a chance.

However, you will still need to define this validator as a clay XML component 
definition because it is statefull and has attributes.  The HTML mapping will 
only push property values on to a component that has attributes defined in 
the clay config.  All other HTML attributes are treated as symbols.

Consider the following:


Clay XML Config:
component jsfid=scn:regex componentType=com.scn.Regex
   attributes
  set name=suppliedRegex bindingType=Early /
  set name=errorMessage  bindingType=Early/
   /attributes
/component



HTML Template:

div class=content
  xmlns:t=http://myfaces.apache.org/tomahawk; 
  xmlns:h=http://java.sun.com/jsf/html;
  xmlns:f=http://java.sun.com/jsf/core;

h:inputText styleClass=x-large size=20 maxlength=20
  value=[EMAIL PROTECTED]
  id=username
  validator=[EMAIL PROTECTED] 
  required=true 
 
   f:validator jsfid=scn:regex suppliedRegex=[A-Za-z0-9]*
  errorMessage=#{messages['customer.username_invalid_chars']} /
/h:inputText

/div

-- or,  if you are into verbose markup --

div class=content
  xmlns:clay=http://shale.apache.org/xml/clay;

clay:element jsfid=:inputText
  clay:attributes
 clay:set name=styleClass value=x-large/ 
 clay:set name=size value=20 /
 clay:set name=maxlength value=20/
 clay:set name=value value=[EMAIL PROTECTED]/
 clay:set name=id value=username/
 clay:set name=validator value=[EMAIL PROTECTED] /
 clay:set name=required value=true /
  /clay:attributes
   
  clay:validator jsfid=scn:regex
 clay:attributes
clay:set name=suppliedRegex value=[A-Za-z0-9]* /
clay:set name=errorMessage 
value=#{messages['customer.username_invalid_chars']} /
/clay:attributes
  /clay:validator
/clay:element

/div



 
 
 2007-06-28 17:22:52,574 [http-8443-Processor23] ERROR 
 [org.apache.shale.clay.component.chain.CreateComponentCommand] Cannot 
 create Component renderId=997 jsfid=f:validator 
 componentType=override extends=f:validator allowBody=null 
 facetName=null 
 
 javax.faces.FacesException: Undefined component type override 
 
 ... 
 
 
 
 It works fine as-is, defined in component form like this... 
 
 
 
 
 
 
 
  value=[EMAIL PROTECTED]@validateMethod} / 
 
 
 
 
 
  extends=widgetsValidatedInputText 
 
 
 
 
 
 
 
  / 
 
 
 
 
 
 
 
 
 
 But unfortunately I have a requirement to strip out the component layer 
 and use the JSF tags direct so I can't leave it as-is. (And I also 
 realise it's slightly unusual to have two validators). 
 
 
 
 Cheers, 
 
 Ian.