jsf-2

JSF 2 ui:repeat vs h:datatable behavior

荒凉一梦 提交于 2020-01-06 01:34:44
问题 I had a bad time trying to solve p:selectBooleanButton doesn't render preselected value, a lot of hours just to fix it changing ui:repeat to h:datatable. Here is both pieces of code. <ui:repeat value="#{presupuestoBean.getItemsPresupuestBySeccion('Parte Delantera')}" var="itemPresupuesto"> <tr> <td><h:outputText value="#{itemPresupuesto.descripcion}"/></td> <td> <p:selectBooleanButton value="#{presupuestoBean.itemsPresupuestoAsignadoCambiar[itemPresupuesto.id]}" onLabel="Yes" offLabel="No"

Difference between jsf actionListener(param) and propertyListener when using back button on keyboard

半世苍凉 提交于 2020-01-05 20:21:46
问题 I encountered a problem that I fixed but I can't understand why the fix works and the original code doesn't work. It's the easiest to explain it with code: I've got the following method in my entityBackingBean (entityBB): public void standardLetterInit(Letter entity) { setEntity(entity); } And the following in my xhtml page: <h:commandLink actionListener="#{entityBB.standardLetterInit(varEntity)}"/> This commandLink is situated in a datatable that contains varEntity as var. The above code

Difference between jsf actionListener(param) and propertyListener when using back button on keyboard

早过忘川 提交于 2020-01-05 20:21:42
问题 I encountered a problem that I fixed but I can't understand why the fix works and the original code doesn't work. It's the easiest to explain it with code: I've got the following method in my entityBackingBean (entityBB): public void standardLetterInit(Letter entity) { setEntity(entity); } And the following in my xhtml page: <h:commandLink actionListener="#{entityBB.standardLetterInit(varEntity)}"/> This commandLink is situated in a datatable that contains varEntity as var. The above code

JSF 2.0 partial rendering on page on document load

余生颓废 提交于 2020-01-05 15:06:15
问题 I have a page, one section of which I want to load only after the whole page is loaded. For this, I'm using the following code on the page: <script type="text/javascript"> alert("In the JS"); $(document).ready( function() { $.post(jspPath+'/myCommunity/ajax/hotTopicDiscussion.faces', function(data) { jsf.ajax.request(this, 'post', {render: 'discussionTopic'}); } ); } ); </script> also <h:panelGroup id="discussionTopic" reRendered="#{discussionBean.doRender}"> This doRender is a bean property

How to do multiple selection in jsf or primefaces dataTable?

做~自己de王妃 提交于 2020-01-05 11:48:29
问题 I want to try out building a simple grid that has a delete column, consisting of checkboxes, just like the usual one in email. User can then tick the checkboxes, and press delete, and i can get all the checked records, and delete them one by one. Im trying to find a way to achieve this, but so far im still in doubt. These are what i have in mind, each with it's own implementation question, haha : How to get the checked row indexes ? Using actionlistener for each toggle on each checkbox ? (but

How to do multiple selection in jsf or primefaces dataTable?

南楼画角 提交于 2020-01-05 11:43:25
问题 I want to try out building a simple grid that has a delete column, consisting of checkboxes, just like the usual one in email. User can then tick the checkboxes, and press delete, and i can get all the checked records, and delete them one by one. Im trying to find a way to achieve this, but so far im still in doubt. These are what i have in mind, each with it's own implementation question, haha : How to get the checked row indexes ? Using actionlistener for each toggle on each checkbox ? (but

Should I use dataTable or panelGrid? JSF

﹥>﹥吖頭↗ 提交于 2020-01-05 11:02:24
问题 <table id="tbl" cellpadding="5" cellspacing="0" border="0" class="display" style="padding-top: 10px;width:100%"> <thead> <tr> <th width="20%">Emp No</th> <th width="15%">title</th> <th width="20%">Name</th> <th width="10%">shift</th> </tr> </thead> <tfoot> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> </tfoot> <tbody style="cursor:pointer;"> Yeh aik arzi tehreer hai </tbody> </table> When I started to convert this code for my JSF app I found that I can use either <h

How to invoke a method with Openfaces/JSF without rendering page?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-05 09:28:51
问题 I am trying to invoke a Save method in a bean with Openfaces 3. While Firefox is not rendering the page, Internet Explorer does. I'm currently using this code lines: <o:commandLink value="Save" action="#{beanX.save}"> <h:graphicImage url="/images/save_48.png" /> </o:commandLink> but I was trying o:ajax as well: <o:commandLink value="Save" action="#{beanX.save}"> <h:graphicImage url="/images/save_48.png" /> <o:ajax event="click" render="@none" /> </o:commandLink> Any ideas? I've found a way to

How to invoke a method with Openfaces/JSF without rendering page?

≯℡__Kan透↙ 提交于 2020-01-05 09:28:07
问题 I am trying to invoke a Save method in a bean with Openfaces 3. While Firefox is not rendering the page, Internet Explorer does. I'm currently using this code lines: <o:commandLink value="Save" action="#{beanX.save}"> <h:graphicImage url="/images/save_48.png" /> </o:commandLink> but I was trying o:ajax as well: <o:commandLink value="Save" action="#{beanX.save}"> <h:graphicImage url="/images/save_48.png" /> <o:ajax event="click" render="@none" /> </o:commandLink> Any ideas? I've found a way to

How can I check if an object stored with @WindowScoped is stored correctly?

╄→尐↘猪︶ㄣ 提交于 2020-01-05 07:44:32
问题 Two days ago I wrote this question: How can I retrieve an object on @WindowScoped? and BalusC answered with some suggestions, now I have some problem to understand if my problem is that the object in WindowScoped is stored properly or my code to retrieve it is wrong! Well, as I said, I have an object that I stored in @WindowScoped annotation but I can retrive this object only the first time! Why? I just have a doubt: the CODI extension of MyFaces could be configured in some manner? Or I can