aspose file tools*
The moose likes JSF and the fly likes Specifying multiple targets for hx:behaviour does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Specifying multiple targets for hx:behaviour does not work" Watch "Specifying multiple targets for hx:behaviour does not work" New topic
Author

Specifying multiple targets for hx:behaviour does not work

Veera Velisetti
Greenhorn

Joined: Jan 27, 2010
Posts: 5
Hi there,

I have two panelGroups in my page as shown below and a command button. On click of the button, I am trying to update both the panels. Which is not happening now.
If I give only one panel in the TargetAction of behaviour, it works fine but not with both the panel ids.
Can any one let me know why if there is anything obvious I am missing?
Thank you.




- Veera
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

You;ll have to RTFM, I'm afraid. I don't know anything about that tagset.

Most likely you're using the wrong separator character between target names on your targetAction attribute, but since there's not only no standard for stuff like that, but cases I've seen where the standard varies depending on what you're working with....

All you can do is read the vendor's documentation.


Customer surveys are for companies who didn't pay proper attention to begin with.
Veera Velisetti
Greenhorn

Joined: Jan 27, 2010
Posts: 5
Hi Tim,

What does RTFM mean?
I am using IBM provided tagset for JSF. I am developing using RAD 7.5.4 , application running on IBM WebSphere Portal 6.1.2.

About the seperator, I have tried using comma, semi colon and space. None of them work.

If you have any pointers please suggest.

Thank you.

- Veera
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

RTFM is geek speak for Read The Fine Manual - or sometimes a less polite variation, but this is the JavaRanch.

Your use of IDE or appserver doesn't have any significance for this problem. The only thing that matters is that you use the hx tagset properly. And for that, you really will have to read the vendor docs, since I've never used it and don't know anything about it. So the only way I could answer would be if I RTFM'd.
Veera Velisetti
Greenhorn

Joined: Jan 27, 2010
Posts: 5
Hi

I got this working now. The following is the piece of code that works. The changes I did are highlighted in bold.

<h:panelGroup styleClass="panelGroup" id="summaryGroup">
<h:selectOneListbox styleClass="selectOneListbox" id="listSummaryAddresses">
<f:selectItems value="#{pc_AdContentCaptureView.addressList}"/>
</h:selectOneListbox>
</h:panelGroup>
<hx:ajaxRefreshRequest target="summaryGroup" id="ajaxRefreshRequest1"></hx:ajaxRefreshRequest>

<h:panelGroup styleClass="panelGroup" id="addressGroup">
<h:selectOneRadio disabledClass="selectOneRadio_Disabled"
enabledClass="selectOneRadio_Enabled" styleClass="selectOneRadio"
id="radioAddressList" value="#{pc_AdContentCaptureView.selectedAddress}" layout="pageDirection">
<f:selectItems value="#{pc_AdContentCaptureView.addressList}" />
</h:selectOneRadio>
<hx:ajaxRefreshSubmit target="addressGroup" id="ajaxRefreshSubmit1"></hx:ajaxRefreshSubmit>

<h:commandButton id="addNewAddr" type="button" action="#{pc_AdContentCaptureView.doButton2Action}" value="New">

<hx:behavior event="onclick" id="behavior2" behaviorAction="get;get"
targetAction="addressGroup;summaryGroup"></hx:behavior>
</h:commandButton>


If we are mentioning more than one targetAction's then we should mention the same numbr of behaviourActions. And also, only the first targetAction needs to be sumbitted to refresh the panel addressGroup, the other just needs to be refreshed to update the summaryGroup panel so the change of ajax request from submit to refresh.
Hope this helps to somebody over there.

- Veera

Dan Shirley
Greenhorn

Joined: Apr 07, 2010
Posts: 1
Thanks Veera,

Your solution is correct, works for me. Thanks for saving me an hour tryting to find the relevant documentation!
 
 
subject: Specifying multiple targets for hx:behaviour does not work