commandbutton

commandButton inactive after ajax rendering

╄→гoц情女王★ 提交于 2019-12-20 03:20:12
问题 I have a problem with these two commandButton : Join and Leave. I want to hide Join if I click on leave and vice-versa. When I put ajax on false, there is no problem (but all the page is refresh and I don't find this optimal). But when ajax attribut is on true with specific updating (cf comment in the code), the rendering is good but the new button whitch appear become inactive. If I click on it, nothing happens (well it's seems the actionListener trigger but the view is not refreshed, I have

h:commandButton is not working once I wrap it in a <h:panelGroup rendered>

坚强是说给别人听的谎言 提交于 2019-12-17 20:26:36
问题 The reason why the topic has "kind of" is because I have an example in JSF 2.2 where I use a commandButton and call a bean function twice (depending on the url). It's basically the same code, which executes only in one example. Here's the code with the description of the "error" below the code: User bean @ManagedBean @RequestScoped public class User { private String name; private String surname; private int age; private int id; public String getName() { return name; } public void setName

Render multiple components with f:ajax

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 10:58:41
问题 The wrong codes are: <h:form id="search_form"> <h:commandButton class="button" value="View" action="#{InfoBean.search}"> <f:ajax execute="search_form" render="linear1"></f:ajax> <f:ajax execute="search_form" render="linear2"></f:ajax> </h:commandButton> <p:lineChart id="linear1" value="#{InfoBean.linearModel1}" legendPosition="e"/> <p:lineChart id="linear2" value="#{InfoBean.linearModel2}" legendPosition="e"/> </h:form> What I want to do is when I click on the commandButton , I want to

Open new window by POST using h:commandButton

馋奶兔 提交于 2019-12-17 07:33:17
问题 I need to open a JSF page in a new window by POST on click of a <h:commandButton> . I know I can acheive this using the JavaScript. But I would like to achive this using JSF and not JavaScript. How can I achieve this? I'm using JSF 2.0. 回答1: The only non-JS way is to set target="_blank" in the parent <h:form> . <h:form target="_blank"> ... <h:commandButton value="Open in new Window" /> </h:form> This however affects all non-ajax(!) actions which are performed in the very same form. So if you

How make commandButton not fully refresh page? How to use f:ajax?

血红的双手。 提交于 2019-12-17 02:51:23
问题 I have to stream a webcam video, so I use ustream to do that, which generate a flash embed code for me, and I have a button to turn off/on the light, but when I press the button it refresh the whole page and so the flash component. There's some way to not refresh the page and still send to command ? Well for now it's this way: <h:form id="form_supervisory"> <h:panelGrid> <h:column> <iframe width="480" height="296" src="http://www.ustream.tv/embed/9599890" scrolling="no" frameborder="0" style=

How to let validation depend on the pressed button?

試著忘記壹切 提交于 2019-12-16 22:09:35
问题 I have created form and I want to show previous existing items on a table while a new one is creating. I'd like to show matching items as form is filling up. But when I try to filter the list without having the form completed, the validation messages appear and the table doesn't get updated. Don't know if it's possible, but what I want to do something like this: <h:form id="form"> <h:outputText value="Name: "/> <p:inputText value="#{itemsBean.name}" id="name" required="true"/> <br/> <h

Actions for multiple similar dynamically created command buttons

爱⌒轻易说出口 提交于 2019-12-14 03:59:32
问题 I am writing a program in Excel VBA that will basically start with one textbox and one command button, and the command button will create a new textbox and command button underneath it, and that command button will in turn create a new textbox and command button, and so on. Hope you followed that mess. I can create the initial button no problem (it has to be dynamically created so it has the opportunity to be deleted later). My problem is then with creating the click() event handler. I need

Assign 'value expression' in place of 'method expression' in JSF

孤街醉人 提交于 2019-12-14 03:50:36
问题 In my composite component, I iterate a list<list<javaDetailClass>> . I get all my <h:commandButon> attribute's values through value expression like #{iterator.value} . But the problem comes with attribute action , where action accepts only method expression . whereas I can assign only value expression there, resulting in MethodNotFoundException <cc:interface> <cc:attribute name="formElements" /> </cc:interface> <cc:implementation> <c:forEach items="#{cc.attrs.formElements}" var="element"> <c

Action of <h:commandButton> not getting invoked when “disabled=true” is set

a 夏天 提交于 2019-12-14 03:17:57
问题 I want the Submit button to be enabled when the T&C checkbox is checked. Though my written logic is working alright the action of h:commandButton is not getting invoked even after it is enabled after checking the checkbox. Initially the button is disabled. The code works fine if I remove the disabled="TRUE" attribute but it doesn't serve the purpose. Here is my code : <script type="text/javascript"> $(document).ready(start); function start() { $('.testing').click( function() { if ($(document

JSF HtmlCommandButton programmatically - Bean method not called if ajax turned off

流过昼夜 提交于 2019-12-13 17:42:56
问题 I'm trying to create an HtmlCommandButton programmatically, following the example here http://javaevangelist.blogspot.ch/2013/01/jsf-21-tip-of-day-programmatically.html Everything works fine (i.e., the actionListener is called) if I add the ajax behavior, it doesn't work if ajax is turned off. Backing bean: @Named @RequestScoped public class CommandBean implements Serializable { public String generateUUID() { return java.util.UUID.randomUUID().toString(); } } Solution 1 (with ajax) private