Actually, I tried that and was able to get that working to some extent, but I
actually managed to get it finally to work using AjaxObserveField. Previously
it didn't work when I tabbed out, and now it does. In the first case I had an
AjaxObserveField wrapping all of the textfields, but it did work when I wrapped
each individual field in an AjaxObserveField. Combined with the
AjaxUpdateLink, it worked.
So I ended up with this:
<wo:AjaxUpdateLink action = "$updatePreferredPhoneList"
functionName="updatePreferredPhoneList"
updateContainerID="preferredPhonePopUpContainer" />
<tr>
<td class="dataLabel">* Home Phone</td>
<td class="dataInput"><wo:AjaxObserveField
updateContainerID = "preferredPhonePopUpContainer" fullSubmit="$false"
action="$updatePreferredPhoneList"><wo:WOTextField
value="$homePhone"/></wo:AjaxObserveField></td>
</tr>
<tr>
<td class="dataLabel">Work Phone</td>
<td class="dataInput"><wo:AjaxObserveField
updateContainerID = "preferredPhonePopUpContainer" fullSubmit="$false"
action="$updatePreferredPhoneList"><wo:WOTextField
value="$workPhone"/></wo:AjaxObserveField></td>
</tr>
<tr>
<td class="dataLabel">Mobile Phone</td>
<td class="dataInput"><wo:AjaxObserveField
updateContainerID = "preferredPhonePopUpContainer" fullSubmit="$false"
action="$updatePreferredPhoneList"><wo:WOTextField
value="$cellPhone"/></wo:AjaxObserveField></td>
</tr>
<tr>
<td class="dataLabel">Preferred Phone</td>
<td class="dataInput">
<wo:AjaxUpdateContainer
id="preferredPhonePopUpContainer">
<wo:WOPopUpButton selection =
"$selectedPreferredPhone" list = "$preferredPhoneList" item =
"$preferredPhoneItem" id="preferredPhonePopupID" />
</wo:AjaxUpdateContainer>
</td>
</tr>
Andrew
On Feb 26, 2010, at 5:50 PM, Travis Britt wrote:
> In general you can always define an AjaxUpdateLink with an action binding and
> a functionName and then assign that JS function to any handler as if it where
> any other JS function (b/c it is) which will then fire the bound method in
> your app and update whatever container you need.
>
> tb
>
> On Feb 26, 2010, at 3:03 PM, Andrew R. Kinnie wrote:
>
>> Greetings all,
>>
>> OK, I have generally been successfully able to avoid using javascript
>> directly because of the wonders of WO and . . . um . . . Wonder. However,
>> now I have an issue that seems to scream out for an obvious answer.
>>
>> I have a WOPopUpButton for the user to select a preferred phone number among
>> "Home," "Work" and "Mobile" which will be saved in the db as a number (1, 2
>> or 3). I want to have this popup dynamically generated based on whether the
>> appropriate phone number fields in the UI have values other than and empty
>> string.
>>
>> So this all works using an AjaxObserveField surrounding the phone number
>> fields in the UI . . . as long as the user presses enter or return when done
>> editing the phone number field. I would like it also to work when the user
>> tabs out of the field to another field.
>>
>> I could use javascript to manage such a list directly in javascript, because
>> I just found such a thing via google. This has the benefit of avoiding
>> going back to the server. However, I DO need the selection from the popup
>> to be sent back to the WO app when the AjaxSubmitButton's action is called.
>> I am quite the javascript novice (obviously). I was trying to think of ways
>> to use onblur or something but I can't seem to get it called by the WO app.
>> It occurred to me that this sort of thing seems common enough that there may
>> be a best practice for doing this sort of thing, and possibly a fabulous
>> Wonder mechanism I haven't seen.
>>
>> Any suggestions? Best practices?
>>
>> Andrew
>>
>> WO 5.4.3, Wonder 10685
>> Eclipse/Wolips 3.5
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/tbritt%40phigment.org
>>
>> This email sent to [email protected]
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]