tag:blogger.com,1999:blog-4939023579346660870.post8147745585668419945..comments2017-05-04T13:55:07.648-04:00Comments on The JSFAndADFInjectionMachine: Quick Note about JSF, ADF and PostbacksMichael A. Fonshttp://www.blogger.com/profile/01367312043515001609noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-4939023579346660870.post-78616331179300380022009-07-06T10:34:12.734-04:002009-07-06T10:34:12.734-04:00Sorry, blogger cut off my entry. If you have two ...Sorry, blogger cut off my entry. If you have two inputs, then your url must have both name-value pairs of these two fields in order to register as a postback.<br /><br />If you do not have control of the url (if you are using the ajax tag, for example, then this could be a problem).<br /><br />I would look at your url and see what request url is being produced by either looking at your httpservletrequest (from the external context), or using something like firebug.<br /><br />In JSF 1.2 there was a standardized name for a particular hidden field that always was put into the page by jsf. I wonder if this is still there in jsf 2.0...<br /><br />Maybe this 2.0 ajax tag is not ready for prime time yet? If so there are only about 80,000,000 other ways to do ajax in jsf.Michael A. Fonshttps://www.blogger.com/profile/01367312043515001609noreply@blogger.comtag:blogger.com,1999:blog-4939023579346660870.post-10760363957070843152009-07-06T10:26:30.641-04:002009-07-06T10:26:30.641-04:00Here, I believe, is the secret for getting a postb...Here, I believe, is the secret for getting a postback:<br />with AJAX you can do a GET or a POST and still have it be a postback, but either way there needs to be a name-value pair in the request url to match every html "form" tag (e.g., select, input, textarea, etc) with a "name" attribute. So, for example, if your page rendersMichael A. Fonshttps://www.blogger.com/profile/01367312043515001609noreply@blogger.comtag:blogger.com,1999:blog-4939023579346660870.post-20191728688415649272009-06-30T06:38:29.809-04:002009-06-30T06:38:29.809-04:00Thanks for your reply Michael.
I have a multi for...Thanks for your reply Michael.<br /><br />I have a multi form xhtml page.<br />When I click on a button I want to rerender just a part of the application (Ajax approach).<br /><br />To do that for example I use the JSF 2.0 tag: f:ajax<br /><br />This rerendering happens just at the second click because the first one is not a postback so the 2-5 JSF phase are skipped (I implented a LifeCycleListener that logs the phases).<br /><br />How can I force a postback in the beforePhase method for example?<br /><br />Thanks for the interest,<br />ChristianChristian & Svenjahttps://www.blogger.com/profile/13950448659091518662noreply@blogger.comtag:blogger.com,1999:blog-4939023579346660870.post-18932382832969122972009-06-23T11:25:46.349-04:002009-06-23T11:25:46.349-04:00Christian,
I am sorry to say that I have never de...Christian,<br /><br />I am sorry to say that I have never dealt with JSF 2.0 at all. But I am interested in your problem.<br /><br />Is the problem that you do not want postback behavior on your second click, or that you DO want postback behavior on your FIRST click?<br /><br />If I remember correctly (it was a quick read somewhere on the internet) in order to determine if they had a postback they created a hidden field on their screen, and checked it for a value which they placed there during the initial screen encoding.<br /><br />Implementing a phase listener and detecting one of the other phases that only comes during a postback and setting some kind of flag or request scope boolean variable would probably be better.<br /><br />So please let me know more about your problem. I have been working with JSF 1.1 and 1.2 long enough I may be able to help you.<br /><br />Michael F.Michael A. Fonshttps://www.blogger.com/profile/01367312043515001609noreply@blogger.comtag:blogger.com,1999:blog-4939023579346660870.post-40127143335753989292009-06-23T08:43:11.684-04:002009-06-23T08:43:11.684-04:00You wrote:
"To determine postback you have to...You wrote:<br />"To determine postback you have to do some odd stuff."<br />Which is this odd stuff?<br /><br />I am facing this issue on JSF 2.0. <br />It seems that just my second click on commandButtons or commandLinks is evaluated as a Postback after a rendering from a different form.<br /><br />Any suggestions?Christian & Svenjahttps://www.blogger.com/profile/13950448659091518662noreply@blogger.com