You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Nicolas Kalkhof <nk...@web.de> on 2007/06/06 13:14:18 UTC

[trinidad] how do components work during ppr?

hello,

i have some basic questions about how trinidad/adf components work during ppr. i wrote a custom outputtext component but didn't get ppr to work at all. it seems that i miss the basic understanding how for example the tr:outputtext component obtains the new data from the model during a ppr request.

my custom tag handler class extends UIXOutputTag and uses setProperties() to set the values to my component. in my renderer class like this:

public class RichSymbolTextTagHandler extends UIXOutputTag { // JSF 1.2 compliant!
  
  private ValueExpression valueTextVE = null;
  private ValueExpression partialTriggersVE = null;
      
  public void release() {
    super.release();
    this.valueTextVE = null;
    this.partialTriggersVE = null;
  }
  
  final public void setValueText(ValueExpression valueTextVE) {
    this.valueTextVE = valueTextVE;
  }
  
  final public void setPartialTriggers(ValueExpression partialTriggersVE) {
    this.partialTriggersVE = partialTriggersVE;
  }


  protected void setProperties(FacesBean bean) {    
    super.setProperties(bean);        
    if(this.valueTextVE != null) {                    
      if(!this.valueTextVE.isLiteralText()) { // unified EL 
        bean.setProperty(RichSymbolText.VALUE_TEXT_KEY, 
        this.valueTextVE.getValue(FacesContext.getCurrentInstance().getELContext()));
      } 
      else { // plain text
        bean.setProperty(RichSymbolText.VALUE_TEXT_KEY, 
          this.valueTextVE.getExpressionString());
      }    
    }
    .........   
    }    


since the setProperties method is NOT called during a ppr request, how can my component access the data?
in my renderer implementation i use decodeInternal() to set the partialtriggers - without success:


   public void decodeInternal(FacesContext fc, UIComponent uic, String  clientId) {// JSF 1.2 compliant!
      super.decodeInternal(fc, uic, clientId);          
      String[] s = getPartialTriggers();
      RequestContext reqC = RequestContext.getCurrentInstance();
      reqC.addPartialTriggerListeners(uic, s);     
   }

is this the right way to go? could anyone give me a hint what to do?

thanks in advance and best regards,
nicolas 
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192


Re: [trinidad] how do components work during ppr?

Posted by David Steinkopff <da...@googlemail.com>.
Hi

Please use the mailinglist of Apache MyFaces
http://myfaces.apache.org/mail-lists.html

regards
David

2007/6/6, Nicolas Kalkhof <nk...@web.de>:
>
> hello,
>
> i have some basic questions about how trinidad/adf components work during
> ppr. i wrote a custom outputtext component but didn't get ppr to work at
> all. it seems that i miss the basic understanding how for example the
> tr:outputtext component obtains the new data from the model during a ppr
> request.
>
> my custom tag handler class extends UIXOutputTag and uses setProperties()
> to set the values to my component. in my renderer class like this:
>
> public class RichSymbolTextTagHandler extends UIXOutputTag { // JSF 1.2compliant!
>
>   private ValueExpression valueTextVE = null;
>   private ValueExpression partialTriggersVE = null;
>
>   public void release() {
>     super.release();
>     this.valueTextVE = null;
>     this.partialTriggersVE = null;
>   }
>
>   final public void setValueText(ValueExpression valueTextVE) {
>     this.valueTextVE = valueTextVE;
>   }
>
>   final public void setPartialTriggers(ValueExpression partialTriggersVE)
> {
>     this.partialTriggersVE = partialTriggersVE;
>   }
>
>
>   protected void setProperties(FacesBean bean) {
>     super.setProperties(bean);
>     if(this.valueTextVE != null) {
>       if(!this.valueTextVE.isLiteralText()) { // unified EL
>         bean.setProperty(RichSymbolText.VALUE_TEXT_KEY,
>         this.valueTextVE.getValue(FacesContext.getCurrentInstance
> ().getELContext()));
>       }
>       else { // plain text
>         bean.setProperty(RichSymbolText.VALUE_TEXT_KEY,
>           this.valueTextVE.getExpressionString());
>       }
>     }
>     .........
>     }
>
>
> since the setProperties method is NOT called during a ppr request, how can
> my component access the data?
> in my renderer implementation i use decodeInternal() to set the
> partialtriggers - without success:
>
>
>    public void decodeInternal(FacesContext fc, UIComponent uic,
> String  clientId) {// JSF 1.2 compliant!
>       super.decodeInternal(fc, uic, clientId);
>       String[] s = getPartialTriggers();
>       RequestContext reqC = RequestContext.getCurrentInstance();
>       reqC.addPartialTriggerListeners(uic, s);
>    }
>
> is this the right way to go? could anyone give me a hint what to do?
>
> thanks in advance and best regards,
> nicolas
> _______________________________________________________________
> SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
> kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>
>