-
1. Re: Prevent binding of attributes during update phase
norman.richards Jul 7, 2007 3:44 PM (in response to mreuvers)How do you propose the user spoof submit data for a component that isn't an input component?
-
2. Re: Prevent binding of attributes during update phase
mreuvers Jul 8, 2007 4:42 AM (in response to mreuvers)Hi Norman,
The most simple example is where users track which entity they are editing, by using a hidden field containing the id (I've seen it a lot in this forum too).
A little javascript on the onSubmit() on the form would be enough then: e.g:
document.getElementById('formName:id').value='-100' for instance. If the id does not exist it usually becomes an insert, if it exists it becomes an edit of a different entity. Of course depending on the handling code.
But your answer already implied enough, just use a conversation scope and you are safe (no need for the id then). In any other technique (non-jsf) there was the problem I described, and there were solutions for it (e.g. spring had its binding.setAllowedFields(), adf defines which properties can be updated in its bindings xml etc.). So I automatically searched for a solution for a problem that wasn't there. =)
Martijn -
3. Re: Prevent binding of attributes during update phase
gavin.king Jul 8, 2007 6:36 AM (in response to mreuvers)I think its better to use a PAGE-scoped context variable for that, or even a Seam page parameter.
-
4. Re: Prevent binding of attributes during update phase
gavin.king Jul 8, 2007 6:38 AM (in response to mreuvers)Well, actually, CONVERSATION scope is also a good solution. Depends what you want.
I wouldn't go futzing with javascript for this. -
5. Re: Prevent binding of attributes during update phase
mreuvers Jul 8, 2007 11:01 AM (in response to mreuvers)Hi Gavin,
Thanks for your reply as well. I will have a look to what you suggested too.
Yeah, I never meant to use JS - just as a simple example of how to spoof something. :)
Martijn