You need to sign in to do that
Don't have an account?
jojoforce
AJAX Multiple actionStatus calling two different apex:actionStatus
Is it possible for 1 action call two seperate action status?
for example,
<apex:commandButton id="btnID" status="status1,status2" action="{!someAction}" value="Click Me"/> <apex:actionStatus id="status1"> ..... </apex:actionStatus> <apex:actionStatus id="status2"> ....... </apex:actionStatus>
I see. I tend to use one of two mechanisms (or a combinaton of both) when I need this:
(1) Grey out the rest of the page and popup a 'working' dialog or similar
(2) Use Jquery to locate and disable all input fields on the page
All Answers
Doesn't look like it - when I try it, although there are no errors on the markup or reported by the browser, neither of the actionstatus components changes to reflect the request. When I change it to a single status, it works fine.
The docs say that the status attribute takes an ID rather than one or more IDs.
Thanks bob buzzard...
The only way I could tihnk of making it work is to potentially have an actionSupport to call that status as well... but the problem might be a timing issue since status1 and status2 might potentially not finish the same time.
I think you'll get a race condition with your postbacks as well. I've seen odd behaviour with this sort of thing in the past, where the second request seems to take out the first one.
Is there a particular reason you are looking to do this? You could change your actionstatus and provide javascript methods for onstart/onstop that redraw the dom elements you want to update.
Yeah that is a really good point.
The reason why I wanted to do this is because I have a VisualForce page in which I have a button wrapped in a actionStatus "stop" and the column headers of a PageBlock Data Table are facet outputLink (because when users click the column header it toggles a sort).
The skeleton is something like this:
By doing so, as users make changes to the inputText value, they cannot perform any button action or column header outputlink action until the {!saveChanges} completed.
I see. I tend to use one of two mechanisms (or a combinaton of both) when I need this:
(1) Grey out the rest of the page and popup a 'working' dialog or similar
(2) Use Jquery to locate and disable all input fields on the page
I tried the 1st approach graying out the whole screen, unfortunately it didnt work well for a user since the data table may have multiple records/editable columns and waiting every time they make updates was a little too much.
I ended up with somewhat of the 2nd approach, although not using JQuery tho. I put the toolbar and each of the links into two <apex:outputPanel > one for enabled and the other for disabled. I gave them an ID "disableSpanOnChangeXXXX" and the disabled having style of "display:none".
And then I call a javascript on each of the <apex:inputText onchange="disableToolbar" /> by switching the output panels display style property.
Is there any anvantages of using JQuery as opposed to the JavaScript approached that I took?
The reason I use jquery is that its very fast at identifying all of the input fields - much faster than javascript that I've written in the past - and saves me worrying about browser incompatibilities.
I am having similar problem!
I wanted to accomodate two button or combination of link and button.
One is "request for access" and other one is link to records.
the business requirement is if the user already have access permission, then he can see the link to page instead of request option.
Im not sure I understand what you are asking...
If its the same problem as the one I described in the original note then the Accepted Solution as laid out by awesome Bob Buzzard should help you out. Best of luck! :D