0
  • run FILE1.XHTML I could not see the print in console.

  • run FILE2.XHTML, I can see the print statement in console.

Here are the code snippets, Can someone explain me, why this is happening?

Bean.java

public String  Deleterule(int id) {
        System.out.println("bean action----------------------------"+id);
        return "";
    }

FILE1.XHTML(Not working action="#{repricing.Deleterule(ruleVar.id)}")

<h:form id="Retreiving">            
<div class="box-padd">
    <div class="panel panel-default">
        <div class="panel-heading  head-bg">Repricing Rules</div>
        <div class="panel-body">
            <div class="clearfix "></div>
            <ui:repeat var="ruleVar" value="#{repricing.repricingRules}" varStatus="status" >
            <div class="panel-group" style="margin-top: 45px;" >
                <div class="panel panel-default">
                    <div class="panel-heading col-sm-12">
                        <div class="">
                            <div data-toggle="collapse" href="##{status.index}">
                                <div class="col-md-1">
                                    <i class="glyphicon glyphicon-tags" aria-hidden="true"
                                        style="font-size: 25px;"></i>
                                </div>
                                <div class="col-md-3">#{ruleVar.name}</div>
                                <div class="col-md-7">#{ruleVar.description}</div>
                                <div class="col-md-1">
                                <!--    <span aria-hidden="true" class="glyphicon glyphicon-trash" ></span> -->

                                </div>
                            </div>




                                  <h:commandLink value="Delete" action="#{repricing.Deleterule(ruleVar.id)}" >

                                 </h:commandLink> 

                            </div>
                    </div>

                    <div id="#{status.index}" class="panel-collapse collapse">
                        <div class="panel-body">

                            <div class="contetn-box">
                    <form>

                                    <div class=" col-md-12  borderline">
                                        <h4>Repricing logic</h4>
                                        <div class="col-md-12 padding">
                                            <h:selectBooleanCheckbox id="abool" value="#{ruleVar.checkboxOne}" disabled="true">
                            </h:selectBooleanCheckbox> I want my new price to be
                                <h:selectOneMenu disabled="true" id="a1menu" value="#{ruleVar.rowOneDropdownOne}"  class="selectpicker" style="margin-left: 5px; margin-right: 15px;">
                                    <f:selectItem itemValue="Below"/>
                                    <f:selectItem itemValue="Equal To"/>
                                    <f:selectItem itemValue="Above"/>
                                </h:selectOneMenu>
                                <span style="margin-left: 5px; margin-right: 15px;">
                                <h:selectOneMenu disabled="true" value="#{ruleVar.rowOneDropdownTwo}" class="selectpicker">
                                    <f:selectItem itemValue="Highest of"/>
                                    <f:selectItem itemValue="Lowest of"/>
                                    <f:selectItem itemValue="Avg. of"/>
                                </h:selectOneMenu>
                                </span>
                                <span>

                                    <input type="button" disabled="disabled"  value="#{ruleVar.numberOfSelectedCompetitors} selected Competitors" style="width: auto; float: none; display: inline-block; padding: 0 6px; margin-right: 15px;" class="btn btn-default" data-toggle="modal" data-target="#addModal1"></input>
                                </span>by
                                <h:inputText value="#{ruleVar.rowOneByValue}" disabled="true" type="text" style="text-align: center; width: 36px;"
                                    placeholder="0">
                                </h:inputText>
                                <h:selectOneMenu value="#{ruleVar.rowOneCurrencyType}" disabled="true" class="selectpicker" style="text-align: center; width: 48px; padding: 3px; margin-left: 10px;">
                                    <f:selectItem itemValue="%"/>
                                    <f:selectItem itemValue="$"/>
                                </h:selectOneMenu>
                            </div>
                            <div class="col-md-12  padding">
                                            <h:selectBooleanCheckbox value="#{ruleVar.checkboxTwo}" disabled="true" /> I want my new price to be
                                <span style="margin-left: 5px; margin-right: 15px;">
                                <h:selectOneMenu value="#{ruleVar.rowTwoDropdownOne}" disabled="true" class="selectpicker" style="width: 80px; padding: 4px">
                                    <f:selectItem itemValue="Below"/>
                                    <f:selectItem itemValue="Equal To"/>
                                    <f:selectItem itemValue="Above"/>
                                </h:selectOneMenu>
                                </span>
                                <span style="margin-left: 5px; margin-right: 15px;">
                                <h:selectOneMenu value="#{ruleVar.rowTwoDropdownTwo}" disabled="true" class="selectpicker" style="width: 245px; padding: 4px">
                                    <f:selectItem itemValue= "1st Top Competitor (By Price)"/>
                                    <f:selectItem itemValue= "2nd Top Competitor (By Price)"/>
                                    <f:selectItem itemValue= "3rd Top Competitor (By Price)"/>
                                    <f:selectItem itemValue="4th Top Competitor (By Price)" />
                                </h:selectOneMenu>
                                </span> by
                                <h:inputText value="#{ruleVar.rowTwoByValue}" disabled="true" type="text" style="text-align: center; width: 36px;" placeholder="0" >
                                </h:inputText>
                                    <h:selectOneMenu value="#{ruleVar.rowTwoCurrencyType}" disabled="true" class="selectpicker" style="text-align: center; width: 48px; padding: 3px; margin-left: 10px;">
                                        <f:selectItem itemValue="%"/>
                                        <f:selectItem itemValue="$"/>
                                    </h:selectOneMenu>
                                        </div>
                                <div class="col-md-12  padding">
                                <h:selectBooleanCheckbox value="#{ruleVar.checkboxThree}" disabled="true"/> I want my new price to be
                                <span style="margin-left: 5px; margin-right: 15px;">
                                <h:selectOneMenu value="#{ruleVar.rowThreeDropdownOne}" disabled="true" class="selectpicker" style="width: 80px; padding: 4px">
                                    <f:selectItem itemValue="Below"/>
                                    <f:selectItem itemValue="Equal To"/>
                                    <f:selectItem itemValue="Above"/>
                                </h:selectOneMenu>
                                </span>
                                <span style="margin-left: 5px; margin-right: 15px;">
                                <h:selectOneMenu value="#{ruleVar.rowThreeDropdownTwo}"  disabled="true" class="selectpicker" style="width: 245px; padding: 4px">
                                    <f:selectItem itemValue= "1st Top Competitor (By Price)"/>
                                    <f:selectItem itemValue= "2nd Top Competitor (By Price)"/>
                                    <f:selectItem itemValue= "3rd Top Competitor (By Price)"/>
                                    <f:selectItem itemValue="4th Top Competitor (By Price)" />
                                </h:selectOneMenu>
                                </span> by
                                <h:inputText value="#{ruleVar.rowThreeByValue}" disabled="true" type="text" style="text-align: center; width: 36px;" placeholder="0" >
                                </h:inputText>
                                    <h:selectOneMenu value="#{ruleVar.rowThreeCurrencyType}" disabled="true" class="selectpicker" style="text-align: center; width: 48px; padding: 3px; margin-left: 10px;">
                                        <f:selectItem itemValue="%"/>
                                        <f:selectItem itemValue="$"/>
                                    </h:selectOneMenu>
                            </div>

                                    <div class="col-md-12  padding">
                            <h:selectBooleanCheckbox value="#{ruleVar.checkboxFour}" disabled="true" />
                                Reprice based on Price +
                                Shipping (may change based on destination)
                            </div>
                                        <div class="col-md-12  padding ">
                                <h:selectBooleanCheckbox value="#{ruleVar.checkboxFive}" disabled="true" />  Ignore competitors under
                                min price
                            </div>
                                    </div>

                                    <div class=" col-md-12">
                                        <h4>Rule PriceGuard</h4>
                                        <div class="col-md-12 padding">
                                            <p>What should WisePricer do if the Rule's New Price is
                                                below your Min. Price column?</p>
                                            <p>Keep in mind that if you do not have a Min. Price
                                                column we will use your Store PriceGuard as minimum price</p>
                                        </div>
                                        <div class="col-md-12  padding">
                                            <h:selectBooleanCheckbox type="radio" disabled="true" value="#{ruleVar.checkboxSix}" /> Leave product at current
                                price
                                        </div>
                                        <div class="col-md-12  padding">
                <h:selectBooleanCheckbox type="radio" value="#{ruleVar.checkboxSeven}" disabled="true"/>                Set it to minimum price
                                        </div>
                                        <div class="col-md-12  padding">
                <h:selectBooleanCheckbox disabled="true" type="checkbox" value="#{ruleVar.checkboxEight}" /> Set it to
                                    <h:inputText disabled="true" type="text" value="#{ruleVar.rowEightByValue}" placeholder="0" style="text-align: center; width: 50px; margin-left: 15px;" ></h:inputText>
                                    <h:selectOneMenu disabled="true" value="#{ruleVar.rowEightCurrencyType}" class="selectpicker" style="text-align: center; width: 48px; padding: 3px; margin-left: 10px;">
                                        <f:selectItem itemValue="%"/>
                                        <f:selectItem itemValue="$"/>
                                    </h:selectOneMenu> above cost (or minimum price if higher)
</div>
</div>
</div>
</div>
</div>
</div>
</div>      </ui:repeat>


</h:form>

FILE2.XHTML(Working action="#{repricing.Deleterule(ruleVar.id)}" )

<h:form id="Retreiving">            
<ui:repeat var="ruleVar" value="#{repricing.repricingRules}"  >
<h:outputText value = "#{ruleVar.id}"></h:outputText>
<h:commandLink value="#{ruleVar.id}" action="#{repricing.Deleterule(ruleVar.id)}" >
</h:commandLink> 
</ui:repeat></h:form>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 2
    Your file1 is totally messed up. There are approx. 10 missing closing tags and you have some nested forms in there. Please provide a [mcve] – stg Dec 20 '16 at 06:45
  • @stg Sure Just a moment – Srikanth Pragallapati Dec 20 '16 at 06:47
  • @stg I just make some corrections – Srikanth Pragallapati Dec 20 '16 at 07:19
  • 1
    There are still more opening than closing tags in your code (which can be seen easily with a proper formatting of the code). There are still nested forms (which might be the actual problem btw). And there are still too much irrelevant lines of code in your snippet. *Once again:* Please read this carefully: [mcve] – stg Dec 20 '16 at 07:28
  • ya nested forms is the problem. Solved Thanks! – Srikanth Pragallapati Dec 20 '16 at 09:02
  • @srikanthpragallapati: If you create a [mcve] for every problem you encounter, most of the time you'll find a sort of cause. Since by removing more and more, it often suddenly works and you know in way more detail where the problem is and you can search in way more detail in Stackoverflow. Saves you time and us ;-). But great it works now – Kukeltje Dec 20 '16 at 09:32

0 Answers0