2 Replies Latest reply on Aug 19, 2011 2:37 AM by rsoika

    togglePanel switch from a suggestionbox

    rsoika

      Hi,

      I have question if it is possible to swich a togglePanel from a SuggestionBox element?

      I have a rich:suggestionbox inside a togglePanel facet. And I would like to swich into another mode when the user have selected an entry from the suggestionbox.

      Currently my suggestion box looks like this:

       

      {code}

       

      <rich:suggestionbox for="suggestbox_user_input1" minChars="2"

                fetchValue="" nothingLabel="No entry found"

                usingSuggestObjects="true"

                suggestionAction="#{processLookupMB.suggestProcess}"

                var="suggest" width="300">

       

                <h:column>

                          <h:outputText value="#{suggest.item['$modified']}">

                                    <f:convertDateTime timeZone="#{global.timeZone}"

                                              pattern="#{global.dateTimePatternShort}" />

                          </h:outputText>

                </h:column>

       

                <a4j:support event="onselect"

                          reRender="workitem_block,#{rerender_id}">

                          <f:setPropertyActionListener

                                    value="#{suggest.item['$uniqueid']}" target="#{item_value}" />

                </a4j:support>

       

      </rich:suggestionbox>

       

      {code}

       

      What I would like to do is to add an comand to my a4j:support tag to swich into another togglePanel mode.


      Is this possible in such a scenario?

       

      thanks for help

      Ralph

        • 1. Re: togglePanel switch from a suggestionbox
          mp911de

          Hi Ralph,

          you would like to execute a JavaScript? Just use the oncomplete-attribute within the a4j:support. If it won't work, wrap your suggestionbox with a aj4:status and use the status' oncomplete.

           

          Best regards,

          Mark

          • 2. Re: togglePanel switch from a suggestionbox
            rsoika

            Hi Mark,

            thanks for your response. Yes I will try this. But my problem is here that I can not figure out how to trigger a toggleControl from javaScript. I have not found any example - only postings saying that toggleControl is not providing a javaScript API like most of the other RichFaces controls :-/ ?

            Can you give me a short example how a 'click' into my toggleControl should look like?

             

            best regards

            Ralph