Messages posted by knob-creek
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
Messages posted by: knob-creek  XML
Profile for knob-creek -> Messages posted by knob-creek [37] Go to Page: 1, 2, 3 Next 
Author Message
We were just bitten by that bug, too. It is still present in 1.8.2. Did you happen to find a solution? I have opened a jira bug for it; if this problem is still present for you, you might want to vote for it.
Something i noticed today and which might be interesting for others, too:

if an inputText contains some JavaScript filtering input key events (e. g. for allowing only digits), this is usually done like

Code:
<ice:inputText ... onkeypress="return digitsOnly(this, event);" ... />


This breaks the actionListener, as ICEfaces renders this into

Code:
<input ... onkeypress="return digitsOnly(this, event);iceSubmit(form,this,event);" ... />


where iceSubmit() is obviously never called. Since having to know how ICEfaces manipulates the onkeypress value break encapsulation, ICEfaces should render something like

Code:
function foo() { ... }; var result = foo(); iceSubmit(form,this,event);return result;


with ... being the code given in the onkeypress attribute.
... and this doesn't even help. If the first button on the page, which seems to be the real default button, has an action listener, too, that one will be called. :-/ This is, because ICEfaces renders all buttons as submit buttons. All you can do in the end is to kludge some JavaScript into your JSP.

Could we please have a real solution for changing the default action, i. e. handling the <enter> event?
Thank you for that workaround. I have patched our 1.8.1 libs as explained in the above jira issue. This patch was accepted for 1.8.2, meanwhile.
You can find a fix attached to the corresponding JIRA issue.
The rowSelector component is not explicitly filtered out as it should; it is rendered in the "else" part of the code mentioned in the thread about rendering graphics. So maybe, there are a few more exceptions to be considered.

I'll come up with a patch against the 1.8.1 sources later on. And we should open a JIRA issue.
If i understand your code snippets correctly, your class design is not as expected by the row selector:

  • Each row object must have its own selected property.
  • ICEfaces sets and unsets this property using the row variable of your table using the value attribute of the rowSelector.
  • For simple cases, you don't need the row selection listener at all,
  • but if your table is single-select, you may take advantage of the clickedRow attribute of the rowSelector.

    BTW: you get a RowSelectorEvent for each select and deselect event, you have to check for RowSelectorEvent.isSelected().
  • Micel wrote:
    ha alguien más le ocurre esto?

    Muchas gracias 


    If you want us to understand (and maybe answer) your question, it would be helpful to write it in English.

    samunoz1 wrote:
    However, for me row objects are entity beans. In order to better adhere to the Single Level Abstraction Principle I rather not move ui handling code there ... especially since these classes reside in the EJB project of the enterprise application.

    I guess there is some way to do this via composition, but would I need a row wrapper handler for each of my entities ... 


    This is exactly what we do. The selected attribute as well as the action method for the selection event both are not part of the server side object, but are decorated on the client side. The delegate methods can easily be generated by eclipse (or whatever environment you prefer).

    SamuelJava wrote:
    <ice:rowSelector id="rs1" selectionListener="#{proyecto.selectionListener1}" /> 


    Of course you can direct your selection listener to the managed bean and than act upon the selected index, but the point of my construction is, that the event is directly delivered to the selected row object.

    ad-rocha wrote:
    I'd like to use the second option. It seems more elegant. 

    This is, why i prefer it, too.

    ad-rocha wrote:
    What is the corresponding jspx piece of code for this? Is SelectableRowObject a managed bean also? 

    Well, in fact not really. In your jspx, your table is built with a variable like this:
    Code:
    <ice:dataTable value="#{managedBean.list}" var="row">

    You usually use this row variable to access the column data
    Code:
    <ice:column><ice:outputText value="#{row.someValue}" /></ice:column>

    but you can use it for method binding as well:
    Code:
    <ice:rowSelector ... selectionListener="#{row.handleRowSelection}" />


    So the row object is "managed" by the data table iterator, but it is not a managed bean, as it isn't declared in faces-config.xml.
    The Data Paginator buttons are not at the correct places sometimes since 1.8 RC2. This can be seen e.g. in the component showcase, when clicking on Table -> Columns first and on Table -> Data Paginator next.

    This behaviour could not be observed with 1.7.2.

    I have opened Bug ICE 4254 regarding this.
    Please ignore this. The value change listener indeed threw a NPE, as input.getSubmittedValue() returns null if the value was left unchanged.
    When i try to set the focus to a specific inputText, there i get an Exception.

    This is what i do:

    JSPX:
    Code:
                    <ice:inputText id="awsEingabe"
                       value="#{kontierung.anweisung.aws}"
                       binding="#{kontierung.aws}"
                       valueChangeListener="#{kontierung.setzeFokus}"
                       onkeypress="return nurZiffern(this, event);" />
                    <ice:inputText id="sksEingabe"
                       value="#{kontierung.anweisung.sks}"
                       binding="#{kontierung.sks}"
                       valueChangeListener="#{kontierung.setzeFokus}"
                       onkeypress="return nurZiffern(this, event);" />
     

    (the onkeypress method is a small javascript to filter out anything but digits).

    The valueChangeListener is called correctly (PhaseId = ANY_PHASE) and then tries to set the focus to one of the component-bound HtmlInputText fields:
    Code:
              LOG.info("setzeFokus(" + ((HtmlInputText)ev.getSource()).getId() + "): " + ev.getNewValue() + " (" + ev.getPhaseId() + ")");
              if (!_awsPattern.matcher((String)_aws.getSubmittedValue()).matches()) {
                 LOG.info("setzeFokus(): aws nicht plausibel: " + _aws.getSubmittedValue());
                 _aws.requestFocus();
              }
              else if (!_sksPattern.matcher((String)_sks.getSubmittedValue()).matches()) {
     


    This yields an exception, however:
    Code:
     11:11:15,910 INFO  [Kontierung] setzeFokus(sksEingabe): 111 (ANY 0)
     11:11:15,926 WARN  [lifecycle] java.lang.NullPointerException
     java.lang.IllegalStateException: java.lang.NullPointerException
     	at javax.faces.component.MethodBindingValueChangeListener.processValueChange(MethodBindingValueChangeListener.java:107)
     	at javax.faces.event.ValueChangeEvent.processListener(ValueChangeEvent.java:134)
     	at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
     	at com.icesoft.faces.component.ext.HtmlInputText.broadcast(HtmlInputText.java:682)
     

    My first thought was, that this exception might occur when calling one of the getSubmittedValue() methods, my own method does not appear on the stack trace, however.

    Is this a matter of the phase, in which the valueChangeListener is called?

    This error occurs when using ICEfaces 1.7.2 SP1, i did not try 1.8 yet.

    Regards,

    - Thomas
    I suspect, ICEfaces already does at least an AJAX call on every keypress.

    This is what is rendered for a regular <ice:inputText>:

    Code:
     <input
      id="links:field"
      class="iceInpTxt"
      type="text"
      value=""
      title="Text"
      onmousedown=";this.focus();"
      onkeypress="iceSubmit(form,this,event);"
      onfocus="setFocus(this.id);"
      onblur="setFocus('');setFocus('');iceSubmitPartial(form,this,event); return false;"
      name="links:field"
      style=""/>
     


    Now i would like to know how to direct this onkeypress="iceSubmit(form,this,event);" to my java code. A valueChangeListener isn't called,
     
    Profile for knob-creek -> Messages posted by knob-creek [37] Go to Page: 1, 2, 3 Next 
    Go to:   
    Powered by JForum 2.1.7ice © JForum Team