Thanks for the ideas guys. This is working for me.
On the subcomponent: I turned off automatic binding synchronization
otherwise WO complains with unknown key.
<wo:form multipleSubmit = "$true" onsubmit = "performFilterAction(); return
false;">
<table cellpadding = "4" cellspacing = "0" class = "$tableClass">
<tr>
<td class = "bodyText">Filter by</td>
<td class = "bodyText">
<wo:WOPopUpButton list = "$filters"
item = "$filterItem"
selection = ^selectedFilter />
</td>
<td class = "bodyText">
<wo:WOPopUpButton list = "$conditions"
item = "$conditionItem"
selection = ^selectedCondition />
</td>
<td class = "bodyText">
<wo:WOTextField value = ^keyword class = "text" />
</td>
<td>
<wo:AjaxSubmitButton updateContainerID = ^updateContainerID
action = ^filterAction functionName = "performFilterAction" />
<wo:AjaxSubmitButton updateContainerID = ^updateContainerID
action = ^filterAction value = "Go" button = false />
</td>
</tr>
</table>
</wo:form>
Then on the parent component, I just needed to set the bindings to the
selectedFilter, selectedCondition, keyword and filterAction.
Amiel
On Tue, Mar 3, 2009 at 4:09 AM, Chuck Hill <chil..lobal-village.net> wrote:
> Hi Amiel,
>
> Check my sig for a book that you really want to own. All of this is
> explained with examples.
>
>
> On Mar 2, 2009, at 2:04 AM, amiel montecillo wrote:
>
> Hello All,
>>
>> I am trying to create a reusable text filter component. It has 2
>> WOPopupButtons and a WOTextField contained in a WOForm to filter a grid
>> listing.
>>
>> How do I make it such that the parent component will get the values
>> selected on the 3 fields when the filter form is submitted?
>>
>
> If you have not disabled automatic binding synchronization, it will "just
> work". You don't need to do anything.
>
>
> On top of that, I also need to create an action binding on my subcomponent
>> so that I can bind that action on the parent and filter the results. Any
>> articles/posts explaining how to accomplish this?
>>
>
>
> There are two ways. One, make it a string. e.g. action =
> "parentMethodName" and use the WOComponent method
> public WOActionResults performParentAction(String anActionName)
>
> The other is to disable automatic binding synchronization and then just use
> action = parentMethodName and valueForBinding("action")
>
> Chuck
>
> --
> Chuck Hill Senior Consultant / VP Development
>
> Practical WebObjects - for developers who want to increase their overall
> knowledge of WebObjects or who are trying to solve specific problems.
> http://www.global-village.net/products/practical_webobjects
>
>
>
>
>
>
>
-- socket error: unable to connect to 127.0.0.1
This archive was generated by hypermail 2.0.0 : Mon Mar 02 2009 - 19:09:06 EST