Skip to Content
avatar image
Former Member

Date Navigator : parameter passing

Hi,

I am very new to this domain and need a help in the UI element DateNavigator.

On selection of a particular week, the action method created for the view gets invoked but parameter values haven't passed.

For the action I had created two parameters week(int) and year(int).On debugging I find that none of the parameters were passed.

Rahul

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 07, 2006 at 03:41 AM

    Thanks for all the inputs.

    Sebastian, you mentioned of binding the value (selected date) of Date Navigator to context. I find two properties of DateNavigator firstSelectedDate and lastSelected date, which one to bind (there is no date range involved in my case).

    Should I then parse the date and get the week and year values from it.When I select a week from the Navigator would the date attribute hold some value.

    In the dateNavigator API, in events section it is mentioned

    • onWeekSelect

    Specifies the action that is carried out when the user chooses a week. Event parameters are the chosen weeks (in the range of 1 to 53) and the chosen year.

    Event Parameter Type

    week int

    year int

    I would like to use this method.Please tell me how to map parameters.I have written the following lines in the view

    public void onActionWeekSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, int week, int year )

    {

    //@@begin onActionWeekSelect(ServerEvent)

    Integer weekNum = new Integer(week);

    Integer yearNum = new Integer(year);

    wdContext.currentContextElement().setWeekNumber(weekNum.toString());

    wdContext.currentContextElement().setYear(yearNum.toString());

    //@@end

    }

    On debugging it shows null parameters and week and year has initial values.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Armin,

      Thx for the reply. I will open the OSS tommorow (monday 25 of September).

      Thx for all the help.

      Kind regards,

      Maarten.

  • avatar image
    Former Member
    Mar 06, 2006 at 12:45 PM

    This is a Tree example of how you map attributes...

    public static void wdDoModifyView(IPrivateWoChooseTUDTree wdThis, IPrivateWoChooseTUDTree.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

    {

    //@@begin wdDoModifyView

    IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNodeType1");

    treeNode.mappingOfOnAction().addSourceMapping( "path", "element");

    //@@end

    }

    The TreeNode's attribute "path" is mapped to the attribute "element" of the onAction:

    public void onActionObjectSelected(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.vattenfall.pm.wdp.IPrivateWoChooseTUDTree.ITUDNotifobjprt_TreeElement element )

    {

    //@@begin onActionObjectSelected(ServerEvent)

    ..

    //@@end

    }

    /Mikael

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 06, 2006 at 11:19 AM

    Rahul,

    your have to bind the value (selected date) of the DateNavigator to your context. Then you can evalute this value in your action handler method.

    Btw, parameters in action handler methods are only useful when you are using dynamically created action. You can pass a value to determine which control has fired the action. In your case you should use the context for data transport.

    Sebastian

    Message was edited by: Sebastian Voss

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      <i>Btw, parameters in action handler methods are only useful when you are using dynamically created action. You can pass a value to determine which control has fired the action. In your case you should use the context for data transport</i>

      That's not correct. Action handler parameters are also useful for statically created actions. Event parameter values may be transported into action handler parameters using <i>parameter mapping</i>.

      Armin

  • avatar image
    Former Member
    Mar 07, 2006 at 09:27 AM

    Thankyou Armin, for explaining me parameter mapping.

    Rahul

    Add comment
    10|10000 characters needed characters exceeded