Commit 2b312af0 authored by Guillaume Lépine's avatar Guillaume Lépine
Browse files

FORMS-700 : Default value for parent id

parent 18bcbb93
......@@ -185,7 +185,7 @@ public abstract class AbstractFormQuestionJspBean extends AbstractJspBean
protected String processQuestionCreation( HttpServletRequest request, String viewManageQuestions ) throws CodeAlreadyExistsException
{
int nIdStep = Integer.parseInt( request.getParameter( FormsConstants.PARAMETER_ID_STEP ) );
int nParentGroup = Integer.parseInt( request.getParameter( FormsConstants.PARAMETER_ID_DISPLAY_PARENT ) );
int nParentGroup = NumberUtils.toInt( request.getParameter( FormsConstants.PARAMETER_ID_DISPLAY_PARENT ), 0 );
int nIdType = Integer.parseInt( request.getParameter( FormsConstants.PARAMETER_ID_ENTRY_TYPE ) );
if ( ( _step == null ) || nIdStep != _step.getId( ) )
......@@ -429,7 +429,7 @@ public abstract class AbstractFormQuestionJspBean extends AbstractJspBean
protected Map<String, Object> initCreateGroupModel( HttpServletRequest request )
{
int nIdStep = NumberUtils.toInt( request.getParameter( FormsConstants.PARAMETER_ID_STEP ), FormsConstants.DEFAULT_ID_VALUE );
_nIdParentSelected = NumberUtils.toInt( request.getParameter( FormsConstants.PARAMETER_ID_DISPLAY_PARENT ), FormsConstants.DEFAULT_ID_VALUE );
_nIdParentSelected = NumberUtils.toInt( request.getParameter( FormsConstants.PARAMETER_ID_DISPLAY_PARENT ), 0 );
if ( ( _step == null ) || ( nIdStep != FormsConstants.DEFAULT_ID_VALUE && nIdStep != _step.getId( ) ) )
{
......@@ -484,7 +484,7 @@ public abstract class AbstractFormQuestionJspBean extends AbstractJspBean
{
int nIdStep = Integer.parseInt( request.getParameter( FormsConstants.PARAMETER_ID_STEP ) );
int nIdTypeEntry = Integer.parseInt( request.getParameter( FormsConstants.PARAMETER_BUTTON_TYPE_ENTRY ) );
_nIdParentSelected = Integer.parseInt( request.getParameter( FormsConstants.PARAMETER_ID_DISPLAY_PARENT ) );
_nIdParentSelected = NumberUtils.toInt( request.getParameter( FormsConstants.PARAMETER_ID_DISPLAY_PARENT ), 0 );
_step = getFormDatabaseService( ).findStepByPrimaryKey( nIdStep );
if ( _step == null )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment