Ok, I made a mistake in resetting my values in the constructor, this
example works as expected.
 

Nate Perkins 
General Dynamics C4 Systems 

This email message is for the sole use of the intended recipient(s) and
may contain GDC4S 
 confidential or privileged information. Any unauthorized review, use,
disclosure or distribution 
 is prohibited. If you are not an intended recipient, please contact the
sender by reply email and 
 destroy all copies of the original message. 

 

________________________________

From: Perkins, Nate-P63196 [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 09, 2007 8:17 AM
To: MyFaces Discussion
Subject: RE: [Trinidad] PPR problem


Ok, I came up with a pretty simple test page.  The page has two buttons
in the first subform that show a panel in the second subform.  The only
button that works in the second subform is the non-PPR button ('Close').
The actions are not called for any other button.  I also tried
actionListeners and those are not called either.  There are no
Javascript errors.  This was tested with 1.0.1
 
Page:
        ...
      <trh:body>
         <tr:form id="mainForm">
            <tr:messages id="messages" />
            <tr:subform id="subform1">
               <tr:commandButton
                  id="show"
                  text="Show Panel"
                  action="#{testProbBB.showPanel}" />
               <tr:commandButton
                  id="edit"
                  text="Edit Panel"
                  action="#{testProbBB.editPanel}" />
            </tr:subform>
            <tr:subform id="subform2">
               <tr:panelHeader
                  id="testPanel"
                  partialTriggers="save cancel edit"
                  rendered="#{testProbBB.panelShown}">
                  <tr:panelButtonBar
                     rendered="#{testProbBB.panelEditing}">
                     <tr:commandButton
                        id="save"
                        text="Save"
                        action="#{testProbBB.save}"
                        partialSubmit="true" />
                     <tr:commandButton
                        id="cancel"
                        text="Cancel"
                        action="#{testProbBB.cancel}"
                        immediate="true"
                        partialSubmit="true" />
                  </tr:panelButtonBar>
                  <tr:panelButtonBar
                     rendered="#{!testProbBB.panelEditing}">
                     <tr:commandButton
                        id="edit"
                        text="Edit"
                        action="#{testProbBB.edit}"
                        immediate="true"
                        partialSubmit="true" />
                     <tr:commandButton
                        id="close"
                        text="Close"
                        action="#{testProbBB.close}" />
                  </tr:panelButtonBar>
               </tr:panelHeader>
            </tr:subform>
         </tr:form>
      </trh:body>
        ...
 
Backing Bean:
 
public class TestProbBb
{
   /** the Logger */
   private static Logger m_logger = Logger.getLogger(TestProbBb.class);
 
   public TestProbBb()
   {
      m_logger.trace("Entering constructor");
      setPanelShown(false);
      setPanelEditing(false);
      m_logger.trace("Exiting constructor");
   }
 
   public String showPanel()
   {
      m_logger.trace("Entering showPanel");
 
      setPanelShown(true);
      setPanelEditing(false);
      
      m_logger.trace("Exiting showPanel");
 
      return null;
   }
   
   public String editPanel()
   {
      m_logger.trace("Entering editPanel");
 
      setPanelShown(true);
      setPanelEditing(true);
      
      m_logger.trace("Exiting editPanel");
 
      return null;
   }
   
   public String save()
   {
      m_logger.trace("Entering save");
 
      setPanelEditing(false);
      FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Saved"));
      
      m_logger.trace("Exiting save");
 
      return null;
   }
   
   public void saveListener(ActionEvent event)
   {
      m_logger.trace("Entering saveListener");
      
      m_logger.trace("Exiting saveListener");
   }
   
   public String edit()
   {
      m_logger.trace("Entering edit");
 
      setPanelEditing(true);
      
      m_logger.trace("Exiting edit");
 
      return null;
   }
   
   public void editListener(ActionEvent event)
   {
      m_logger.trace("Entering editListener");
      
      m_logger.trace("Exiting editListener");
   }
   
   public String cancel()
   {
      m_logger.trace("Entering cancel");
 
      setPanelEditing(false);
      
      m_logger.trace("Exiting cancel");
 
      return null;
   }
   
   public void cancelListener(ActionEvent event)
   {
      m_logger.trace("Entering cancelListener");
      
      m_logger.trace("Exiting cancelListener");
   }
   
   public String close()
   {
      m_logger.trace("Entering close");
 
      setPanelShown(false);
      
      m_logger.trace("Exiting close");
 
      return null;
   }
 
   public void closeListener(ActionEvent event)
   {
      m_logger.trace("Entering closeListener");
      
      m_logger.trace("Exiting closeListener");
   }
   
   public boolean isPanelEditing()
   {
      Boolean bool = (Boolean)
RequestContext.getCurrentInstance().getPageFlowScope().get("panelEditing
");
      if (bool == null)
      {
         return false;
      }
      else
      {
         return bool;
      }
   }
 
   private void setPanelEditing(boolean bool)
   {
 
RequestContext.getCurrentInstance().getPageFlowScope().put("panelEditing
", bool);
   }
 
   public boolean isPanelShown()
   {
      Boolean bool = (Boolean)
RequestContext.getCurrentInstance().getPageFlowScope().get("panelShown")
;
      if (bool == null)
      {
         return false;
      }
      else
      {
         return bool;
      }
   }
 
   private void setPanelShown(boolean bool)
   {
 
RequestContext.getCurrentInstance().getPageFlowScope().put("panelShown",
bool);
   }
}


Nate Perkins 
General Dynamics C4 Systems 

This email message is for the sole use of the intended recipient(s) and
may contain GDC4S 
 confidential or privileged information. Any unauthorized review, use,
disclosure or distribution 
 is prohibited. If you are not an intended recipient, please contact the
sender by reply email and 
 destroy all copies of the original message. 

 

________________________________

From: Matt Cooper [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 08, 2007 3:30 PM
To: MyFaces Discussion
Subject: Re: [Trinidad] PPR problem


Oh, and one other tip is to try reproducing the problem using a very
simple test case.  This will sometimes help to narrow down and identify
the problem.


On 10/8/07, Matt Cooper <[EMAIL PROTECTED]> wrote: 

        Hmm... that looks correct to me too.  I don't know what else
might be causing the problem.  The next step would be to see if there
are any JavaScript errors in the browser, possibly looking at the
network traffic to see if the updated DOM is being sent back to the
browser, possibly assigning an actionListener on the button to make sure
that at least the action is queued. 
        
        Hope this helps, 
        
        Matt
        
        
        On 10/8/07, Perkins, Nate-P63196 < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

                <tr:subform> 
                  <tr:table> 
                    <tr:button id="view"/> 
                    <tr:button id="edit"/> 
                  </tr:table> 
                </tr:subform> 
                <tr:subform> 
                   <tr:panelHeader id="activePanel"
partialTriggers="anotherEdit save cancel"> 
                    <tr:panelButtonBar id="viewBar"
rendered="#{readOnly}"> 
                      <tr:button id="close" /> 
                      <tr:button id="anotherEdit" partialSubmit="true"/>

                    </tr:panelButtonBar> 
                    <tr:panelButtonBar id="editBar"
rendered="#{!readOnly}"> 
                      <tr:button id="save" partialSubmit="true"/> 
                      <tr:button id="cancel" partialSubmit="true"/> 
                    </tr:panelButtonBar> 
                        .... 
                  </tr:panelHeader> 
                </tr:subform> 

                Thanks for looking!  I'm still pretty certain that the
partialTriggers aren't the issue though. : )
                Nate Perkins 
                General Dynamics C4 Systems 

                This email message is for the sole use of the intended
recipient(s) and may contain GDC4S 
                 confidential or privileged information. Any
unauthorized review, use, disclosure or distribution 
                 is prohibited. If you are not an intended recipient,
please contact the sender by reply email and 
                 destroy all copies of the original message. 

                 

________________________________

                From: Matt Cooper [mailto:[EMAIL PROTECTED] 
                Sent: Monday, October 08, 2007 2:49 PM 
                
                To: MyFaces Discussion
                Subject: Re: [Trinidad] PPR problem
                

                
                The subform is a NamingContainer so the problem could be
issues with the expressions in the partialTriggers.
        
http://myfaces.apache.org/trinidad/trinidad-api/apidocs/org/apache/myfac
es/trinidad/component/UIXSubform.html
                
                There is an open issue with how expressions are resolved
for partialTriggers so that too may be in play: 
                https://issues.apache.org/jira/browse/TRINIDAD-757
                
                To tell for sure, I'd need to see which component(s)
have partialTriggers for the buttons being clicked and what their
expressions are. 
                
                Regards,
                Matt
                
                
                On 10/8/07, Perkins, Nate-P63196
<[EMAIL PROTECTED]> wrote: 

                        Right, I do have the partialRendering on the
panelHeader.  Like I mentioned below, the rendering of the buttons is
working fine.  What is not working fine are the buttons' actions, no
matter the combination, the second PPR action will fail.
                        
                         

                        Nate Perkins 
                        General Dynamics C4 Systems 

                        This email message is for the sole use of the
intended recipient(s) and may contain GDC4S 
                         confidential or privileged information. Any
unauthorized review, use, disclosure or distribution 
                         is prohibited. If you are not an intended
recipient, please contact the sender by reply email and 
                         destroy all copies of the original message. 

                         

________________________________

                        From: Matt Cooper [mailto:[EMAIL PROTECTED] 
                        Sent: Monday, October 08, 2007 2:26 PM
                        To: MyFaces Discussion
                        Subject: Re: [Trinidad] PPR problem
                        
                        
                        
                        Hi Nate,
                        
                        If you are trying to PPR the panelButtonBar
components directly, it will not work when rendered was set to false.
In order to PPR something, it must be already rendered.  Instead, either
PPR the parent of the panelButtonBar components, the panelHeader, or
wrap the two panelButtonBar components in something else, like a panel
group layout and PPR that component instead.  That way, any changes to
the panelButtonBar rendered attributes will be visible to the user. 
                        
                        Regards,
                        Matt
                        
                        
                        On 10/8/07, Perkins, Nate-P63196
<[EMAIL PROTECTED]> wrote: 

                                Hey All, 

                                I have a page with the following
structure: 

                                <tr:subform> 
                                  <tr:table> 
                                    <tr:button id="view"/> 
                                    <tr:button id="edit"/> 
                                  </tr:table> 
                                </tr:subform> 
                                <tr:subform> 
                                   <tr:panelHeader> 
                                    <tr:panelButtonBar
rendered="#{readOnly}"> 
                                      <tr:button id="close" /> 
                                      <tr:button id="anotherEdit"
partialSubmit="true"/> 
                                    </tr:panelButtonBar> 
                                    <tr:panelButtonBar
rendered="#{!readOnly}"> 
                                      <tr:button id="save"
partialSubmit="true"/> 
                                      <tr:button id="cancel"
partialSubmit="true"/> 
                                    </tr:panelButtonBar> 
                                        .... 
                                  </tr:panelHeader> 
                                </tr:subform> 

                                   The intended behaviour is if you
select view or edit from the table it shows the panelHeader in the
appropriate mode.  Then you can do what you need to do in the lower
subform (there are two subforms do to some filtering elements in the
table).  I only render the appropriate buttons depending on the mode so
at any given time only one of the panelButtonBars is rendered. 

                                My problem is that if I select edit from
the table (non PPR button) and then hit save (PPR) things go as
expected, but if I select view from the table (non-PPR) and then select
edit (PPR) and then save (PPR), the save action is never called. 

                                I'm not sure what to do about this as
I've tried all combinations of partialTriggers that I could think of
with no luck.  I don't think it's a partialTrigger problem as the
buttons are being rendered correctly.  I wonder if this is a PPR problem
or maybe a PPR in a subform problem?  Without fail though, the second
PPR request does not process. 

                                Any help would be greatly appreciated! 

                                Nate Perkins 
                                General Dynamics C4 Systems 

                                This email message is for the sole use
of the intended recipient(s) and may contain GDC4S 
                                 confidential or privileged information.
Any unauthorized review, use, disclosure or distribution 
                                 is prohibited. If you are not an
intended recipient, please contact the sender by reply email and 
                                 destroy all copies of the original
message. 






Reply via email to