on 02-04-2008 4:10 PM
Hi,
I'm new in webdynpro java and i try to do something and i certainly i have made a mistake.
You could see the screen about my compilation error here:
It's a simple example of the navigation on 2 view but i have add a condition for going on the second view...and it's after i have add this little custom code the builds generate errors...
[http://fdf.cod.free.fr/My_test.JPG]
[http://fdf.cod.free.fr/My_fisrview.JPG]
[http://fdf.cod.free.fr/the_code_i_have%20add.JPG]
Don't kno if it's an syntac error ( maybe i have to put << ...) or if i have to put this custom code on an other place.
Thx by advance.
Please check the "Tasks" view for errors. If there are any, try to correct them using the WD tools. In one of your screenshots, there appears an "Invalid controller usage" error for the component controller. Please fix this before writing code in the Java editor.
This is necessary because the code generation will not run as long as there are still errors in the metadata of your application.
To your other question. From the screenshot I guess there is a context node named "Person" with attributes "BeginDate" and "End Date", probably of type "date".
Before writing code, make yourself comfortable with the context API. Don't just guess the right code.
Here you probably want to have something like
Date beginDate = wdContext.currentPersonElement().getBeginDate();
Date endDate = wdContext.currentPersonElement().getEndDate();
if ( beginDate.before(endDate) )
{
wdThis.wdFirePlugToDetailView();
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK now without my little code there is no error during a rebuild.
There is a node witch name is Person with BeginDate and EndDate like attributes.
I thought that like i have made the mapping of this node in my view that i have acces to Person.BeginDate naturally;and that i needn't writte this lines in my "view"implementation.
Date beginDate = wdContext.currentPersonElement().getBeginDate();
Date endDate = wdContext.currentPersonElement().getEndDate();
...but maybe i have to writte this code in an other place...
Edited by: Fabrice BABY on Feb 5, 2008 12:45 PM
Edited by: Fabrice BABY on Feb 5, 2008 12:46 PM
Hey baby,
you write the following code in the action you want to trigger it to the next view.
Date beginDate = wdContext.currentPersonElement().getBeginDate();
Date endDate = wdContext.currentPersonElement().getEndDate();
if ( beginDate.before(endDate) )
{
wdThis.wdFirePlugToDetailView();
}
Note : Make sure that the data type of the Date is of type java.lang.Sql; but not of java.lang.Util;
There are in fact two context APIs, the generic API (IWDNode, IWDNodeElement, etc.) and the typed API. The typed API is generated from the context definitions you made in the IDE and allows typed access to the context.
In your example, the typed API will contain interfaces and methods like
IPersonNode, IPersonElement, IPersonElement.getStartData() etc.
This is all described in detail in the book "Inside Web Dynpro for Java" by Chris Whealy.
Armin
The cited package names are wrong. You should in fact use java.sql.Date for attributes with designtime type "date". The mapping between designtime and runtime types is described here:
http://help.sap.com/saphelp_nw70/helpdata/en/42/c04c950ad21d65e10000000a1553f6/content.htm
Armin
HI baby,
Make sure that the comparator you have used in the " if " clause is a valid one ( i.e, the " < " ) for the date data type or not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems to be problem, with compilation error.
if(true){
}
....it is written as
IF (////conditon){
}
Try to comment your condition and run the application, if it runs fine....check your condition statement.
You can get Examples in the SDN,
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.