You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Philippe Lamote <ph...@mac.com> on 2006/02/20 21:12:19 UTC

and validation & saving

Hi List,

Another problem I've run into today:

-- I have in my page a div like this: (inside a form)
...
				<!-- For the Use Case Submit New Calendar:  -->
    		<t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
    		<f:verbatim>
    		
    		<tr >
    			<td width="5%">&#160; </td>
    			<td align="left" rowspan="4" class="rightCellLine">
    					<h:outputLabel value="#{labels.regCal_when} &#160;" />
	   				<t:inputCalendar id="kalender"	renderAsPopup="true"
	   												popupButtonString="Click here to show Calendar"
	   												renderPopupButtonAsImage="true"
	   												popupDateFormat="dd/MM/yyyy"
	   												popupTodayString="#{labels.regCal_today} "
	   												popupWeekString="#{labels.regCal_week}"
	   												required="true"
	   												value="#{regcalbean.currentEvent.dateChosen}">
	   										
	   				</t:inputCalendar>&#160;&#160;&#160;&#160;

...
			<h:message for="kalender" styleClass="error" />
		</f:verbatim>
		</t:div>
		


All is rendered well when the Use Case chosen equals "submitNew", so  
far no problem.

The "currentEvent" for its value, is of Type CalendarEvent where the  
relevant part of that class states:
...	/**
	 * The chosen Date:
	 */
private Date dateChosen;	

	/**
	 * @return Returns the dateChosen.
	 */
	public Date getDateChosen() {
		return dateChosen;
	}
	/**
	 * @param dateChosen The dateChosen to set.
	 */
	public void setDateChosen(Date dateChosen) {
		this.dateChosen = dateChosen;
	}
(in the constructor dateChosen is not instantiated to avoid a default  
date of today in the inputCalendar field - this makes no difference  
as to the issue however)

The problem:
The weird stuff is twofold:
	1/ The inputCalendar is a "required" element.
	Yet, when I don't fill anything in, I get no complaints.
	2/ It turns out that despite the fact all data inside the div is  
rendered, NONE of this data is actually saved. In fact whatever I  
type into it, the "value" stays "null".
	All data of currentEvent outside the div is saved correctly.

Any ideas as to the "why"?
I don't think this is how div is supposed to work, is it?

Philippe







Re: and validation & saving

Posted by Matthias Wessendorf <mw...@gmail.com>.
Yeah, right

verbatim creates UIOutput for the nested stuff.

Introduced due some troubles in jsf-jsp-integration ([1]).

-Matthias

[1] - http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html

On 2/20/06, Volker Weber <us...@weber-oldenburg.de> wrote:
> Hi Philippe,
>
> you have jsf tags inside of f:verbatim? AFAIK this will not work, you
> should close the verbatim before the jsf tags, and reopen after.
>
>
> Regards,
>   Volker
>
> Philippe Lamote wrote:
> > Hi List,
> >
> > Another problem I've run into today:
> >
> > -- I have in my page a div like this: (inside a form)
> > ...
> >                 <!-- For the Use Case Submit New Calendar:  -->
> >            <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
> >            <f:verbatim>
> >
> >            <tr >
> >                <td width="5%">&#160; </td>
> >                <td align="left" rowspan="4" class="rightCellLine">
> >                        <h:outputLabel value="#{labels.regCal_when}
> > &#160;" />
> >                        <t:inputCalendar id="kalender"
> > renderAsPopup="true"
> >
> > popupButtonString="Click here to show Calendar"
> >
> > renderPopupButtonAsImage="true"
> >
> > popupDateFormat="dd/MM/yyyy"
> >
> > popupTodayString="#{labels.regCal_today} "
> >
> > popupWeekString="#{labels.regCal_week}"
> >                                                        required="true"
> >
> > value="#{regcalbean.currentEvent.dateChosen}">
> >
> >                        </t:inputCalendar>&#160;&#160;&#160;&#160;
> >
> > ...
> >             <h:message for="kalender" styleClass="error" />
> >         </f:verbatim>
> >         </t:div>
> >
> >
> >
> > All is rendered well when the Use Case chosen equals "submitNew", so
> > far no problem.
> >
> > The "currentEvent" for its value, is of Type CalendarEvent where the
> > relevant part of that class states:
> > ...    /**
> >      * The chosen Date:
> >      */
> > private Date dateChosen;
> >
> >     /**
> >      * @return Returns the dateChosen.
> >      */
> >     public Date getDateChosen() {
> >         return dateChosen;
> >     }
> >     /**
> >      * @param dateChosen The dateChosen to set.
> >      */
> >     public void setDateChosen(Date dateChosen) {
> >         this.dateChosen = dateChosen;
> >     }
> > (in the constructor dateChosen is not instantiated to avoid a default
> > date of today in the inputCalendar field - this makes no difference  as
> > to the issue however)
> >
> > The problem:
> > The weird stuff is twofold:
> >     1/ The inputCalendar is a "required" element.
> >     Yet, when I don't fill anything in, I get no complaints.
> >     2/ It turns out that despite the fact all data inside the div is
> > rendered, NONE of this data is actually saved. In fact whatever I  type
> > into it, the "value" stays "null".
> >     All data of currentEvent outside the div is saved correctly.
> >
> > Any ideas as to the "why"?
> > I don't think this is how div is supposed to work, is it?
> >
> > Philippe
> >
> >
> >
> >
> >
> >
> >
>
> --
> Don't answer to From: address!
> Mail to this account are droped if not recieved via mailinglist.
> To contact me direct create the mail address by
> concatenating my forename to my senders domain.
>


--
Matthias Wessendorf
Zülpicher Wall 12, 239
50674 Köln
http://www.wessendorf.net
mwessendorf-at-gmail-dot-com

Re: and validation & saving

Posted by Volker Weber <us...@weber-oldenburg.de>.
Yes, this is no valid xhtml.

If you need this for your jsf sources you can try somthing like this:

   <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
     <h:out escape="false" value="<tr >" />
     <h:out escape="false" value="<td width='5%'>" />
     <h:out escape="false" value="&#160; " />
     <h:out escape="false" value="</td>" />
     <h:out escape="false" value="<td align='left' rowspan='4'
class='rightCellLine'>" />
           <h:outputLabel value="#{labels.regCal_when} &#160;" />
           <t:inputCalendar id="kalender"    renderAsPopup="true"
                popupButtonString="Click here to show Calendar"
                renderPopupButtonAsImage="true"
                popupDateFormat="dd/MM/yyyy"
                popupTodayString="#{labels.regCal_today} "
                popupWeekString="#{labels.regCal_week}"
                required="true"
                value="#{regcalbean.currentEvent.dateChosen}">
            </t:inputCalendar>&#160;&#160;&#160;&#160;
     <h:out escape="false" value="..." />
             <h:message for="kalender" styleClass="error" />
   </t:div>

this is (nearly) what f:verbatim will produce at component level.

Regards,
  Volker

Philippe Lamote wrote:
> OK, I'll try that tomorrow. (Yet, at first glance, I'm afraid my  XHTML
> parser will not accept that solution - as the tags are not  anymore
> "properly nested" this way, eg. mix of verbatim & td tags)
> I'll let you know.
> Philippe
> On 21 Feb 2006, at 00:09, Volker Weber wrote:
> 
> You need to enclose all plain html in verbatim, but don't put jsf in
> verbatim.
> 
> try somthing like this:
> 
>   <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
>     <f:verbatim>
> 
>       <tr >
>         <td width="5%">&#160; </td>
>         <td align="left" rowspan="4" class="rightCellLine">
>     </f:verbatim>
>           <h:outputLabel value="#{labels.regCal_when} &#160;" />
>           <t:inputCalendar id="kalender"    renderAsPopup="true"
>                popupButtonString="Click here to show Calendar"
>                renderPopupButtonAsImage="true"
>                popupDateFormat="dd/MM/yyyy"
>                popupTodayString="#{labels.regCal_today} "
>                popupWeekString="#{labels.regCal_week}"
>                required="true"
>                value="#{regcalbean.currentEvent.dateChosen}">
>            </t:inputCalendar>&#160;&#160;&#160;&#160;
>     <f:verbatim>
> ...
>     </f:verbatim>
>             <h:message for="kalender" styleClass="error" />
>   </t:div>
> 
> 
> Regards,
>   Volker
> 
> Philippe Lamote wrote:
> 
>> Yes, I have. (Well, "had")
>> I removed the verbatims and now it works - "functionally".
>> "Easthetically" the page became a mess since now he's also rendering
>> the plain (non-jsf) HTML inside "hidden divs" (I mean divs with
>> rendered = false) , which he did do not previously.
>> Some more explanation:
>> I had a table with elements defined in pure HTML (using <table>, <tr>
>> and <td>)
>> I had parts of the table (collection of rows) that I wanted to  show  or
>> hide, depending on the Use Case. So I was using the <t:div
>> rendered=f(some var) > wrapping these column sets.
>> I added verbatim tags to properly hide/show the html markup inside
>> these divs.
>>
>> Now I removed the verbatim tags. Functionally it works but he's   showing
>> the HTML inside the hidden divs.
>> To solve this, does this basically mean I will have to rewrite all   HTML
>> to purely JSF code as the mix of both obviously entails some  annoying
>> side effects?
>> ( & thx for the advice already)
>> Philippe
>>
>> On 20 Feb 2006, at 23:16, Volker Weber wrote:
>>
>> Hi Philippe,
>>
>> you have jsf tags inside of f:verbatim? AFAIK this will not work, you
>> should close the verbatim before the jsf tags, and reopen after.
>>
>>
>> Regards,
>>   Volker
>>
>> Philippe Lamote wrote:
>>
>>> Hi List,
>>>
>>> Another problem I've run into today:
>>>
>>> -- I have in my page a div like this: (inside a form)
>>> ...
>>>                 <!-- For the Use Case Submit New Calendar:  -->
>>>            <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
>>>            <f:verbatim>
>>>
>>>            <tr >
>>>                <td width="5%">&#160; </td>
>>>                <td align="left" rowspan="4" class="rightCellLine">
>>>                        <h:outputLabel value="#{labels.regCal_when}
>>> &#160;" />
>>>                        <t:inputCalendar id="kalender"
>>> renderAsPopup="true"
>>>
>>> popupButtonString="Click here to show Calendar"
>>>
>>> renderPopupButtonAsImage="true"
>>>
>>> popupDateFormat="dd/MM/yyyy"
>>>
>>> popupTodayString="#{labels.regCal_today} "
>>>
>>> popupWeekString="#{labels.regCal_week}"
>>>                                                         required="true"
>>>
>>> value="#{regcalbean.currentEvent.dateChosen}">
>>>
>>>                        </t:inputCalendar>&#160;&#160;&#160;&#160;
>>>
>>> ...
>>>             <h:message for="kalender" styleClass="error" />
>>>         </f:verbatim>
>>>         </t:div>
>>>
>>>
>>>
>>> All is rendered well when the Use Case chosen equals "submitNew", so
>>> far no problem.
>>>
>>> The "currentEvent" for its value, is of Type CalendarEvent where the
>>> relevant part of that class states:
>>> ...    /**
>>>      * The chosen Date:
>>>      */
>>> private Date dateChosen;
>>>
>>>     /**
>>>      * @return Returns the dateChosen.
>>>      */
>>>     public Date getDateChosen() {
>>>         return dateChosen;
>>>     }
>>>     /**
>>>      * @param dateChosen The dateChosen to set.
>>>      */
>>>     public void setDateChosen(Date dateChosen) {
>>>         this.dateChosen = dateChosen;
>>>     }
>>> (in the constructor dateChosen is not instantiated to avoid a default
>>> date of today in the inputCalendar field - this makes no  
>>> difference  as
>>> to the issue however)
>>>
>>> The problem:
>>> The weird stuff is twofold:
>>>     1/ The inputCalendar is a "required" element.
>>>     Yet, when I don't fill anything in, I get no complaints.
>>>     2/ It turns out that despite the fact all data inside the div is
>>> rendered, NONE of this data is actually saved. In fact whatever  I  
>>> type
>>> into it, the "value" stays "null".
>>>     All data of currentEvent outside the div is saved correctly.
>>>
>>> Any ideas as to the "why"?
>>> I don't think this is how div is supposed to work, is it?
>>>
>>> Philippe
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Re: and validation & saving

Posted by Philippe Lamote <ph...@mac.com>.
OK, I'll try that tomorrow. (Yet, at first glance, I'm afraid my  
XHTML parser will not accept that solution - as the tags are not  
anymore "properly nested" this way, eg. mix of verbatim & td tags)
I'll let you know.
Philippe
On 21 Feb 2006, at 00:09, Volker Weber wrote:

You need to enclose all plain html in verbatim, but don't put jsf in
verbatim.

try somthing like this:

   <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
     <f:verbatim>

       <tr >
         <td width="5%">&#160; </td>
         <td align="left" rowspan="4" class="rightCellLine">
     </f:verbatim>
           <h:outputLabel value="#{labels.regCal_when} &#160;" />
           <t:inputCalendar id="kalender"    renderAsPopup="true"
                popupButtonString="Click here to show Calendar"
                renderPopupButtonAsImage="true"
                popupDateFormat="dd/MM/yyyy"
                popupTodayString="#{labels.regCal_today} "
                popupWeekString="#{labels.regCal_week}"
                required="true"
                value="#{regcalbean.currentEvent.dateChosen}">
            </t:inputCalendar>&#160;&#160;&#160;&#160;
     <f:verbatim>
...
     </f:verbatim>
             <h:message for="kalender" styleClass="error" />
   </t:div>


Regards,
   Volker

Philippe Lamote wrote:
> Yes, I have. (Well, "had")
> I removed the verbatims and now it works - "functionally".
> "Easthetically" the page became a mess since now he's also rendering
> the plain (non-jsf) HTML inside "hidden divs" (I mean divs with
> rendered = false) , which he did do not previously.
> Some more explanation:
> I had a table with elements defined in pure HTML (using <table>, <tr>
> and <td>)
> I had parts of the table (collection of rows) that I wanted to  
> show  or
> hide, depending on the Use Case. So I was using the <t:div
> rendered=f(some var) > wrapping these column sets.
> I added verbatim tags to properly hide/show the html markup inside
> these divs.
>
> Now I removed the verbatim tags. Functionally it works but he's   
> showing
> the HTML inside the hidden divs.
> To solve this, does this basically mean I will have to rewrite all   
> HTML
> to purely JSF code as the mix of both obviously entails some  annoying
> side effects?
> ( & thx for the advice already)
> Philippe
>
> On 20 Feb 2006, at 23:16, Volker Weber wrote:
>
> Hi Philippe,
>
> you have jsf tags inside of f:verbatim? AFAIK this will not work, you
> should close the verbatim before the jsf tags, and reopen after.
>
>
> Regards,
>   Volker
>
> Philippe Lamote wrote:
>
>> Hi List,
>>
>> Another problem I've run into today:
>>
>> -- I have in my page a div like this: (inside a form)
>> ...
>>                 <!-- For the Use Case Submit New Calendar:  -->
>>            <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
>>            <f:verbatim>
>>
>>            <tr >
>>                <td width="5%">&#160; </td>
>>                <td align="left" rowspan="4" class="rightCellLine">
>>                        <h:outputLabel value="#{labels.regCal_when}
>> &#160;" />
>>                        <t:inputCalendar id="kalender"
>> renderAsPopup="true"
>>
>> popupButtonString="Click here to show Calendar"
>>
>> renderPopupButtonAsImage="true"
>>
>> popupDateFormat="dd/MM/yyyy"
>>
>> popupTodayString="#{labels.regCal_today} "
>>
>> popupWeekString="#{labels.regCal_week}"
>>                                                         
>> required="true"
>>
>> value="#{regcalbean.currentEvent.dateChosen}">
>>
>>                        </t:inputCalendar>&#160;&#160;&#160;&#160;
>>
>> ...
>>             <h:message for="kalender" styleClass="error" />
>>         </f:verbatim>
>>         </t:div>
>>
>>
>>
>> All is rendered well when the Use Case chosen equals "submitNew", so
>> far no problem.
>>
>> The "currentEvent" for its value, is of Type CalendarEvent where the
>> relevant part of that class states:
>> ...    /**
>>      * The chosen Date:
>>      */
>> private Date dateChosen;
>>
>>     /**
>>      * @return Returns the dateChosen.
>>      */
>>     public Date getDateChosen() {
>>         return dateChosen;
>>     }
>>     /**
>>      * @param dateChosen The dateChosen to set.
>>      */
>>     public void setDateChosen(Date dateChosen) {
>>         this.dateChosen = dateChosen;
>>     }
>> (in the constructor dateChosen is not instantiated to avoid a default
>> date of today in the inputCalendar field - this makes no   
>> difference  as
>> to the issue however)
>>
>> The problem:
>> The weird stuff is twofold:
>>     1/ The inputCalendar is a "required" element.
>>     Yet, when I don't fill anything in, I get no complaints.
>>     2/ It turns out that despite the fact all data inside the div is
>> rendered, NONE of this data is actually saved. In fact whatever  
>> I   type
>> into it, the "value" stays "null".
>>     All data of currentEvent outside the div is saved correctly.
>>
>> Any ideas as to the "why"?
>> I don't think this is how div is supposed to work, is it?
>>
>> Philippe
>>
>>
>>
>>
>>
>>
>>
>

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.


Re: and validation & saving

Posted by Laurie Harper <la...@holoweb.net>.
Or ditch JSPs altogether and switch to Facelets or Shale Clay; much 
nicer ;-)

L.

Volker Weber wrote:
> You need to enclose all plain html in verbatim, but don't put jsf in
> verbatim.
> 
> try somthing like this:
> 
>   <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
>     <f:verbatim>
> 
>       <tr >
>         <td width="5%">&#160; </td>
>         <td align="left" rowspan="4" class="rightCellLine">
>     </f:verbatim>
>           <h:outputLabel value="#{labels.regCal_when} &#160;" />
>           <t:inputCalendar id="kalender"    renderAsPopup="true"
>                popupButtonString="Click here to show Calendar"
>                renderPopupButtonAsImage="true"
>                popupDateFormat="dd/MM/yyyy"
>                popupTodayString="#{labels.regCal_today} "
>                popupWeekString="#{labels.regCal_week}"
>                required="true"
>                value="#{regcalbean.currentEvent.dateChosen}">
>            </t:inputCalendar>&#160;&#160;&#160;&#160;
>     <f:verbatim>
> ....
>     </f:verbatim>
>             <h:message for="kalender" styleClass="error" />
>   </t:div>
> 
> 
> Regards,
>   Volker
> 
> Philippe Lamote wrote:
>> Yes, I have. (Well, "had")
>> I removed the verbatims and now it works - "functionally".
>> "Easthetically" the page became a mess since now he's also rendering 
>> the plain (non-jsf) HTML inside "hidden divs" (I mean divs with 
>> rendered = false) , which he did do not previously.
>> Some more explanation:
>> I had a table with elements defined in pure HTML (using <table>, <tr> 
>> and <td>)
>> I had parts of the table (collection of rows) that I wanted to show  or
>> hide, depending on the Use Case. So I was using the <t:div 
>> rendered=f(some var) > wrapping these column sets.
>> I added verbatim tags to properly hide/show the html markup inside 
>> these divs.
>>
>> Now I removed the verbatim tags. Functionally it works but he's  showing
>> the HTML inside the hidden divs.
>> To solve this, does this basically mean I will have to rewrite all  HTML
>> to purely JSF code as the mix of both obviously entails some  annoying
>> side effects?
>> ( & thx for the advice already)
>> Philippe
>>
>> On 20 Feb 2006, at 23:16, Volker Weber wrote:
>>
>> Hi Philippe,
>>
>> you have jsf tags inside of f:verbatim? AFAIK this will not work, you
>> should close the verbatim before the jsf tags, and reopen after.
>>
>>
>> Regards,
>>   Volker
>>
>> Philippe Lamote wrote:
>>
>>> Hi List,
>>>
>>> Another problem I've run into today:
>>>
>>> -- I have in my page a div like this: (inside a form)
>>> ...
>>>                 <!-- For the Use Case Submit New Calendar:  -->
>>>            <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
>>>            <f:verbatim>
>>>
>>>            <tr >
>>>                <td width="5%">&#160; </td>
>>>                <td align="left" rowspan="4" class="rightCellLine">
>>>                        <h:outputLabel value="#{labels.regCal_when}
>>> &#160;" />
>>>                        <t:inputCalendar id="kalender"
>>> renderAsPopup="true"
>>>
>>> popupButtonString="Click here to show Calendar"
>>>
>>> renderPopupButtonAsImage="true"
>>>
>>> popupDateFormat="dd/MM/yyyy"
>>>
>>> popupTodayString="#{labels.regCal_today} "
>>>
>>> popupWeekString="#{labels.regCal_week}"
>>>                                                        required="true"
>>>
>>> value="#{regcalbean.currentEvent.dateChosen}">
>>>
>>>                        </t:inputCalendar>&#160;&#160;&#160;&#160;
>>>
>>> ...
>>>             <h:message for="kalender" styleClass="error" />
>>>         </f:verbatim>
>>>         </t:div>
>>>
>>>
>>>
>>> All is rendered well when the Use Case chosen equals "submitNew", so
>>> far no problem.
>>>
>>> The "currentEvent" for its value, is of Type CalendarEvent where the
>>> relevant part of that class states:
>>> ...    /**
>>>      * The chosen Date:
>>>      */
>>> private Date dateChosen;
>>>
>>>     /**
>>>      * @return Returns the dateChosen.
>>>      */
>>>     public Date getDateChosen() {
>>>         return dateChosen;
>>>     }
>>>     /**
>>>      * @param dateChosen The dateChosen to set.
>>>      */
>>>     public void setDateChosen(Date dateChosen) {
>>>         this.dateChosen = dateChosen;
>>>     }
>>> (in the constructor dateChosen is not instantiated to avoid a default
>>> date of today in the inputCalendar field - this makes no  difference  as
>>> to the issue however)
>>>
>>> The problem:
>>> The weird stuff is twofold:
>>>     1/ The inputCalendar is a "required" element.
>>>     Yet, when I don't fill anything in, I get no complaints.
>>>     2/ It turns out that despite the fact all data inside the div is
>>> rendered, NONE of this data is actually saved. In fact whatever I   type
>>> into it, the "value" stays "null".
>>>     All data of currentEvent outside the div is saved correctly.
>>>
>>> Any ideas as to the "why"?
>>> I don't think this is how div is supposed to work, is it?
>>>
>>> Philippe
>>>
>>>
>>>
>>>
>>>
>>>
>>>
> 


Re: and validation & saving

Posted by Volker Weber <us...@weber-oldenburg.de>.
You need to enclose all plain html in verbatim, but don't put jsf in
verbatim.

try somthing like this:

  <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
    <f:verbatim>

      <tr >
        <td width="5%">&#160; </td>
        <td align="left" rowspan="4" class="rightCellLine">
    </f:verbatim>
          <h:outputLabel value="#{labels.regCal_when} &#160;" />
          <t:inputCalendar id="kalender"    renderAsPopup="true"
               popupButtonString="Click here to show Calendar"
               renderPopupButtonAsImage="true"
               popupDateFormat="dd/MM/yyyy"
               popupTodayString="#{labels.regCal_today} "
               popupWeekString="#{labels.regCal_week}"
               required="true"
               value="#{regcalbean.currentEvent.dateChosen}">
           </t:inputCalendar>&#160;&#160;&#160;&#160;
    <f:verbatim>
...
    </f:verbatim>
            <h:message for="kalender" styleClass="error" />
  </t:div>


Regards,
  Volker

Philippe Lamote wrote:
> Yes, I have. (Well, "had")
> I removed the verbatims and now it works - "functionally".
> "Easthetically" the page became a mess since now he's also rendering 
> the plain (non-jsf) HTML inside "hidden divs" (I mean divs with 
> rendered = false) , which he did do not previously.
> Some more explanation:
> I had a table with elements defined in pure HTML (using <table>, <tr> 
> and <td>)
> I had parts of the table (collection of rows) that I wanted to show  or
> hide, depending on the Use Case. So I was using the <t:div 
> rendered=f(some var) > wrapping these column sets.
> I added verbatim tags to properly hide/show the html markup inside 
> these divs.
> 
> Now I removed the verbatim tags. Functionally it works but he's  showing
> the HTML inside the hidden divs.
> To solve this, does this basically mean I will have to rewrite all  HTML
> to purely JSF code as the mix of both obviously entails some  annoying
> side effects?
> ( & thx for the advice already)
> Philippe
> 
> On 20 Feb 2006, at 23:16, Volker Weber wrote:
> 
> Hi Philippe,
> 
> you have jsf tags inside of f:verbatim? AFAIK this will not work, you
> should close the verbatim before the jsf tags, and reopen after.
> 
> 
> Regards,
>   Volker
> 
> Philippe Lamote wrote:
> 
>> Hi List,
>>
>> Another problem I've run into today:
>>
>> -- I have in my page a div like this: (inside a form)
>> ...
>>                 <!-- For the Use Case Submit New Calendar:  -->
>>            <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
>>            <f:verbatim>
>>
>>            <tr >
>>                <td width="5%">&#160; </td>
>>                <td align="left" rowspan="4" class="rightCellLine">
>>                        <h:outputLabel value="#{labels.regCal_when}
>> &#160;" />
>>                        <t:inputCalendar id="kalender"
>> renderAsPopup="true"
>>
>> popupButtonString="Click here to show Calendar"
>>
>> renderPopupButtonAsImage="true"
>>
>> popupDateFormat="dd/MM/yyyy"
>>
>> popupTodayString="#{labels.regCal_today} "
>>
>> popupWeekString="#{labels.regCal_week}"
>>                                                        required="true"
>>
>> value="#{regcalbean.currentEvent.dateChosen}">
>>
>>                        </t:inputCalendar>&#160;&#160;&#160;&#160;
>>
>> ...
>>             <h:message for="kalender" styleClass="error" />
>>         </f:verbatim>
>>         </t:div>
>>
>>
>>
>> All is rendered well when the Use Case chosen equals "submitNew", so
>> far no problem.
>>
>> The "currentEvent" for its value, is of Type CalendarEvent where the
>> relevant part of that class states:
>> ...    /**
>>      * The chosen Date:
>>      */
>> private Date dateChosen;
>>
>>     /**
>>      * @return Returns the dateChosen.
>>      */
>>     public Date getDateChosen() {
>>         return dateChosen;
>>     }
>>     /**
>>      * @param dateChosen The dateChosen to set.
>>      */
>>     public void setDateChosen(Date dateChosen) {
>>         this.dateChosen = dateChosen;
>>     }
>> (in the constructor dateChosen is not instantiated to avoid a default
>> date of today in the inputCalendar field - this makes no  difference  as
>> to the issue however)
>>
>> The problem:
>> The weird stuff is twofold:
>>     1/ The inputCalendar is a "required" element.
>>     Yet, when I don't fill anything in, I get no complaints.
>>     2/ It turns out that despite the fact all data inside the div is
>> rendered, NONE of this data is actually saved. In fact whatever I   type
>> into it, the "value" stays "null".
>>     All data of currentEvent outside the div is saved correctly.
>>
>> Any ideas as to the "why"?
>> I don't think this is how div is supposed to work, is it?
>>
>> Philippe
>>
>>
>>
>>
>>
>>
>>
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Re: and validation & saving

Posted by Martin Marinschek <ma...@gmail.com>.
Also look at:

http://jsftutorials.net/htmLib/

and the t:htmlTag

of MyFaces

regards,

Martin

On 2/21/06, Philippe Lamote <ph...@mac.com> wrote:
> Yes, I have. (Well, "had")
> I removed the verbatims and now it works - "functionally".
> "Easthetically" the page became a mess since now he's also rendering
> the plain (non-jsf) HTML inside "hidden divs" (I mean divs with
> rendered = false) , which he did do not previously.
> Some more explanation:
> I had a table with elements defined in pure HTML (using <table>, <tr>
> and <td>)
> I had parts of the table (collection of rows) that I wanted to show
> or hide, depending on the Use Case. So I was using the <t:div
> rendered=f(some var) > wrapping these column sets.
> I added verbatim tags to properly hide/show the html markup inside
> these divs.
>
> Now I removed the verbatim tags. Functionally it works but he's
> showing the HTML inside the hidden divs.
> To solve this, does this basically mean I will have to rewrite all
> HTML to purely JSF code as the mix of both obviously entails some
> annoying side effects?
> ( & thx for the advice already)
> Philippe
>
> On 20 Feb 2006, at 23:16, Volker Weber wrote:
>
> Hi Philippe,
>
> you have jsf tags inside of f:verbatim? AFAIK this will not work, you
> should close the verbatim before the jsf tags, and reopen after.
>
>
> Regards,
>    Volker
>
> Philippe Lamote wrote:
> > Hi List,
> >
> > Another problem I've run into today:
> >
> > -- I have in my page a div like this: (inside a form)
> > ...
> >                 <!-- For the Use Case Submit New Calendar:  -->
> >            <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
> >            <f:verbatim>
> >
> >            <tr >
> >                <td width="5%">&#160; </td>
> >                <td align="left" rowspan="4" class="rightCellLine">
> >                        <h:outputLabel value="#{labels.regCal_when}
> > &#160;" />
> >                        <t:inputCalendar id="kalender"
> > renderAsPopup="true"
> >
> > popupButtonString="Click here to show Calendar"
> >
> > renderPopupButtonAsImage="true"
> >
> > popupDateFormat="dd/MM/yyyy"
> >
> > popupTodayString="#{labels.regCal_today} "
> >
> > popupWeekString="#{labels.regCal_week}"
> >                                                        required="true"
> >
> > value="#{regcalbean.currentEvent.dateChosen}">
> >
> >                        </t:inputCalendar>&#160;&#160;&#160;&#160;
> >
> > ...
> >             <h:message for="kalender" styleClass="error" />
> >         </f:verbatim>
> >         </t:div>
> >
> >
> >
> > All is rendered well when the Use Case chosen equals "submitNew", so
> > far no problem.
> >
> > The "currentEvent" for its value, is of Type CalendarEvent where the
> > relevant part of that class states:
> > ...    /**
> >      * The chosen Date:
> >      */
> > private Date dateChosen;
> >
> >     /**
> >      * @return Returns the dateChosen.
> >      */
> >     public Date getDateChosen() {
> >         return dateChosen;
> >     }
> >     /**
> >      * @param dateChosen The dateChosen to set.
> >      */
> >     public void setDateChosen(Date dateChosen) {
> >         this.dateChosen = dateChosen;
> >     }
> > (in the constructor dateChosen is not instantiated to avoid a default
> > date of today in the inputCalendar field - this makes no
> > difference  as
> > to the issue however)
> >
> > The problem:
> > The weird stuff is twofold:
> >     1/ The inputCalendar is a "required" element.
> >     Yet, when I don't fill anything in, I get no complaints.
> >     2/ It turns out that despite the fact all data inside the div is
> > rendered, NONE of this data is actually saved. In fact whatever I
> > type
> > into it, the "value" stays "null".
> >     All data of currentEvent outside the div is saved correctly.
> >
> > Any ideas as to the "why"?
> > I don't think this is how div is supposed to work, is it?
> >
> > Philippe
> >
> >
> >
> >
> >
> >
> >
>
> --
> Don't answer to From: address!
> Mail to this account are droped if not recieved via mailinglist.
> To contact me direct create the mail address by
> concatenating my forename to my senders domain.
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: and validation & saving

Posted by Philippe Lamote <ph...@mac.com>.
Yes, I have. (Well, "had")
I removed the verbatims and now it works - "functionally".
"Easthetically" the page became a mess since now he's also rendering  
the plain (non-jsf) HTML inside "hidden divs" (I mean divs with  
rendered = false) , which he did do not previously.
Some more explanation:
I had a table with elements defined in pure HTML (using <table>, <tr>  
and <td>)
I had parts of the table (collection of rows) that I wanted to show  
or hide, depending on the Use Case. So I was using the <t:div  
rendered=f(some var) > wrapping these column sets.
I added verbatim tags to properly hide/show the html markup inside  
these divs.

Now I removed the verbatim tags. Functionally it works but he's  
showing the HTML inside the hidden divs.
To solve this, does this basically mean I will have to rewrite all  
HTML to purely JSF code as the mix of both obviously entails some  
annoying side effects?
( & thx for the advice already)
Philippe

On 20 Feb 2006, at 23:16, Volker Weber wrote:

Hi Philippe,

you have jsf tags inside of f:verbatim? AFAIK this will not work, you
should close the verbatim before the jsf tags, and reopen after.


Regards,
   Volker

Philippe Lamote wrote:
> Hi List,
>
> Another problem I've run into today:
>
> -- I have in my page a div like this: (inside a form)
> ...
>                 <!-- For the Use Case Submit New Calendar:  -->
>            <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
>            <f:verbatim>
>
>            <tr >
>                <td width="5%">&#160; </td>
>                <td align="left" rowspan="4" class="rightCellLine">
>                        <h:outputLabel value="#{labels.regCal_when}
> &#160;" />
>                        <t:inputCalendar id="kalender"
> renderAsPopup="true"
>
> popupButtonString="Click here to show Calendar"
>
> renderPopupButtonAsImage="true"
>
> popupDateFormat="dd/MM/yyyy"
>
> popupTodayString="#{labels.regCal_today} "
>
> popupWeekString="#{labels.regCal_week}"
>                                                        required="true"
>
> value="#{regcalbean.currentEvent.dateChosen}">
>
>                        </t:inputCalendar>&#160;&#160;&#160;&#160;
>
> ...
>             <h:message for="kalender" styleClass="error" />
>         </f:verbatim>
>         </t:div>
>
>
>
> All is rendered well when the Use Case chosen equals "submitNew", so
> far no problem.
>
> The "currentEvent" for its value, is of Type CalendarEvent where the
> relevant part of that class states:
> ...    /**
>      * The chosen Date:
>      */
> private Date dateChosen;
>
>     /**
>      * @return Returns the dateChosen.
>      */
>     public Date getDateChosen() {
>         return dateChosen;
>     }
>     /**
>      * @param dateChosen The dateChosen to set.
>      */
>     public void setDateChosen(Date dateChosen) {
>         this.dateChosen = dateChosen;
>     }
> (in the constructor dateChosen is not instantiated to avoid a default
> date of today in the inputCalendar field - this makes no  
> difference  as
> to the issue however)
>
> The problem:
> The weird stuff is twofold:
>     1/ The inputCalendar is a "required" element.
>     Yet, when I don't fill anything in, I get no complaints.
>     2/ It turns out that despite the fact all data inside the div is
> rendered, NONE of this data is actually saved. In fact whatever I   
> type
> into it, the "value" stays "null".
>     All data of currentEvent outside the div is saved correctly.
>
> Any ideas as to the "why"?
> I don't think this is how div is supposed to work, is it?
>
> Philippe
>
>
>
>
>
>
>

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.


Re: and validation & saving

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi Philippe,

you have jsf tags inside of f:verbatim? AFAIK this will not work, you
should close the verbatim before the jsf tags, and reopen after.


Regards,
  Volker

Philippe Lamote wrote:
> Hi List,
> 
> Another problem I've run into today:
> 
> -- I have in my page a div like this: (inside a form)
> ...
>                 <!-- For the Use Case Submit New Calendar:  -->
>            <t:div rendered="#{portalbean.useCase eq 'submitNew'}" >
>            <f:verbatim>
>           
>            <tr >
>                <td width="5%">&#160; </td>
>                <td align="left" rowspan="4" class="rightCellLine">
>                        <h:outputLabel value="#{labels.regCal_when}
> &#160;" />
>                        <t:inputCalendar id="kalender"   
> renderAsPopup="true"
>                                                       
> popupButtonString="Click here to show Calendar"
>                                                       
> renderPopupButtonAsImage="true"
>                                                       
> popupDateFormat="dd/MM/yyyy"
>                                                       
> popupTodayString="#{labels.regCal_today} "
>                                                       
> popupWeekString="#{labels.regCal_week}"
>                                                        required="true"
>                                                       
> value="#{regcalbean.currentEvent.dateChosen}">
>                                               
>                        </t:inputCalendar>&#160;&#160;&#160;&#160;
> 
> ...
>             <h:message for="kalender" styleClass="error" />
>         </f:verbatim>
>         </t:div>
>        
> 
> 
> All is rendered well when the Use Case chosen equals "submitNew", so 
> far no problem.
> 
> The "currentEvent" for its value, is of Type CalendarEvent where the 
> relevant part of that class states:
> ...    /**
>      * The chosen Date:
>      */
> private Date dateChosen;   
> 
>     /**
>      * @return Returns the dateChosen.
>      */
>     public Date getDateChosen() {
>         return dateChosen;
>     }
>     /**
>      * @param dateChosen The dateChosen to set.
>      */
>     public void setDateChosen(Date dateChosen) {
>         this.dateChosen = dateChosen;
>     }
> (in the constructor dateChosen is not instantiated to avoid a default 
> date of today in the inputCalendar field - this makes no difference  as
> to the issue however)
> 
> The problem:
> The weird stuff is twofold:
>     1/ The inputCalendar is a "required" element.
>     Yet, when I don't fill anything in, I get no complaints.
>     2/ It turns out that despite the fact all data inside the div is 
> rendered, NONE of this data is actually saved. In fact whatever I  type
> into it, the "value" stays "null".
>     All data of currentEvent outside the div is saved correctly.
> 
> Any ideas as to the "why"?
> I don't think this is how div is supposed to work, is it?
> 
> Philippe
> 
> 
> 
> 
> 
> 
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.