Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 62

Thread: RichFaces/Ajax4JSF integration now available

  1. #41
    Join Date
    Apr 2007
    Location
    Italy
    Posts
    87

    Default

    Thanks miaouxp you are made my happy.

  2. #42
    Join Date
    Sep 2008
    Posts
    14

    Default Richfaces a4j:include wizard with swf flow

    hi, I am trying to implement a4j:include wizard with SWF flow but not able to get the rerender="#{flowRenderFragments}" work. Please help me to make this work.
    I have the main page with three tabs as start of the SWF flow.

    I have removed the schema definitions from the code to comply with the forum rules.
    Code:
    
          <head>
            <title>Oversight Administration </title> 
          </head>
          <body>
            <f:view>
             
              <rich:tabPanel switchType="client" >
    		        <rich:tab label="Group Management" disabled="true">
    		          Default text - Group Management
    		        </rich:tab>
    				<rich:tab label="MyGroup Preferences">
    		           <ui:include src="myGroupPreferencesTab.xhtml" />
    		        </rich:tab>
    		        <rich:tab label="My Preferences">
    					Default text - my Preferences
    		        </rich:tab>
           </rich:tabPanel>
            </f:view>
          </body>
        </html>
    In the middle tab I have a ui:include page where I am defining the form and the fragment . In this page I have <a4j:include viewId="myGroupBasicinfo.xhtml" /> to implement the first steps of the wizard.

    Code:
    <ui:composition >
    
     	<style type="text/css">
            .col1 { vertical-align:top; }
            .col2 { vertical-align:top; width:450px; }
            .wizard { width:600px; }
            .wform td { vertical-align:top; }
            .wfcol1 { text-align: right; white-space:nowrap;}
            .wfcol2 { }
            .wfcol3 { }
            .s1row td { height:30px; }
            .rich-message { color:red;  }
            
            .navPanel {
                position:absolute;
                bottom:0;
                height:23px;
                margin:0;
                padding:2px;
            }
    
        </style>
        <br/>
        <h:form id="groupWizardForm">
        <h:panelGrid width="100%" columns="2" columnClasses="col1,col2">
            <a4j:outputPanel styleClass="wizard" id="groupWizardFragment">
                <f:facet name="header">
                <h:outputText value="MyGroup Preferences" />
                </f:facet>
                <a4j:include viewId="myGroupBasicinfo.xhtml" />
            </a4j:outputPanel>
         </h:panelGrid>
         </h:form>
        <br/>
        <ui:debug hotkey="p" rendered="true"/>
    	<a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"></a4j:log>
    
    </ui:composition>
    In the myGroupBasicinfo.xhtml page I have next and save buttons with rerender="#{flowRenderFragments}"

    Code:
    <ui:composition >
        
        <div style="position:relative;height:200px">
        <h:panelGrid rowClasses="s1row" columns="3" columnClasses="wfcol1,wfcol2,wfcol3">
            <h:outputText value="Group name:" />
            <h:inputText id="shortName" value="#{oversightGroup.shortName}" required="true" />
            <rich:message  for="shortName" />
            
            <h:outputText value="Public:" />
            <h:selectBooleanCheckbox id="publicFlag" value="#{oversightGroup.publicFlag}" required="false"/>
            <rich:message  for="publicFlag" />
            
            <h:outputText value="Description" />
            <h:inputTextarea id="description" value="#{oversightGroup.description}" rows="5" cols="15" required="false"/>
            <rich:message for="description"/>
        </h:panelGrid>
        <div class="navPanel">
            <a4j:commandButton style="float:left" action="next" value="Next &gt;&gt;" reRender="#{flowRenderFragments}"/>
            <a4j:commandButton style="float:right" action="save" value="Save" reRender="#{flowRenderFragments}"/>
        </div>
        </div>
    </ui:composition>
    I defined flow definition like this..

    Code:
    <var name="oversightGroup" class="com.jpmchase.oversight.admin.model.OversightGroup" />
    	
    	<var name="user" class="com.jpmchase.oversight.admin.model.UserProfile" />
    
    	<view-state id="adminPanel">
    		<transition on="next">
    			<render fragments="groupWizardFragment" />
    		</transition>
    		<transition on="save">
    			<render fragments="xgroupWizardFragment" />
    		</transition>
    	</view-state>
    	
    	
    	<view-state id="myGroupBasicInfo" view="myGroupBasicInfo.xhtml">
    		<transition on="next" to="myGroupUserManagement">
    			<render fragments="groupWizardFragment" />
    		</transition>
    		<transition on="save">
    			<render fragments="groupWizardFragment" />
    		</transition>
    	</view-state>
    
    ...........other views
    I am able to get the first step of the flow. but clicking on next or save button is giving an illegalArgumentException groupWizardForm.

    Code:
    Caused by: java.lang.IllegalArgumentException: groupWizardForm
    	at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:620)
    	at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:858)
    I am quite new in SWF. Please help me to understand where I am doing wrong. Thanks in advance.

  3. #43
    Join Date
    Apr 2008
    Posts
    5

    Default

    Hi soubhratra,
    into the flow definition file, I think you have to prefix the rendered ID by the form ID, that is :

    Code:
    <render fragments="groupWizardForm:groupWizardFragment" />
    instead of...
    Code:
    <render fragments="groupWizardFragment" />
    I'm not sure it works after this code, but maybe ^^

  4. #44

    Default

    wah a a4j:include inside a ui:include ? which viewId will it belong ?

  5. #45
    Join Date
    Sep 2008
    Posts
    14

    Default

    Thanks for your reply. i tried removing the ui:include and putting a4j:include directly in the main page. The error is still the same. It seems that the ajax renderer is not able to find the form element when trying to rerender the view. Any suggestion will be much helpful.

    Code:
    Caused by: java.lang.IllegalArgumentException: groupWizardForm
    	at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:620)
    	at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:858)
    	at org.ajax4jsf.context.AjaxContextImpl.convertId(AjaxContextImpl.java:621)
    	at org.ajax4jsf.context.AjaxContextImpl.addRegionsFromComponent(AjaxContextImpl.java:591)
    	at org.ajax4jsf.component.AjaxActionComponent.setupReRender(AjaxActionComponent.java:96)
    	at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:60)
    	at org.ajax4jsf.component.UIInclude.broadcast(UIInclude.java:139)
    	at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:317)
    	at org.ajax4jsf.component.AjaxViewRoot.broadcastAjaxEvents(AjaxViewRoot.java:336)
    	at org.ajax4jsf.application.AjaxViewHandler.processAjaxEvents(AjaxViewHandler.java:206)
    	at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:182)
    	at org.springframework.faces.webflow.JsfView.render(JsfView.java:92)
    	at org.springframework.webflow.engine.ViewState.render(ViewState.java:257)
    	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:209)
    	at org.springframework.webflow.engine.Flow.resume(Flow.java:551)
    	at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:263)
    	... 43 more

  6. #46
    Join Date
    Sep 2008
    Posts
    14

    Default

    Experts, please help.

  7. #47
    Join Date
    Feb 2008
    Posts
    29

    Default

    Be sure to put the <f:view> tag around your code (forms and everything).

  8. #48
    Join Date
    Sep 2008
    Posts
    14

    Default

    Thanks for your reply. I have <f:view> tag in the main page wrapping everything. Even I tried with <f:view> in included pages but the result is same.

  9. #49
    Join Date
    Sep 2008
    Posts
    3

    Unhappy Action not called using a4j:support

    Hi,
    I have a problem using <a4j:support> in a form with multiple input components. The support action is only triggered when I add a <4j:region> tag to the component.

    I can see a request in the tomcat log when the region tag is not used.

    Example:

    Code:
    <a4j:region renderRegionOnly="false">	 
    	<h:selectOneListbox id="selectPeriodInterval" value="#{reportCriteria.periodInterval}" size="1">
    		<a4j:support id="supportPeriodInterval" event="onchange" action="updateInterval" reRender="#{flowRenderFragments}"/>
    		<f:selectItem  itemLabel="#{msg.emails_report_form_period_default}" itemValue="0"/>
    		<f:selectItem  itemLabel="#{msg.emails_report_form_period_1}" itemValue="1"/>
    		<f:selectItem  itemLabel="#{msg.emails_report_form_period_2}" itemValue="2"/>
    		<f:selectItem  itemLabel="#{msg.emails_report_form_period_3}" itemValue="3"/>
    	</h:selectOneListbox>
    </a4j:region>
    Please help me.

    Best regards,
    Paw

  10. #50
    Join Date
    Sep 2008
    Posts
    3

    Default

    Quote Originally Posted by kjeldpaw View Post
    Hi,
    I have a problem using <a4j:support> in a form with multiple input components. The support action is only triggered when I add a <4j:region> tag to the component.

    I can see a request in the tomcat log when the region tag is not used.

    Example:

    Code:
    <a4j:region renderRegionOnly="false">	 
    	<h:selectOneListbox id="selectPeriodInterval" value="#{reportCriteria.periodInterval}" size="1">
    		<a4j:support id="supportPeriodInterval" event="onchange" action="updateInterval" reRender="#{flowRenderFragments}"/>
    		<f:selectItem  itemLabel="#{msg.emails_report_form_period_default}" itemValue="0"/>
    		<f:selectItem  itemLabel="#{msg.emails_report_form_period_1}" itemValue="1"/>
    		<f:selectItem  itemLabel="#{msg.emails_report_form_period_2}" itemValue="2"/>
    		<f:selectItem  itemLabel="#{msg.emails_report_form_period_3}" itemValue="3"/>
    	</h:selectOneListbox>
    </a4j:region>
    Please help me.

    Best regards,
    Paw
    Solved the problem. An exception was thrown in one of the setter methods in the bean. I solved the problem after I read the richfaces faq. Added the <h:messages> and got a strange error.

    But I still having problems using the <rich:beanValidator>. It does'nt seem to work.

    Best regards,
    Paw

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •