1 2 Previous Next 15 Replies Latest reply on Jul 26, 2008 1:07 PM by Razia Bhayani

    Reload required...

    Razia Bhayani Newbie


      If someone could please guide me with this issue?

      I am having a strange issue with seam. I have this '.xhtml' page, on which I have multiple rows of data getting populated. I have provided a button Delete next to each row. Now, when I click this button to delete the row, all goes well if I descend from top to bottom or if I delete and intermediate row. However when I try to delete the last row, all my entries disappear and I have to reload the page to see all my entries. They don't get deleted in one shot but they disappear and the page goes blank unless I refresh it.

      Why does this happen?

      Please keep advised.


        • 1. Re: Reload required...
          Nicklas Karlsson Master

          Show code and setup.

          • 2. Re: Reload required...
            Nicklas Karlsson Master

            BTW, are you binding the table itself to a backing bean component and/or using immediate?

            • 3. Re: Reload required...
              Razia Bhayani Newbie
              here's the code?

              <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
              <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                      xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">

                      <ui:define name="topnav">
                              <ui:include src="layout/mucc_nav.xhtml">
                                      <ui:param name="page" value="callblock" />

                      <ui:define name="body">
                                      <h:messages globalOnly="true" styleClass="message" />

                                              <f:facet name="header">Call Block</f:facet>

                                              <f:subview id="no_blockaddress"
                                                      <p><b>You have not set any blocking rules</b></p>

                                              <p>Set your call blocking rules here :</p>

                                              <f:subview id="blockaddress"
                                                      <h:dataTable value="#{userblockphoneaddresses}" var="phone">
                                                                      <f:facet name="header">Phone Address</f:facet>
                                                                      <h:outputText value="#{phone.phoneAddress}"></h:outputText>
                                                                      <h:commandButton value="Delete"
                                                                              action="#{showuserblockphoneaddresses.delete(phone)}" />

                                                      value="#{showuserblockphoneaddresses.phoneAddress}" size="15" /></dd>
                                                      value="Add Block Address" /></dd>


              • 4. Re: Reload required...
                Razia Bhayani Newbie

                Yes I am binding Stateful bean as a backing bean of JSF

                • 5. Re: Reload required...
                  Nicklas Karlsson Master

                  Could you post the backing bean also?

                  • 6. Re: Reload required...
                    Razia Bhayani Newbie
                    public class BlockAddressAction implements BlockAddress, Serializable {

                            @In(value = "currentUser", required = false)
                            User user;

                            @PersistenceContext(type = PersistenceContextType.EXTENDED)
                            EntityManager em;

                            List<UserBlockPhoneAddress> userblockphoneaddresses;

                    public String delete(UserBlockPhoneAddress selectedUserBlockPhoneAddress) {    
                                    if (selectedUserBlockPhoneAddress != null) {                   
                                    return findBlockAddresses();
                    • 7. Re: Reload required...
                      Nicklas Karlsson Master

                      The issue remains even if you have no subview?

                      • 8. Re: Reload required...
                        Razia Bhayani Newbie

                        Haven't tried that yet...do you suggest to try that?

                        • 9. Re: Reload required...
                          Nicklas Karlsson Master

                          Doesn't hurt trying. Just guessing here...

                          • 10. Re: Reload required...
                            Razia Bhayani Newbie

                            Oh ok then, lemme try it and see what happens. Will keep you posted about it.

                            • 11. Re: Reload required...
                              Razia Bhayani Newbie
                              Hey Nicklas,

                              It's amusing...Its working...
                              What's the issue with <f:subview>? Do you have any justifications?

                              Thanks alot for your support.

                              • 12. Re: Reload required...
                                Nicklas Karlsson Master

                                None whatsoever, just tried to isolate the problem. I've never used subviews, I usually stick to the rendered attribute on table itself or use some combination of s:div + rendered or ui:include

                                • 13. Re: Reload required...
                                  Razia Bhayani Newbie

                                  There's another issue that I face. I have few recorded messages. I try to play them when someone presses a play button, and I give them an option to delete that message too.

                                  <h:dataTable value="#{uservoicemessages}" var="phone">
                                          <f:facet name="header">Read</f:facet>
                                          <h:outputText value="#{phone.read}"></h:outputText>
                                          <f:facet name="header">From</f:facet>
                                          <h:outputText value="#{phone.phoneAddress}"></h:outputText>
                                          <f:facet name="header">Date</f:facet>
                                          <h:outputText value="#{phone.dateAddedOn}"></h:outputText>
                                          <s:button value="Delete" action="#{showuservoicemessage.delete}" />
                                          <s:button value="Play" action="#{showuservoicemessage.play}"></s:button>

                                  I am using the <object> tag to insert the player on the xhtml page. With the autostart option set to true.

                                  <object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="120" height="30">
                                                                                                    <param name="URL" value= {showuservoicemessage.currentVoiceMessage}"/>
                                           <param name="autoStart" value="true"/>
                                           <param name="uiMode" value="mini"/>
                                          <embed src="#{showuservoicemessage.currentVoiceMessage}" autostart="true"/>

                                  However when the user presses delete, the last played message repeats itself. I believe this is happening because the "autostart=true". Can you please guide to have this problem fixed? Or if you could please suggest any other mechanism by which I can play the message?

                                  • 14. Re: Reload required...
                                    Nicklas Karlsson Master

                                    Never done it, but does it work if you place a s:div with some rendered condition that is flipped to false when you think the object-tag might fire when it shouldn't?

                                    1 2 Previous Next