myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: [Trinidad] PPR and inputDate problems
Date Sat, 09 Feb 2008 16:14:55 GMT
Subform is a naming container, so you will have to give it an ID and use
colons to get out and back in.

A few more things to try:

Replace the inputDate with an outputText of the same ID -- does it update?
- If so this is not a PPR problem

or

Leave it as an inputDate and use the Firebug extension in Firefox to view
the AJAX response. Does it contain the inputDate?
- If so this is not a PPR problem

If the above shows that it is not a PPR problem and you don't want to bother
with the subform, put a breakpoint in your set method to see who is calling
it and with what value. The stack trace should show you the caller and you
can determine the phase.

otherwise, try this:
<h:dataTable ...
  <h:column>
    <f:facet
      name="header">
      <h:outputText
        value="#{bundle.ClassListFinalMarkHeader}"
        styleClass="label"/>
    </f:facet>
    <tr:subform id="finalMarkForm">
      <tr:inputText
        id="finalMarkField"
        columns="5"
        value="#{studentSec.finalMark}"
        autoSubmit="true"
        valueChangeListener="#{classListBean.finalMarkChanged}"/>
    </tr:subform>
  </h:column>
  <h:column>
    <f:facet
      name="header">
      <h:outputText
        value="#{bundle.ClassListWithdrawalDateHeader}"
        styleClass="label"/>
    </f:facet>
    <tr:subform id="withdrawalDateForm">
      <tr:inputDate
        id="withdrawalDate"
        columns="11"
        partialTriggers=":::finalMarkForm:finalMarkField"
        value="#{studentSec.withdrawalDate}"
        required="false"/>
      <h:message for="withdrawalDate"/>
    </tr:subform>
  </h:column>

Note that in trinidad 1.x.7 this will become
partialTriggers="::finalMarkForm:finalMarkField" (one less colon).



On Feb 8, 2008 4:26 PM, Shane Petroff <shane@mayet.ca> wrote:

>  Andrew Robinson wrote:
>
> I think I know your problem. It is a phase issue
>
>
> I'll take your word for it, but I guess the only thing I could do to try
> and trace it through was to set a breakpoint in the decode method and step
> through everything.
>
> and why value change listeners (VCL) suck in JSF (really bad architecture)
>
>
> Is there a better option? Even combos fire value changes.
>
>
> The VCL architecture sucks as it is not transaction aware, and the events
> fired in the validation doesn't mean that the update will ever be done (so
> the new value may never become the actual value). Also, when the VCL is
> invoked, the model is not updated, so you can't trust values from the model
> layer (beans) since they may have pending changes.
>
> I haven't tried it, but add a <tr:subform> around each input. This should
> only validate & update the value that has changed instead of the entire
> form.
>
> Didn't work. I'm using
>
>   <h:column>
>         <tr:subform>
>             <tr:inputText
>
> and similar for the inputDate
>
> One curious thing about this layout is that it can no longer find partial
> triggers fields when a normal name is specified for partialTriggers.
>
> Feb 8, 2008 5:12:16 PM
> org.apache.myfaces.trinidadinternal.context.RequestContextImpladdPartialTriggerListeners
> WARNING: Could not find partial trigger finalMarkField from
> CoreInputDate[UIXEditableFacesBeanImpl, id=_idJsp14]
>
> I tried the preceding colons as well (4 of them this time because of the
> additional nesting), but no luck there either.
>
> Surely I'm not the first person to try to use PPR/ValueChange on an
> editable table am I?
>
>
>
> On Feb 8, 2008 1:14 PM, Shane Petroff <shane@mayet.ca> wrote:
>
> >  Andrew Robinson wrote:
> >
> >
> > What trinidad build are you using?
> >
> >
> > Trinidad 1.0.5,
> > MyFaces Core 1.1.5
> >
> >
> > colons should not be necessary for components in the same naming
> > container.
> >
> >
> > Tried with and without. Using the colons clearly does not work because
> > it issues the warning:
> >
> > WARNING: Could not find partial trigger :::finalMarkField from
> > CoreInputDate[UIXEditableFacesBeanImpl, id=_idJsp12]
> >
> > With no preceding colons there is no warning generated, but the field is
> > never refreshed either. The value change method is below, as is a stripped
> > down jsp. I can see the value change being fired, but where would I even set
> > a breakpoint to tell if anything is happening on the partialTriggers side?
> >
> >
> >
> >     public void finalMarkChanged( ValueChangeEvent event )
> >     {
> >         StudentSection ss = (StudentSection) m_Table.getRowData();
> >          ss.setWithdrawalDate(new Date()); // I'm assuming that this
> > instance is still around to refresh the field from
> >         System.out.println( "finalMarkChanged for " + ss.getStudentName()
> > + " " + ss.getWithdrawalDate() );
> >     }
> >
> >
> >  <f:view>
> >
> > <tr:document title="#{bundle.ClassListHeader}">
> >
> > <body class="page-background">
> >
> > <h:form>
> >
> >   <h:panelGrid headerClass="page-header" styleClass="panel"
> >                columns="1" cellpadding="5">
> >
> >     <h:messages showDetail="true" showSummary="false"
> > styleClass="errors"/>
> >
> >     <h:dataTable styleClass="dataTable"
> >                  rowClasses="list-row-even,list-row-odd" cellpadding="4"
> > border="0"
> >                  headerClass="list-header"
> >                  cellspacing="0"
> >                  value="#{classListBean.studentSections}"
> >                  var="studentSec"
> >                  binding="#{classListBean.table}">
> >
> >       <h:column>
> >         <f:facet name="header">
> >           <h:commandLink styleClass="table-header" id="studentDesc"
> >                          actionListener="#{classListBean.sort}">
> >             <h:outputText value="#{bundle.StudentColHeader}"/>
> >           </h:commandLink>
> >         </f:facet>
> >         <h:outputText value="#{studentSec.studentName}"/>
> >       </h:column>
> >
> >       <h:column>
> >         <f:facet name="header">
> >              <h:outputText value="#{bundle.ClassListFinalMarkHeader}"
> > styleClass="label"/>
> >         </f:facet>
> >         <tr:inputText id="finalMarkField"
> >                       columns="5"
> >                       value="#{studentSec.finalMark}"
> >                       autoSubmit="true"
> >                       valueChangeListener="#{
> > classListBean.finalMarkChanged}"/>
> >       </h:column>
> >
> >       <h:column>
> >         <f:facet name="header">
> >             <h:outputText value="#{bundle.ClassListWithdrawalDateHeader}"
> > styleClass="label"/>
> >         </f:facet>
> >          <tr:inputDate columns="11"
> >                       partialTriggers=":::finalMarkField"
> >                       value="#{studentSec.withdrawalDate}"
> >                       required="false" >
> >              <f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{
> > configBundle.TimeZone}"/>
> >         </tr:inputDate>
> >       </h:column>
> >
> >     </h:dataTable>
> >
> >   </h:panelGrid>
> >
> > </h:form>
> >
> > </body>
> >
> >  </tr:document>
> >
> > </f:view>
> >
> >
> >
> > On Feb 8, 2008 10:31 AM, Shane Petroff <shane@mayet.ca> wrote:
> >
> > > Matthias Wessendorf wrote:
> > > > ah,
> > > > I just noticed, that "finalMarkField" is inside a table (naming
> > > container).
> > > > haven't read your code carefully, sorry.
> > > >
> > > > can you *try* partialTriggers=":::finalMarkField" ?
> > > >
> > >
> > >  No joy... cleared the browser cache first, then dumped tomcat's
> > > cache,
> > > did a full build and restarted the server. I also tried :: and ::::
> > > variants (3 does appear to be the correct number though based on the
> > > generated html), but still no partial triggers refresh. Would it be
> > > more
> > > likely to work if I switched to a tr:table?
> > >
> > > --
> > > Shane
> > >
> > >
> >  --
> > Shane
> >
> >
>
>
> --
> Shane
>
>

Mime
View raw message