valueChangeListener is breaking form submit

2007-04-21 Thread AM101

I have two selectOneMenu components (lstType and lstSubType) in my form. I
want to change values in lstSubType when value in lstType changes.  I am
using valueChangeListener  as follwong:

!-- Type --
component jsfid=lstType extends=t:selectOneMenu
id=lstType allowBody=false
attributes
set name=value value=[EMAIL PROTECTED] /
set name=required value=true /
!--set name=onclick value=submit() /--
set name=onchange value=submit() /
set name=valueChangeListener
value=[EMAIL PROTECTED] /
/attributes
element renderId=0 jsfid=selectItem
attributes
set name=itemLabel value=Select a type ... 
/
set name=itemValue value= /
/attributes
/element
element renderId=1 jsfid=selectItem
attributes
set name=itemLabel value=A /
set name=itemValue value=A /
/attributes
/element
element renderId=2 jsfid=selectItem
attributes
set name=itemLabel value=B /
set name=itemValue value=B /
/attributes
/element
/component

!-- Sub Type --
component jsfid=lstSubType extends=t:selectOneMenu
id=lstSubType allowBody=false
attributes
set name=value value=[EMAIL PROTECTED] /
set name=required value=false /
set name=disabled value=[EMAIL PROTECTED] /
/attributes
element renderId=0 jsfid=selectItem
attributes
set name=itemLabel value=Select a sub type 
... /
set name=itemValue value= /
/attributes
/element
element renderId=1 jsfid=selectItems
attributes
set name=value value=[EMAIL PROTECTED] /
/attributes
/element
/component

Everything works fine except that when I submit the form setter of sub type
is never called and always remains the same . Please let me know what is
missing?

Thanks,
AM
-- 
View this message in context: 
http://www.nabble.com/valueChangeListener-is-breaking-form-submit-tf3622758.html#a10116203
Sent from the Shale - User mailing list archive at Nabble.com.



Re: valueChangeListener is breaking form submit

2007-04-21 Thread AM101

When I remove valueChangeListener , setter is called. But I need to use
valueChangeListener.

AM101 wrote:
 
 I have two selectOneMenu components (lstType and lstSubType) in my form. I
 want to change values in lstSubType when value in lstType changes.  I am
 using valueChangeListener  as follwong:
 
 !-- Type --
   component jsfid=lstType extends=t:selectOneMenu
   id=lstType allowBody=false
   attributes
   set name=value value=[EMAIL PROTECTED] /
   set name=required value=true /
   !--set name=onclick value=submit() /--
   set name=onchange value=submit() /
   set name=valueChangeListener
 value=[EMAIL PROTECTED] /
   /attributes
   element renderId=0 jsfid=selectItem
   attributes
   set name=itemLabel value=Select a type ... 
 /
   set name=itemValue value= /
   /attributes
   /element
   element renderId=1 jsfid=selectItem
   attributes
   set name=itemLabel value=A /
   set name=itemValue value=A /
   /attributes
   /element
   element renderId=2 jsfid=selectItem
   attributes
   set name=itemLabel value=B /
   set name=itemValue value=B /
   /attributes
   /element
   /component
   
   !-- Sub Type --
   component jsfid=lstSubType extends=t:selectOneMenu
   id=lstSubType allowBody=false
   attributes
   set name=value value=[EMAIL PROTECTED] /
   set name=required value=false /
   set name=disabled value=[EMAIL PROTECTED] /
   /attributes
   element renderId=0 jsfid=selectItem
   attributes
   set name=itemLabel value=Select a sub type 
 ... /
   set name=itemValue value= /
   /attributes
   /element
   element renderId=1 jsfid=selectItems
   attributes
   set name=value value=[EMAIL PROTECTED] /
   /attributes
   /element
   /component
 
 Everything works fine except that when I submit the form setter of sub
 type is never called and always remains the same . Please let me know what
 is missing?
 
 Thanks,
 AM
 

-- 
View this message in context: 
http://www.nabble.com/valueChangeListener-is-breaking-form-submit-tf3622758.html#a10116210
Sent from the Shale - User mailing list archive at Nabble.com.



SUCCESS - Re: Migration: Struts/Tiles to Shale/JSF/Tiles

2007-04-21 Thread Gregg Leichtman
I appear to have successfully resolved my two page to one page problem.
I no longer need _any_ page, for instance the loadLayout.jsp page, that
contains a tiles:insertDefinition tag. I can simply jump directly to any
tiles definition name. This is how I had Struts/Tiles working before, so
this seems to be the best way to use Tiles with Shale and JSF. I have
posted a test webapp at:

http://www.lansdaletutoring.com/test

The home page at this location allows the user to jump to two different
tiles and, from each of them, back to the home tile and to also download
the test webapp war file.

I changed the index.jsp file to:

jsp:forward page=/mainLayoutPage.faces/

My tiles-def.xml file is:

?xml version=1.0 encoding=ISO-8859-1 ?

 !DOCTYPE tiles-definitions PUBLIC
   -//Apache Software Foundation//DTD Tiles Configuration 2.0//EN
   http://struts.apache.org/dtds/tiles-config_2_0.dtd;

tiles-definitions

definition name=/mainLayoutPage
template=/tiles/layouts/siteLayout.jsp
put name=htmlHeader type=template
value=/tiles/htmlHeaderTile.jsp/
put name=header type=template value=/tiles/headerTile.jsp/
put name=content type=template value=/tiles/homeTile.jsp/
put name=rightSideBar type=template
value=/tiles/rightSideBarTile.jsp/
put name=footer type=template value=/tiles/footerTile.jsp/
/definition

definition name=/contactUsPage extends=/mainLayoutPage
put name=content type=template
value=/tiles/contactUsTile.jsp/
/definition

definition name=/aboutUsPage extends=/mainLayoutPage
put name=content type=template value=/tiles/aboutTile.jsp/
/definition

/tiles-definitions

The homeTile.jsp file is:

%@ taglib uri=http://java.sun.com/jsf/core; prefix=f %
%@ taglib uri=http://java.sun.com/jsf/html; prefix=h %
%@ taglib uri=http://myfaces.apache.org/tomahawk; prefix=t %

h:outputText value=
h4 align='center'An OutputText Method to do a Content Tile!/h4
div
p
A paragraph of content.
p
A second paragraph of content.
/divbr
 escape=false/

h:outputText value=Some JSF output text./

f:verbatim
h4 align='center'A Verbatim Method to do The Same Content Tile!/h4
div
p
Another paragraph of content.   
p
Another second paragraph of content.
/divbr
/f:verbatim
h:outputText value=Some more JSF output text./

h:outputText value=br escape=false/
h:outputLink value=/test/contactUsPage.faces
h:outputText value=Contact Us/
/h:outputLink
h:outputText value=br escape=false/
h:outputLink value=/test/aboutUsPage.faces
h:outputText value=About Us/
/h:outputLink
h:outputText value=br escape=false/
h:outputLink value=http://www.lansdaletutoring.com/test/files/test.war;
h:outputText value=Download this Webapp's WAR File/
/h:outputLink

As far as the org.apache.shale.tiles.TilesViewHandler goes, I don't seem
to need to declare it in faces-config.xml or anywhere else. I suppose it
is being automatically loaded when needed and doesn't need to be
declared. If you want to see the exact error message that does occur
when it is declared in faces-config.xml, just declare it in the exploded
test.war and go to the home page. I believe that it will still fail as
before when this is done. If not, let me know.

-= Gregg =-

Greg Reddin wrote:
 On 4/18/07, Gregg Leichtman wrote:

 I am also using the tiles listener from web.xml as follows:

   listener
 listener-class
   org.apache.tiles.listener.TilesListener
 /listener-class
   /listener

 instead of the Shale tiles view handler (if this makes a difference) in
 faces-config.xml:

   !-- application
 view-handler
   org.apache.shale.tiles.TilesViewHandler
 /view-handler
   /application --

 which I could not get to work.


 [snip]

 The Shale/JSF/Tiles scheme that I currently have working seems really
 clunky.

 Is there some way that I can reduce the two pages down to one page under
 Shale/JSF/Tiles?


 If I understand the TilesViewHandler correctly it is supposed to work
 that
 way.  Similar to how TilesRequestProcessor translated a forward
 definition
 into a Tiles invocation.  I think TilesViewHandler is supposed to do
 something similar for Tiles 2 in a JSF environment.

 What sort of problems did you have with the ViewHandler?  BTW, I'm
 planning
 to upgrade Shale-Tiles to the latest official Tiles release once we get
 another one out.

 HTH,
 Greg




signature.asc
Description: OpenPGP digital signature


Re: SV: valueChangeListener is breaking form submit

2007-04-21 Thread Gary VanMatre
 Fra: AM101 [mailto:[EMAIL PROTECTED] 
 Sendt: 21. april 2007 13:30 
 Til: user@shale.apache.org 
 Emne: Re: valueChangeListener is breaking form submit 
 
 
 When I remove valueChangeListener , setter is called. But I need to use 
 valueChangeListener. 


That's a hard one to diagnose but I have a couple ideas.  The setters on the 
sub type
list are not going to be called if the component is disabled.

Something else to consider is validation errors.  You might be hitting 
validation errors.
If you are, the lifecycle is going to stop short and jump to the render phase 
bypassing
the update model phase.

If you are hitting validation errors, try setting the immediate attribute to 
true on the
two select components and the command component you are using to submit the 
form.
This will cause the value change listeners and commands to be invoked in the 
apply
request values phase (before validation).


Gary
 
 AM101 wrote: 
  
  I have two selectOneMenu components (lstType and lstSubType) in my form. I 
  want to change values in lstSubType when value in lstType changes. I am 
  using valueChangeListener as follwong: 
  
  
id=lstType allowBody=false 
  
   / 
  
  
  
value=[EMAIL PROTECTED] / 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
id=lstSubType allowBody=false 
  
   value=[EMAIL PROTECTED] / 
  
   value=[EMAIL PROTECTED] / 
  
  
  
  
  
  
  
  
  
   value=[EMAIL PROTECTED] / 
  
  
  
  
  Everything works fine except that when I submit the form setter of sub 
  type is never called and always remains the same . Please let me know what 
  is missing? 
  
  Thanks, 
  AM 
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/valueChangeListener-is-breaking-form-submit-tf3622758. 
 html#a10116210 
 Sent from the Shale - User mailing list archive at Nabble.com. 
 
 

RE: using tld2claycfg

2007-04-21 Thread hermod.opstvedt
Hi

Here go and try again - Download the tool [1] also  and build it with mvn clean 
install

[1] https://svn.apache.org/repos/asf/shale/tools/trunk/tld2claycfg

It is a dependent of the Tld2ClayCfg Maven plugin.


Hermod
Posted april 19th 0230 GMT+2

-Original Message-
From: JS Portal Support [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 19, 2007 2:23 AM
To: user@shale.apache.org; [EMAIL PROTECTED]
Subject: RE: using tld2claycfg


Dear Hermod,

Thank you for your help. When running maven on the mojo folder like you
explained I get the following error. The same reason also keeps me from
succeeding in the mvn clean install on the test folder:

--the error---

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.

Missing:
--
1) org.apache.shale:Tld2ClayCfg:jar:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=org.apache.shale
-DartifactId=Tld2ClayC
fg \
  -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Path to dependency:
1) org.apache.shale:Tld2ClayCfgMojo:maven-plugin:1.0-SNAPSHOT
2) org.apache.shale:Tld2ClayCfg:jar:1.0-SNAPSHOT

--
1 required artifact is missing.

for artifact:
  org.apache.shale:Tld2ClayCfgMojo:maven-plugin:1.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


---end error---

Unfortunately I am new to Maven so don't fully grasp its purpose and
workings. It seems like I need a missing Tld2ClayCfg jar. Could you point me
in the right direction please?

Thank you,
Joost

-Original Message-
From: Hermod Opstvedt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 18, 2007 1:09 AM
To: user@shale.apache.org
Subject: SV: using tld2claycfg

Hi

I answered this yesterday, but it seems that mail sent from work uses 4-5
days to reach the list.


Download the source from[1]

Build the Maven plugin in the folder mojo by using mvn clean install
In the test folder open the Mavne POM and tweak it according to what you
want (the tld section and the dependency section).
Run mvn clean install in the test folder. The generated jar in the target
folder contains the Clay config files you want.

[1] https://svn.apache.org/repos/asf/shale/maven/trunk/tld2claycfg

Hermod


-Opprinnelig melding-
Fra: Torsten Krah [mailto:[EMAIL PROTECTED] 
Sendt: 17. april 2007 13:43
Til: user@shale.apache.org
Emne: Re: using tld2claycfg

I guess Hermod does, because he made it.

My problem is, i cant build the tool with maven, maybe i am doing
something wrong - so Hermod, can you give us a short intro what to do to
build it after svn checkout and how to create the clay config files?

Torsten

Am Sonntag, den 15.04.2007, 12:40 +1200 schrieb JS Portal Support:
 Hi,
 
 I've been trying to find some documentation on how to use the tld2claycfg.
I
 want to use some myfaces sandbox components but can't find the clay config
 file for it and understand you can create it with tld2claycfg. Does anyone
 know how and where?
 
 Thanks,
 Joost Schouten
 
 


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

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.

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