Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:31:51+00:00 2026-06-03T14:31:51+00:00

I have a DataTable where I want to modify the font size. The user

  • 0

I have a DataTable where I want to modify the font size. The user can set the font size with a selectOneMenue component.

Now if I update it with jQuery this only happens the first time. If I want to change the font size by the selectOneMenue the font size is set to default and if I make a refresh (F5) the font size is changed successfully. But I do not want this behaviour.

So I added the reload() function in the script part. If I do this I always get this Firefox Message if I want to reload….. and then it renders the table with default size and shortly after it renders the right font size. So the end product is ok but I do not want this firefox message to appear that has to be submitted and I also want to turn off the prerendering ot the table with the default font size.

Now I have this code

<script>
        jQuery(document)
                .ready(
                        function() {
                            jQuery('#dtSummary')
                                    .css('cssText',
                                            'font-size:#{summaryBean.selectedFont}px !important');

                        });

        function changeFont() {
            document.getElementById("dtSummary").style.fontSize = "#{summaryBean.selectedFont}px !important;}";
            window.location.reload(true);
        }
    </script>


<h:form id="form" prependId="false">
        <h:panelGroup>
            <h:panelGrid columns="3" styleClass="rainstar-form-inline"
                columnClasses="rainstar-form-column-left rainstar-form-column-right">


                <p:selectOneMenu id="targ" effect="fade"
                    styleClass="rainstar-input-small2"
                    value="#{summaryBean.selectedFont}"
                    valueChangeListener="#{summaryBean.selectionFont_change}"
                    onchange="changeFont()">
                    <f:selectItems value="#{summaryBean.fontCollection}" />
                    <p:ajax update="dtSummary" />
                </p:selectOneMenu>
            </h:panelGrid>
            <p:commandButton value="#{msg.button_print}" icon="ui-icon-print"
                styleClass="rainstar-button-right"
                action="#{summaryBean.generatePdf()}" ajax="false" />


            <p:dataTable id="dtSummary" styleClass="rainstar-form-margin-top"
                value="#{summaryBean.eintragList}"
                selection="#{summaryBean.selectedEintrag}" selectionMode="multiple"
                var="eintrag" rowKey="#{eintrag.it1}">

                <p:column id="header" styleClass="ui-state-default">
                    <div class="ui-dt-c">#{eintrag.it1}</div>
                </p:column>

                <p:column styleClass="rainstar-table-item"
                    headerText="#{tableBundleBean.summary_table_nozzles} [mm]">
                    <h:outputText value="#{eintrag.it2}" />
                </p:column>

            </p:dataTable>

        </h:panelGroup>


    </h:form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:31:54+00:00Added an answer on June 3, 2026 at 2:31 pm

    You don’t really need jquery here. Try:

    <p:column styleClass="rainstar-table-item"
              headerText="#{tableBundleBean.summary_table_nozzles} [mm]">
       <h:outputText value="#{eintrag.it2}" style="font-size:#{summaryBean.selectedFont}px !important"/>
    </p:column>
    

    Jquery would make sense if you wanted to avoid server roundtrip and rendering for performance reasons for example. In such case the selectMenu widget should not cause a page refresh.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable X, if I now want to search for a certain
I have a on memory Datatable like this. I want to produce xml file
I have a question regarding primefaces datatable component. I want to bind a DataTable
I have a datatable and I want to filter this table with a company
I have big DataTable I want to get subset of this DataTable represented as
I have a datatable and I want to create a text file using this
I have a DataTable that will be modified by the user. I want to
I have a dataTable that lists some objects and I want to set a
If I have a DataTable and want to create a new row I first
I have a DataTable which I want to save to a SQLite Database Table.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.