Ok, i'm starting to see some light now. Are you using a custom converter to
create a thing object from an "integer id" or something like that?
Using your approach, you should code the select with name "thing.id" and the
new object with names "thing.x" and "thing.y". Did another quick test and
again is working ok for me. I'm using this code:
<s:form beanclass="test.PersistDepartmentAction">
<label for="group">Existing</label> <input type="radio" name="group"
id="group1" onchange="disableGroup2()" />
<label for="department.id">Select</label> <s:select name="department.id"
id="group1select">
<option value="1">Object 1</option><option value="2">Object
2</option>
</s:select><br />
<label for="group">New</label> <input type="radio" name="group" id="group2"
onchange="disableGroup1()" />
<label for="department.name">Fill</label> <s:text name="department.name"
id="group2text"/><br />
<s:submit name="saveNewDepartment">Save</s:submit>
</s:form>
<script type="text/javascript">
function disableGroup1() {
document.getElementById("group1select").disabled =
'disabled';
document.getElementById("group2text").disabled = '';
}
function disableGroup2() {
document.getElementById("group2text").disabled = 'disabled';
document.getElementById("group1select").disabled = '';
}
</script>
-----Mensaje original-----
De: Mike McNally [mailto:[email protected]]
Enviado el: sábado, 17 de enero de 2009 17:36
Para: Stripes Users List
Asunto: Re: [Stripes-users] Problem with
DefaultActionBeanPropertyBinderandObject value
On Fri, Jan 16, 2009 at 4:30 AM, Héctor López <[email protected]>
wrote:
> I've just done a quick and dirty test, and i'm unable to reproduce it as
you
> are describing. It would be helpful to see some of your code...
Change your test so that the "thing" form field is an stripes:select tag.
This is a common scenario: I've got a "Create" dialog, and as part of
creating something I need to assign a property, which will be a
relation to some other entity. Now it may be that during this create
operation the related entity will be a new one - therefore, a radio
button will be set to "New", and "thing.x" and "thing.y" fields will
be enabled so that the properties of the new related entity can be
provided. However, if it's not a new one, then the radio button will
be set to "Known", "thing.x" and "thing.y" will be disabled, and a
stripes:select field will be enabled to allow an existing "thing" to
be selected.
The action bean will have a "thing" property, which in either case
should be set to an instance of "Thing", the related entity. It'll
either be a new one, the case when the form provides "thing.x" and
"thing.y" but not "thing", or it'll be an existing one loaded by
Stripersist (or whatever), which happens when the form provides the
"thing" id from the select field.
I'll log a bug.
--
Turtle, turtle, on the ground,
Pink and shiny, turn around.
----------------------------------------------------------------------------
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users