0

I have the following JSF page which when it loads first loads with proper CSS styles (some are applied through JQuery and some through CSS classes) But after I click submit button the CSS styles do no get applied and neither the JQuery is called. Below is my code

<link rel="stylesheet" href="../css/uniform.default.css" media="screen" />
<link type="text/css" href="../css/jquery-ui-1.8.11.custom.css" rel="stylesheet" />
<link rel="stylesheet" href="../css/jquery-ui.css"/>
<link rel="stylesheet" href="../css/style.css"/> 
<script src="../js/jquery-1.11.3.js"></script>
<script src="../js/jquery-ui.js"></script> 
<script src="../js/jquery.uniform.js"></script>
<style type="text/css">
div{
margin-bottom: 9px;
}
.login{width:600px;} 
 table.people th {
 background-color: #2237CA;
 color: white;
 }  


</style>
 <script type="text/javascript">           
 $(document).ready(function () {          
      var max = 0;
      $("label").each(function(){
            if ($(this).width() > max)
                max = $(this).width();    
        });
        $("label").width(max);
        $('label').css('display', 'inline-block');   
    }   
 });
</script>
</h:head>
<h:body>
 <section class="container">
  <div class="login">
     <div id="container">

  <h:form id="searchForm" e>
  <div> 
   <h:panelGroup >

  <div><label for="a">Experience (in years)*  From: </label>
 <h:inputText styleClass="resize" value="#{dataEntryBean.from}"     style="width:30px;" id="a">    <f:convertNumber pattern="#,###,##0.0"/>
 </h:inputText> 
 To <h:inputText styleClass="resize" value="#{dataEntryBean.to}" style="width:30px;"  id="b">    <f:convertNumber pattern="#,###,##0.0"/>
 </h:inputText></div>

 <h:dataTable value="#{dataEntryBean.temp}" var="result" width="100%;"  rendered="#{fn:length(dataEntryBean.temp)>0}"
  styleClass="people"
   cellspacing="0" 
   cellpadding="0" 
   border="0" 
   rowClasses="odd,even" columnClasses="name,phoneNumber,dateOfBirth,name">

<h:column>
  <f:facet name="header">CV Link</f:facet>
  #{result.fileLoc}
 </h:column>
</h:dataTable>
 <h:commandButton value="Search" 
 action="#{dataEntryBean.getResults}"></h:commandButton> 

 </h:form>
 </div>
 </div>
 </section>
 </h:body>

Should I add anything to the commandButton so that the CSS styles are reapplied?

user2017810
  • 235
  • 1
  • 2
  • 17
  • @BalusC: How should I accept an answer? The solution mentioned there solves my problem. – user2017810 Aug 28 '15 at 11:21
  • 1
    The Stack Exchange Q&A engine hasn't anything like an accept mark on the duplicate question banner, so an upvote is really the best you can do. If you really feel to, you can always put a bounty for the answer once you have sufficient reputation, or even do a donation on the account of the answerer. Or, better, just ask a question which isn't asked before :) – BalusC Aug 28 '15 at 11:31

0 Answers0