Skip to content

Update to support actionSupport with event=onchange#8

Open
thvd wants to merge 1 commit into
SalesforceFoundation:masterfrom
thvd:patch-1
Open

Update to support actionSupport with event=onchange#8
thvd wants to merge 1 commit into
SalesforceFoundation:masterfrom
thvd:patch-1

Conversation

@thvd
Copy link
Copy Markdown

@thvd thvd commented Sep 10, 2014

@thvd thvd closed this Sep 10, 2014
@thvd
Copy link
Copy Markdown
Author

thvd commented Sep 10, 2014

Sorry, this is not going to work. We should think about some other solution.

@groundwired
Copy link
Copy Markdown
Contributor

Why didn't it work?

@thvd
Copy link
Copy Markdown
Author

thvd commented Sep 10, 2014

I tried the following:

<c:Typeahead searchBoxId="templateSearch" object="Template__c" destinationForSelectedId="templateId" destinationForSelectedValue="templateName" />
<apex:inputHidden id="templateId" value="{!templateId}">
    <apex:actionSupport event="onchange" action="{!fetchTemplate}" rerender="linkPanel"/>
</apex:inputHidden>

But when I added the .change() call to the JavaScript it did not trigger the fetchTemplate actionSupport action.

@groundwired
Copy link
Copy Markdown
Contributor

The top item on my list of possible improvements is to add an optional parameter to the component called onSelection or selectionAction or something like that. I had thought that would be a javascript function (which could in turn call an actionFunction to run apex) but it could possibly be an apex method. I think this would accomplish what you want.

Afraid I don't have time to take it on right now, but will keep it in the backlog.

@thvd
Copy link
Copy Markdown
Author

thvd commented Sep 11, 2014

This morning I did some further research and found that using a non-hidden <apex:inputText> works.

Example:

<apex:inputText id="templateId" value="{!templateId}" style="display: none;">
    <apex:actionSupport event="onchange" action="{!fetchTemplate}" reRender="linkPanel"/>
</apex:inputText>

@thvd thvd reopened this Sep 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants