Just to close out this discussion (in case anybody else is listening to 
the thread)... I've come across a way to reset the values of inputText 
components that are in a table.  Turns out that it's actually pretty simple... 
very similar to some things discussed below.  It's just a matter of looping 
through each row of the table and using the myTable.findComponent( 
"inputTextId" ) to get the components in the table.  Once you've got the 
component, you can simply reset the values for that inputText the way it is 
described below.

 

 

            

UIXCollection collection = getMyTable();

int size = collection.getRowCount();

for( int index = 0 ; index < size ; index++ ) {

            collection.setRowKey( Integer.valueOf( index ) );

            _resetEditableValues( collection.findComponent( "inputTextId" ) );

}

 

________________________________

From: David Brunette [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 6:14 PM
To: MyFaces Discussion
Subject: RE: PPR - Update an inputText dont work

 

 

     Thanks for the suggestion.  But unfortunately it still did not work for 
me.  For an inputText on its own, it worked fine, but the values in my table 
still did not reset.

 

     While trying a bunch of things, I noticed that this is only happening if 
immediate="true" is set on the commandButton.  That seems like an odd thing to 
me.  Can somebody explain why this is only happening if immediate="true"??  
Maybe if I understood that bit a little more, I could come up with a way to 
work with this.

 

Dave

 

________________________________

From: Michał 'Gandalf' Stawicki [mailto:[EMAIL PROTECTED]
Sent: Mon 7/16/2007 12:57 PM
To: MyFaces Discussion
Subject: Re: PPR - Update an inputText dont work

In my case, I just put fields in form named objectDetForm and when I
need to reset them:

private void resetFields()
        {
                UIComponent c =
FacesContext.getCurrentInstance().getViewRoot().findComponent("objectDetForm");
                if(c != null && c.getParent() != null)
                        c.getParent().getChildren().remove(c);
               
        }

It's dirty, but for me it works

On 16/07/07, David Brunette <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
>      Hello.
>
>
>
>      I am having trouble with this as well.  But, the difference in my
> situation is that the inputText components that I am trying to reset are in
> a table.  I'm having trouble getting a hold of those components in the table
> so I can reset the values.  I've tried a couple things, such as binding the
> table to my bean and then trying to loop through all of its children
> (recursively) to find the inputTexts... but that didn't solve the issue for
> me.
>
>
>
>      Any idea on what I can do with the inputText components in the table??
> Thanks...
>
>
>
> Dave
>
>
>
>  ________________________________
>
>
> From: Martin Marinschek [mailto:[EMAIL PROTECTED]
>  Sent: Thursday, July 12, 2007 12:20 PM
>  To: MyFaces Discussion
>  Subject: Re: PPR - Update an inputText dont work
>
>
>
>
> Hi Ariel,
>
>  you'll have to clean out the value of the input-text - the problem that you
> are seeing is that JSF takes the current value in the inputText component,
> and sees this as more important than the backing bean value.
>
>  so you'll have to bind your inputText to your backing bean (using
> binding="#{myBean.myInputText}", and a getter/setter pair getMyInputText /
> setMyInputText in your backing bean) and then call:
>
>  myInputText.setSubmittedValue(null);
>  myInputText.setValue(null);
>  myInputText.setLocalValueSet(false);
>
>  with this, your inputText will reread the value from the backing bean!
>
>  regards,
>
>  Martin
>
>
> On 7/12/07, Ariel Di Mattia <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
>  I am having some problems with PPR.  When I try to update an inputText,
> it's
>  simply do nothing (no errors or warnings).  But, if I put the same
>  partialTriggers in other component (i.e. outputFormatted) with same backing
>  bean, all works fine.
>
>  Here is my code:
>
>  <f:view>
>  <tr:document title="#{title.applicationName}">
>          <t:div styleClass="mainPanel">
>                  <tr:form id="form">
>                  <tr:commandButton id="pSub_button"
>                              immediate="true"
>                              partialSubmit="true"
>                              text="Update"
>
> actionListener="#{newAgent.editContact}">
>              </tr:commandButton>
>                  <tr:panelLabelAndMessage label="OUTPUT
> FORMATTED: ">
>                          <tr:outputFormatted
> id="cmdTarget1"
>
> partialTriggers="pSub_button"
>
> styleUsage="instruction"
>
> value="#{newAgent.nombreContacto }">
>                     </tr:outputFormatted>
>            </tr:panelLabelAndMessage>
>            <tr:panelLabelAndMessage label="INPUT TEXT: ">
>                            <tr:inputText id="cmdTarget3"
>
> partialTriggers="pSub_button"
>
> value="#{newAgent.nombreContacto}">
>                            </tr:inputText>
>            </tr:panelLabelAndMessage>
>                  </tr:form>
>          </t:div>
>  </tr:document>
>  </f:view>
>
>
>  And backing bean method for actionListener:
>
>          public void editContact(ActionEvent event) {
>                  this.setNombreContacto("NOMBRE PPR");
>          }
>
>
>  Any ideas?. Is possible to do an inputText update via PPR?.  I think that
> yes,
>  but...my method seems  to be incorrect :((((
>
>  Thanks for all!!!.
>
>  Ariel.
>
>
>
>
>  --
>
>  http://www.irian.at <http://www.irian.at/> 
>
>  Your JSF powerhouse -
>  JSF Consulting, Development and
>  Courses in English and German
>
>  Professional Support for Apache MyFaces
> The information transmitted herewith is sensitive information of Chordiant
> Software or its customers and is intended only for use to the individual or
> entity to which it is addressed. If the reader of this message is not the
> intended recipient, you are hereby notified that any review, retransmission,
> dissemination, distribution, copying or other use of, or taking of any
> action in reliance upon, this information is strictly prohibited. If you
> have received this communication in error, please contact the sender and
> delete the material from your computer.


--
Michał Stawicki

[EMAIL PROTECTED]
http://stawicki.jasliska.pl <http://stawicki.jasliska.pl/> 

The information transmitted herewith is sensitive      information of Chordiant 
Software or its customers and is intended only for use to the individual or 
entity to which it is addressed. If the reader of this message is not the 
intended recipient, you are hereby notified that any review, retransmission, 
dissemination, distribution, copying or other use of, or taking of any action 
in reliance upon, this information is strictly prohibited. If you have received 
this communication in error, please contact the sender and delete the material 
from your computer.

Reply via email to