0

Using just JSF, can I do this ? Or do I need to add in more layers and functionality to the program?

This is what I have so far with it:

 <tr:form usesUpload="true">
    <trh:tableLayout width="100%" cellPadding="10" borderWidth="0"
     id="Table">

     <trh:rowLayout>
      <trh:cellFormat columnSpan="4">
       <ocau:inlineMessage />
      </trh:cellFormat>
     </trh:rowLayout>
         
     <tr:panelBox styleClass="roundedPanelPrimary">
       <trh:rowLayout halign="center">
       <trh:cellFormat halign="center">        
        <tr:inputText styleClass="tabdata" contentStyle="normalContent"
         label="Account Number"
         value="#{fraudSearch.fraudCustomerReqtUIModelBean.accountNumber}"
         accessKey="13"
                                >
          </tr:inputText>


       </trh:cellFormat>
       
       <trh:cellFormat halign="left">
        <tr:commandButton text="Search" id="Search"
         action="#{fraudSearch.getIBSNotesData}" styleClass="Button"
         halign="center"
         >
         </tr:commandButton>
       </trh:cellFormat>       
      </trh:rowLayout>      
     </tr:panelBox>

     <tr:panelBox styleClass="roundedPanelPrimary"
      rendered="#{fraudSearch.displaySearchResults}">
      <trh:tableLayout cellPadding="10" borderWidth="0" id="Table"
       width="100%">
       <trh:rowLayout>
        <tr:panelTabbed position="above" inlineStyle="width:auto">

         <tr:showDetailItem text="IBS Data Extract" id="IBSDataExtract"
          immediate="true">
          <ui:include
           src="/pages/recovery/fraud/displayFraudRPAIBSDataExtract.jspx">
          </ui:include>
         </tr:showDetailItem>
         <!--  
         <tr:showDetailItem text="Non-Monetary Data" id="IBSNonMonData"
          immediate="true">
          <ui:include
           src="/pages/recovery/fraud/displayFraudRPANonMonetaryData.jspx">
          </ui:include>
         </tr:showDetailItem>
         -->
        </tr:panelTabbed>
        
        
        
        
       </trh:rowLayout>
      </trh:tableLayout>
     </tr:panelBox>
    </trh:tableLayout>


   </tr:form>​

So far, I have attempted to add the access key to both the text box and the button, but it doesn't appear to work. Any point in the right direction would be appreciated.

MWiesner
  • 8,868
  • 11
  • 36
  • 70
  • 1
    It is unclear what you are asking... If you want to submit a form, when "enter" is pressed, see this answer: https://stackoverflow.com/questions/5485851/default-action-to-execute-when-pressing-enter-in-a-form – dognose Oct 19 '18 at 22:19

1 Answers1

0

Trinidad provides a defaultCommand within it's formtag, with wich you should be able to do, what you want. See here: tr:form

lkdg
  • 1,031
  • 7
  • 18
  • I have tried adding this script to the file ... (function() { var acctNumber = document.getElementById('acctNumber'); acctNumber.addEventListener('keypress', function(event) { if (event.keyCode == 13) { document.getElementById('Search').click(); } }); – Bill Matonte Oct 22 '18 at 21:15