myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (TOMAHAWK-1484) t:inputCalendar as popup with forceId="false" does not work
Date Thu, 04 Feb 2010 00:07:28 GMT

    [ https://issues.apache.org/jira/browse/TOMAHAWK-1484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829330#action_12829330
] 

Leonardo Uribe commented on TOMAHAWK-1484:
------------------------------------------

The bug is not on the component, rather it is in core. It was a little bit tricky to track
down.

If you set partial state saving to false, the code works without problem.

t:inputCalendar creates a transient component for the input text when renderAsPopup="true".
This component is created on Render Response time, and the listener used to track changes
on the component tree call getClientId(). This listener is activated by a PostAddToView event
triggered by the addition of the component. The point is since parent component is not set
yet, getClientId() does not take into account its "future" NamingContainer hierarchy, so the
effect described happens.

The algorithm for partial state saving must be fixed in two points:

1. It is only necessary to keep track of changes if the component added/removed is not transient.
2. Do not call getClientId() for PostAddToView, but do it for PreRemoveFromViewEvent. Instead,
register the component to be added before saveView like we do for refreshTransientBuildOnPSS
and preserve state option.

I'll create another issue in myfaces core issue tracker.

> t:inputCalendar as popup with forceId="false" does not work
> -----------------------------------------------------------
>
>                 Key: TOMAHAWK-1484
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1484
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.10-SNAPSHOT
>            Reporter: Ingo Hofmann
>
> A popup calender with forceId="true" does not appear, but produces a JavaScript error
when clicking on the button. The <span> element and JS code is rendered correctly, but
the <input> element gets the wrong id (form ID missing).
> Simple Facelet page that reproduces this issue (first calender works fine, second doesn't):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
>         xmlns:f="http://java.sun.com/jsf/core"
>         xmlns:h="http://java.sun.com/jsf/html"
>         xmlns:t="http://myfaces.apache.org/tomahawk">
> <h:head>
>      <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
>      <title>Calender test</title>
> </h:head>
> <h:body>
>         <h:form id="calendarForm">
>             <t:inputCalendar id="formWithForceIdTrue" monthYearRowClass="yearMonthHeader"
weekRowClass="weekHeader" popupButtonStyleClass="standard_bold"
>                 currentDayCellClass="currentDayCell" 
>                 renderAsPopup="true"
>                 popupDateFormat="MM/dd/yyyy"
>                 forceId="true"/>
>             <t:inputCalendar id="formWithForceIdFalse" monthYearRowClass="yearMonthHeader"
weekRowClass="weekHeader" popupButtonStyleClass="standard_bold"
>                 currentDayCellClass="currentDayCell"
>                 renderAsPopup="true"
>                 popupDateFormat="MM/dd/yyyy"
>                 forceId="false"/>
>         </h:form>
> </h:body>
> </html>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message