would you recommend immediate="true" for all link?
I recommend using immediate="true" for any button/link which operates
independently of all of the other input fields on the form.
this behavior is more than questionable, because why doing a costly state save
just for simple navigation?
Because these components are stateful components. If you render a
data table to the page (generate the html to display it), then you
need to have the data in that data table available again when you
process the form values submitted from the first request. Let's take
the example of the "rendered" attribute. If you have a rendered state
of true when you generate the html, then you must also have a rendered
state of true if you process the form submission. If you have
rendered state of false when you generate html for an input component,
then you must have a state of false when you process the form
submission.
The real problem is that j2ee request scope is inadequate, and session
scope is overkill. Request scope only last from when form values are
processed to when the html is generated. That's backwards for
component-based frameworks. So you need to use t:saveState to change
the scope to page "plus" scope (ie, the values persist until you're
done with the page -- the plus comes in because you can also use
t:saveState to transition a value to a new page as well).
On 9/16/06, Patrick Dreyer <[EMAIL PROTECTED]> wrote:
Yes, subscriptionCategoryBean is request-scoped.
I see were you wanna go to Mike and I will try it - as a workaround.
Beside this, would you recommend immediate="true" for all link, as no
validation etc. has to be done?
Thanks for the hint Mike. The answer if it worked or not comes on Monday.
In my eyes this behavior is more than questionable, because why doing a costly
state save just for simple navigation?
The h:commandLink includes already all necessary information for fulfilling the
transition, at least this is what the correct behavior of the "Test" link tells
me.
I already read tones of pages about JSF and it's inside mystics. I got a more
or less overview of the why's and who's about the various phases, events, etco
on, but this particular problem still let's me in the dark.
Can any one light me up?
Do the spec force the state to be saved or is it a bug?
Mike Kienenberger schrieb:
> Is #{subscriptionCategoryBean.subscriptions} request-scoped? If so,
> try using t:saveState to persist it across a page, or change it to
> session-scoped, or use some other persisting mechanism.
>
>
> On 9/15/06, Patrick Dreyer <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I don't like the prosa form and so:
>> * Tomcat 5.5.17
>> * MyFaces 1.1.3
>> * Tomahawk 1.1.3
>> * Page with two dataList; subscriptionCategories and subscriptions
>> * Links of subscriptionCategories work fine
>> * Links of subscriptions don't work at all; action doesn't get called
>> * Using dataTable for subscriptions doesn't work either
>> * Put each list in a separate form doesn't work either
>> * "Test" link (between the two lists) works as expected; action gets
>> called, navigation to other page
>> * Static values in "Test" link and subscriptions only for testing
>> purposes
>>
>> Any ideas? Thanks
>>
>> Patrick
>>
>> Page snippet:
>> <body>
>> <h:messages />
>> <form jsfc="h:form">
>> <ul id="subscriptionCategories"
>> jsfc="t:dataList"
>> layout="unorderedList"
>> value="#{portalBean.subscriptionCategories}"
>> var="subscriptionCategory">
>> <li jsfc="h:commandLink"
>> action="#{subscriptionCategoryBean.select}">
>> <f:param name="id"
>> value="#{subscriptionCategory.id}" />
>> #{subscriptionCategory.name}
>> </li>
>> </ul>
>> <p>
>> <a jsfc="h:commandLink" action="#{subscriptionBean.select}">
>> <f:param name="id" value="1" />
>> Test
>> </a>
>> </p>
>> <ul id="subscriptions"
>> jsfc="t:dataList"
>> layout="unorderedList"
>> value="#{subscriptionCategoryBean.subscriptions}"
>> var="subscription">
>> <li jsfc="h:commandLink"
>> action="#{subscriptionBean.select}">
>> <f:param name="id" value="1" />
>> #{subscription.title}
>> </li>
>> </ul>
>> </form>
>> </body>
>>
>>
>