1 Reply Latest reply on Feb 22, 2017 2:26 AM by christian.beikov

    Conditioanal Width in Extended Data-table

    jmandal2k17

      Hello,

       

      I have a specific requirement in JSF, I want to set the width of extended-datatable dynamically based on clicking an UI-button. That button is called "Toggle Shipment Mode" - the mode can be either Parcel or Non-parcel. When the page loads, default mode is parcel, if the user hits the button and goes to Non-parcel, some of columns get hidden; based on that the width of the table should also get adjusted.

       

      I m sure that I have to use conditional css, I tried the following while setting the page-width

       

      style="height:99.5%;width:{#shipments.freight ? 3465px : 3000px};"

       

      the current code is this - style="height:99.5%;width:3465px;"

       

      But changed code is not working ..

       

      Can anyone suggest me something on this to get rid of this problem ?

        • 1. Re: Conditioanal Width in Extended Data-table
          christian.beikov

          Well it should be

           

          style="height:99.5%;width:#{shipments.freight ? '3465px' : '3000px'};"

           

          EL expressions are surrounded by #{} and you can imagine the content of such an expression to be similar to a java expression. Thus you have to put the texts 3465px and 3000px under single quotes, similar to what you would do in Java with double quotes.