myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volker Weber <users.myfa...@weber-oldenburg.de>
Subject Re: <t:div> and validation & saving
Date Mon, 20 Feb 2006 23:09:14 GMT
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.

Mime
View raw message