[
https://issues.apache.org/jira/browse/TOMAHAWK-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Price resolved TOMAHAWK-1171.
----------------------------------
Resolution: Fixed
I realized the component referenced by the binding attribute on the
<t:inputText> component was a javax.faces.component.html.HtmlInputText. When I
changed the object to an org.apache.myfaces.component.html.ext.HtmlInputText
component, the component ID assignment worked as expected.
> forceId doesn't work when page rendered after an 'immediate' action
> -------------------------------------------------------------------
>
> Key: TOMAHAWK-1171
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-1171
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: ForceId
> Affects Versions: 1.1.3
> Environment: java 1.4.2_13, myfaces 1.1.4, tomahawk 1.1.3, windows XP
> Reporter: Eric Price
> Priority: Minor
>
> I have a jsp with the following components:
> <t:outputText value="Processed Date/Time:"/>
> <t:panelGroup rendered="#{reportBean.dateCleared}">
> <t:inputText styleClass="deactiveText" title="yyyy-MM-dd"
> size="10" maxlength="10" readonly="true"/>
> <t:inputText styleClass="deactiveText" title="HH:mm:ss"
> size="8" maxlength="8" readonly="true"/>
> </t:panelGroup>
> <t:panelGroup rendered="#{!reportBean.dateCleared}">
> <t:inputText binding="#{reportBean.startDateInput}" size="10"
> maxlength="10" immediate="true"
> value="#{reportBean.startDate}" title="yyyy-MM-dd"
> forceId="true" id="processedDateStartDateInput">
> <t:convertDateTime type="date" pattern="yyyy-MM-dd"/>
> </t:inputText>
> <t:inputText binding="#{reportBean.startTimeInput}" size="8"
> maxlength="8" immediate="true"
> value="#{reportBean.startTime}" title="HH:mm:ss"
> forceId="true" id="processedDateStartTimeInput">
> <t:convertDateTime type="time" pattern="HH:mm:ss"/>
> </t:inputText>
> </t:panelGroup>
> When the page is initially displayed the value of reportBean.dateCleared is
> false, so the first two inputText components are displayed. The source of the
> page looks like:
> <td class="fieldLabelColumn">Processed Date/Time:</td>
> <td class="defaultColumn">
> <input id="mainform:_idJsp393" name="mainform:_idJsp393"
> type="text" value="" maxlength="10" readonly="readonly"
> size="10" title="yyyy-MM-dd" class="deactiveText"/>
> <input id="mainform:_idJsp396" name="mainform:_idJsp396"
> type="text" value="" maxlength="8" readonly="readonly"
> size="8" title="HH:mm:ss" class="deactiveText"/>
> </td>...
> which shows what I would expect for the componet IDs.
> The page also contains a jsCookMenu with an action method that causes the
> processed date fields to be set according to the user selection. The action
> method is executed with immediate="true" set on the menu component.
> Once the date is set, the reportBean.dateCleared is set to false and the
> current page is re-rendered. The selected date is correctly displayed in the
> date fields, but the component IDs are not set correctly. After setting the
> date and the page re-rendered, the source looks like:
> <td class="fieldLabelColumn">Processed Date/Time:</td>
> <td class="defaultColumn">
> <input id="mainform:processedDateStartDateInput"
> name="mainform:processedDateStartDateInput" type="text"
> value="2007-12-15" maxlength="10" size="10"
> title="yyyy-MM-dd" />
> <input id="mainform:processedDateStartTimeInput"
> name="mainform:processedDateStartTimeInput" type="text"
> value="23:59:59" maxlength="8" size="8"
> title="HH:mm:ss"/>
> </td>
> The component IDs have the specified value, but the form name is prepended.
> Once I navigate to the next page of the application, and then navigate back
> to this page (via an action method on a button), I see the following source:
> <td class="fieldLabelColumn">Processed Date/Time:</td>
> <td class="defaultColumn">
> <input id="processedDateStartDateInput"
> name="processedDateStartDateInput" type="text"
> value="2007-12-15" maxlength="10" size="10"
> title="yyyy-MM-dd" />
> <input id="processedDateStartTimeInput"
> name="processedDateStartTimeInput" type="text"
> value="23:59:59" maxlength="8" size="8"
> title="HH:mm:ss"/>
> </td>
> Now the component IDs are what I expected, just the ID without the form name
> prepended.
> Any insight as to why the forceId doesn't appear to work when rendering the
> page after an (immediate) action, but it does work when rendering the page
> via navigation?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.