1 Reply Latest reply on Feb 8, 2011 4:03 AM by nbk

    Generate dragSupport and dropSupport acceptedTypes dynamically

    nbk

      Hello,

       

      I want to generate programmatically the acceptedType values of a dragSupport and a dropSupport. My case is the following. There are some users who have to grant authorization for other user's. Those users can change from one day to another. I am displaying a list of authorizing users and a list of days to be authorized. To attach the users and the authorizations I drop the users into the days.

       

      When I recover the list of users I am defining a day to day type for dragSupport accepted types and keeping this data in a String variable accesible from JSF. For everyDay in the list i generate its own acceptedType on dropSide.

       

      My problem is that in JSF I put something like:

       

      <rich:dragSupport dragType="#{myBackingBean.userTable[row].acceptedTypes}"> where acceptedType is something like 'type02082011, type02102011'

       

      and

       

      <rich:dropSupport acceptedType="#{myBackingBean.dayTable[otherrow].acceptedTypes}"> where if day is 02/08/2011 acceptedTypes has 'type02082011'.

       

      My problem is that after some tracing and debugging I've seen that acceptedType and dragType are not interpreting the EL to get the value of the properties on my backingBean, they literally read "#{myBackingBean.userTable[row].acceptedTypes}" and "#{myBackingBean.dayTable[otherrow].acceptedTypes}" so that I'm never able to drop.

       

      Is there a way to force EL interpretation over fields acceptedType and dragType. Am I missing something else? I'm quite newbee.

        • 1. Generate dragSupport and dropSupport acceptedTypes dynamically
          nbk

          Ok. I noticed I was wrong about this. It actually is getting the resulting value of EL. I have a String variable attached to the value and when I print with a javascript alert the value of the fields it is dinamically getting the right values. But, when I goto drop it does not accept a value that should be accepted.

           

          I'm trying with a dragSupport that after executing my function has dragType="emp02042011, emp02082011" and a dropSupport that after executing my other function for days has acceptedTypes="emp02082011". But I'm not aloud to drop the values from the drag into the drop.

           

          Thinking about it, may it be so that as in my drag I have multiple values separated by ',' (as a literal would) my drag is not considering that separation and considers that the whole string been recovered from my function is a single type(I mean it's reading type 'emp02042011, emp02082011' and not like this 'emp02042011' and 'emp02082011'). If it were so, how could I make the separation for the dragType to accept different differenced types?